Timer interrupt handling in DOS real mode using gcc and NASM
Posted: Wed Sep 20, 2006 12:28 am
I want to trigger and handle a timer interrupt (INT 08H) in DOS real mode. I need an example how can I achieve it using INT 21h with the functions 25h and 35h. I am using NASM for assembly programming and gcc for c programming.
My algorithm should be like
main()
{
...
...
intialize 8259 pic;
program 8253 for desired time interval (interrupt for every 10 ms);
while(1);/* infinite loop */
}
---assembly code---
timer_isr_hook:
Hook the user defined timer interrupt isr to the timer interrupt(08).
timer_isr:
save the registers
call timer_hand /* this should be a c function in which I want to call
the scheduler module */
restore the registers
iret
Can anyone come with a good solution for this???
My algorithm should be like
main()
{
...
...
intialize 8259 pic;
program 8253 for desired time interval (interrupt for every 10 ms);
while(1);/* infinite loop */
}
---assembly code---
timer_isr_hook:
Hook the user defined timer interrupt isr to the timer interrupt(08).
timer_isr:
save the registers
call timer_hand /* this should be a c function in which I want to call
the scheduler module */
restore the registers
iret
Can anyone come with a good solution for this???