CMOS and clock (like a IRQ8)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
djsilence
Member
Member
Posts: 70
Joined: Wed Oct 01, 2008 11:18 am
Location: Ukraine, Kiev
Contact:

CMOS and clock (like a IRQ8)

Post 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.
Don't think a ****, but in ukrainian schools English is TOO BAD!
User avatar
kmtdk
Member
Member
Posts: 263
Joined: Sat May 17, 2008 4:05 am
Location: Cyperspace, Denmark
Contact:

Re: CMOS and clock (like a IRQ8)

Post 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
well, what to say, to much to do in too little space.
when it goes up hill, increase work, when it goes straight, test yourself but when going down, slow down.
User avatar
djsilence
Member
Member
Posts: 70
Joined: Wed Oct 01, 2008 11:18 am
Location: Ukraine, Kiev
Contact:

Re: CMOS and clock (like a IRQ8)

Post by djsilence »

Thanks, KMT dk!

Really interesting link.

Daniel.
Don't think a ****, but in ukrainian schools English is TOO BAD!
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: CMOS and clock (like a IRQ8)

Post by Troy Martin »

Well this is quite useful! I think I'm going to use this in my OS :)
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
Post Reply