Page 1 of 1

Real time clock

Posted: Wed Nov 13, 2002 6:46 pm
by gtsphere
okay, I have been trying to get a clock running and now I finally have some possible solutions, but, my 1 question is that I have been told that i need an IDT before I can get the time through int 0, with Al BL CL and DL, is this true?

Re:Real time clock

Posted: Wed Nov 13, 2002 6:48 pm
by Tom
yea...you need a IDT.

Re:Real time clock

Posted: Wed Nov 13, 2002 7:43 pm
by Curufir
No, you can access the real time clock get the current time without an IDT. You will however need an IDT to use the system timers on IRQ 0, which is what I think you're talking about.

Curufir

Re:Real time clock

Posted: Wed Nov 13, 2002 7:45 pm
by gtsphere
basically, what I want to do is make a timer that simply counts seconds into a variable, is that possible without an IDT?

Re:Real time clock

Posted: Wed Nov 13, 2002 7:46 pm
by Tom
probly not...

Re:Real time clock

Posted: Wed Nov 13, 2002 7:49 pm
by Curufir
That all depends on just how accurate you want it to be. Without the setting up a timer to interrupt every second (For which you need an IDT) then no, not without looping and maybe checking the real time clock until a second has passed, or executing a series of instructions you hope will take 1 second to accomplish.

Although if you're still in real mode I guess you could remap the clock interrupt in the IVT and increment your counter every 18.2 hz.

Curufir