Displaying system time in os.

Oct 5, 2010 at 2:53 AM

When I try to display the system time in my os I keep getting a plug error.

This is the code I'm using:

DateTime CT = DateTime.Now;
Console.WriteLine("T = {0:T}", CT );
 Console.Read(); //to hold on time

And this is my error:

System.Exception: Plug needed. System.Int64 System.Date.GetSystemTimeAsFileTime()
atCosmos.IL2CPU.ILScanner.ScanMethod(MethodBase aMethod, Boolean aIsPlug)
atCosmos.IL2CPU.ILScanner.ScanQueue()
atCosmos.IL2CPU.ILScanner.Execute(MethodBase aStartMethod)
atCosmos.Compiler.Builder.Builder.RunEngine(Object aParam)
PLEASE HELP!!! :(





Oct 5, 2010 at 5:50 AM

datetime wont be implemented luckily u can use RTC

if u have using cosmos.hardware and its in ur references it will work like so

string hour, min, sec, time;

hour =

RTC.GetHours();

min =

 RTC.GetMinutes();

sec =

RTC.GetSeconds();

time = hour +

":" + min + ":" + sec;

now time equals the real time clock which if ur testing in a vm will be exactly ur normal os's but idk if u boot a physical with it

now if you are going to have this as a clock that updates on its own you need to have a loop with this code:

if (sec != RTC.GetSeconds())

{

 

hour =

 

RTC.GetHours();

min =

 

 RTC.GetMinutes();

sec =

 

RTC.GetSeconds();

time = hour +

 

":" + min + ":" + sec;

then ur output code for time

}

so good luck on ur os sorry about the different fonts it happens when u paste from visual c#

Oct 5, 2010 at 6:46 PM

Can you put it in an example im new to this RTC stuff?

Oct 6, 2010 at 1:00 AM

that is an example that is the code i use

Oct 6, 2010 at 2:42 AM

Well I keep getting this error:

Cannot implicitly convert type 'byte' to 'string'   

For all three functions

RTC.GetHours();

RTC.GetMinutes();

RTC.GetSeconds();

Oct 6, 2010 at 3:54 AM

my bad RTC.GetMinutes().ToString(); just add the tostring on all of them

Dec 24, 2010 at 5:27 PM

Doesnt work for me, I instead of the time i get 2 smilies and 1 un-normal letter.

HELP?

Coordinator
Dec 24, 2010 at 5:40 PM
Please give code/steps/what you've tried.

On Fri, Dec 24, 2010 at 6:27 PM, EntropyBoy <notifications@codeplex.com> wrote:

From: EntropyBoy

Doesnt work for me, I instead of the time i get 2 smilies and 1 un-normal letter.

HELP?

Read the full discussion online.

To add a post to this discussion, reply to this email (Cosmos@discussions.codeplex.com)

To start a new discussion for this project, email Cosmos@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com