Page 1 of 1

Programming the System Clock

Posted: Wed Nov 01, 2006 2:05 am
by n38
I've looked around and I couldn't really find any info besides the fact that I need to use IRQ8. I read that it's best to get the time from IRQ8 and update the clock with IRQ0. I already have that part working, I just need to know how to use IRQ8 to get the system clock information. I'm writing my OS in C, normally how I would communicate with an IRQ is with the function inportb in the handler. I'm just not sure what to call to get the right information.

Posted: Wed Nov 01, 2006 10:13 pm
by carbonBased

Posted: Wed Nov 01, 2006 11:52 pm
by n38
That's just the timer interrupt, I have that part working already. Right now my OS's clock works, it just starts out at 00:00:00. I want it to start at what the CMOS's clock is set to (and eventually add in a timezone). I know I can set it using IRQ8, I'm just not sure what to send and what to read exactly.

Posted: Thu Nov 02, 2006 7:39 am
by gaf
Hello,
The CMOS is just a small area of memory that is used to permanently store system information. It can be accessed using ports as descriped in the wiki. Please note that there's a link to a CMOS memory map at the bottom of the page.

regards,
gaf