views:

705

answers:

4

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

A: 

Here is a whole list of them, not sure what you are looking for exactly. http://www.htl-steyr.ac.at/~morg/pcinfo/hardware/interrupts/inte2dm8.htm

From: http://www.htl-steyr.ac.at/~morg/pcinfo/hardware/interrupts/inte1at0.htm

Geoffrey Chetwood
A: 

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

Adam Rosenfield
+1  A: 

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).

Nils Pipenbrinck
That's the one, but it's 18 and a bit times a second.
pjc50
+1  A: 

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.

pjc50