Question

What interrupt would you hook from DOS to get the real-time clock?

Was it helpful?

Solution

The realtime clock cannot generate interrupts. It was (maybe still is) coupled with the cmos-ram because it was buffered by the battery. It can only be accessed via the ports 0x70 and 0x71.

You can however hook the interrupt of the PIT (programmable interrupt timer). That's interrupt 0x08 (e.g. hardware IRQ0). As far as I remember that interrupt was configured by dos to be called about 27 times per second. You can program it to other frequencies as well but that will mess up the dos-clock a bit (port 0x40 an 0x43).

OTHER TIPS

http://www.control.com/thread/1026238869 has some info on this. Hook int 08h (don't forget to redispatch it); that is called every 55 miliseconds.

Read up on the Intel 8259 family of Programmable Interrupt Controllers. According to this, it's interrupts 8 (master) and 112 (slave). Here's a very technical document on the 8259A: http://pdos.csail.mit.edu/6.828/2008/readings/hardware/8259A.pdf

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top