Code: Select all
init8253:
mov al,0x34
out 0x43,al
mov ax,[esp+4]
out 0x40,al
mov al,ah
out 0x40,al
push 65535
call init8253
I printf a character 'h' to 80x24 screen every time clock interrrupt occure,I am sure my IRQ handler works right. But the 'h' was always printed at a fast very speed,at least one full line each second.That means,at least 80 clock interrupts each second. But it's initialized wih 65535. It should be 18Hz.
And, when i push a smaller argument instead of 65535, it printed more quickly.
Thus, I can not find out the answer,it seems that the 8253 just runs faster than it should. I have noticed it for a long time and i don't want to tolerate it any more.