RTC

Developer
Sep 15, 2011 at 9:25 AM

Hey Cosmos,

Before the switch to VS 2010, there was the RTC class in Cosmos.Hardware. I used it heaps since it fuelled my custom random class as well as some gui components.

I'm just wondering. Where did it go?

CMan332

Developer
Sep 15, 2011 at 1:49 PM

It's currently in the Cosmos.Hardware2 package, as it's from the old version before the compiler revamp, but it shouldn't be too difficult to get it working with the current one. Also, any chance you could format your random class in the right way so that it can plug the System.Random class? As currently that uses the system tick count, which has to be manually added to a kernel, and specially plugged for each of those kernels.

Coordinator
Sep 16, 2011 at 12:06 AM
> Before the switch to VS 2010, there was the RTC class in
> Cosmos.Hardware. I used it heaps since it fuelled my custom random class
> as well as some gui components.
>
> I'm just wondering. Where did it go?

It needs reworked for the kernel changes. Its on my list, but I have to
finish the asm debugger.
Developer
Sep 17, 2011 at 8:55 AM

Sure. I could do that. I'll also put it in with an RTC port too. I'll post it here soon.

CMan332

Developer
Sep 17, 2011 at 9:06 AM
Edited Sep 17, 2011 at 9:15 AM

Well I looked at the code, and I can't see how to read and write from the IOPorts. Can someone here help?

EDIT: No worries. I figured it out

CMan332

Developer
Sep 17, 2011 at 9:42 AM

I have a small implementation of the RTC and Random classes.

Most of the Random class comes from the mono implementation though.

RTC.cs

http://dl.dropbox.com/u/4843666/RTC.cs

RandomImpl.cs

http://dl.dropbox.com/u/4843666/RandomImpl.cs

Hope This Helps!

Coordinator
Sep 17, 2011 at 1:04 PM
> Well I looked at the code, and I can't see how to read and write from
> the IOPorts. Can someone here help?

Take a look at my ATA class.
Developer
Sep 17, 2011 at 4:35 PM
Edited Sep 17, 2011 at 8:13 PM

Currently checking to make sure it works, but I've added your RTC class, and extended it (Should support seconds, minutes, hours, days of the week, days of the month, months, years, centuries(provided it doesn't crash older computers), as well as supporting either BCD or binary mode, and supporting both 12 and 24-hour mode (it always returns in 24 hour format though) ) I will commit it to the repository once I know that it works. Will commit the random implementation in a separate commit.

 

Edit:

They both work, and I have now committed both to the repository.

Developer
Sep 19, 2011 at 2:08 AM
Edited Sep 19, 2011 at 2:12 AM

I'm glad it helped

EDIT: The source files are now removed from dropbox

CMan332