Programming the System Clock

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
n38
Posts: 2
Joined: Wed Nov 01, 2006 1:51 am

Programming the System Clock

Post 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.
User avatar
carbonBased
Member
Member
Posts: 382
Joined: Sat Nov 20, 2004 12:00 am
Location: Wellesley, Ontario, Canada
Contact:

Post by carbonBased »

n38
Posts: 2
Joined: Wed Nov 01, 2006 1:51 am

Post 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.
User avatar
gaf
Member
Member
Posts: 349
Joined: Thu Oct 21, 2004 11:00 pm
Location: Munich, Germany

Post 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
Post Reply