Well, I am designing this OS that actually does need 2 timers. (one to run another OS code, one for the hypervisor)
I have been trying to get CMOS timer to work(irq but it has yet to..
I am using info I found at http://www.nondot.org/sabre/os/files/Mi ... Timer.html and http://www.ousob.com/ng/interrupts_and_ ... g9116b.php
My code just does
Code: Select all
int timer_Init(){
InstallInterruptHook(IRQ_BASE_INT+8,&timer_Irq0Handler);
outportb(0x70, 0x0B);
int prev=inportb(0x71);
outportb(0x70,0x0B); //a read will reset index
outportb(0x71, prev | 0x44);
return 0;
}
Edit:
that edit was wrong
(also edited my current code)
[FIXED]
Ok, I figured out my problem that neither of the previous sources told me. The more useful source is http://www.geocities.com/SiliconValley/ ... s/rtc2.htm
At the IRQ8 handler, you must read status register C. Otherwise an interrupt will not occur again.
I have also noticed that sometimes that the CMOS clock produces much more reliable clock result between computers. Where as with the PIT on some simulations it would be extremely fast, on some computers it would be fast, and on some slow..