Page 1 of 1

CMOS and clock (like a IRQ8)

Posted: Sat Oct 11, 2008 12:20 pm
by djsilence
Hi, people!

Wanna ask you:
Does anyone of you know how to improve time-support (e.g. how to know in my own OS what time is it).
I've got linux 0.0-0.1 kernel, there is one way, but I cannot use it (if I do - my OS will be a Linux 0.0-0.1 kernel! :-) )

Thanks for trying.

Re: CMOS and clock (like a IRQ8)

Posted: Sat Oct 11, 2008 2:02 pm
by kmtdk
well,
to use the CMOS, you only need to do the fowling:
( it would be a good ideer to see this page, to understand what is happning here: http://www.bioscentral.com/misc/cmosmap.htm)

Code: Select all

mov ax,0x04 ; INDEX 4 "REAL TIME COUNT"hours
out 0x70,al ; CMOS input port
in al,0x71 ; CMOS data port
now you have the hours in al
The format of the time is: XY
meaning that if the hour is 16 (24 hour system)
the value of al is "16"


Hope it helps

KMT dk

Re: CMOS and clock (like a IRQ8)

Posted: Sat Oct 11, 2008 2:22 pm
by djsilence
Thanks, KMT dk!

Really interesting link.

Daniel.

Re: CMOS and clock (like a IRQ8)

Posted: Sat Oct 11, 2008 2:27 pm
by Troy Martin
Well this is quite useful! I think I'm going to use this in my OS :)