Chuck(G)
25k Member
Depends on the platform, but the most straighforward way, IMOHO, is to hook Interrupt 1ch This is a dummy routine called by the INT 8 servicer and normally contains only an IRET instruction.
Why do this rather than 08h? Because there are some utilities and games that run the 8254 with a shorter interval to get better granularity. The usual way is to get the 8254 to interrupt, say, 4X more often, then program in a divide by 4 routine in the INT 8 servicer before passing the interrupt on to the regular time-of-day routines. 1Ch occurs down the chain, so no matter what you're running, the tick rate should be constant.
Besides, this is why interrupt 1Ch is part of the BIOS.
Why do this rather than 08h? Because there are some utilities and games that run the 8254 with a shorter interval to get better granularity. The usual way is to get the 8254 to interrupt, say, 4X more often, then program in a divide by 4 routine in the INT 8 servicer before passing the interrupt on to the regular time-of-day routines. 1Ch occurs down the chain, so no matter what you're running, the tick rate should be constant.
Besides, this is why interrupt 1Ch is part of the BIOS.