Using hardware interrupts while servicing software interrupt

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
jsmall32
Posts: 1
Joined: Wed May 29, 2024 11:27 am

Using hardware interrupts while servicing software interrupt

Post by jsmall32 »

I have run into an interesting problem. When I am servicing a software interrupt, hardware interrupts have no effect. For example, if a program sends a syscall interrupt to read from disk, the kernel has to then call a function to read from an IDE drive, which relies on a hardware interrupt to signal that the drive is ready to be read. However, without the hardware interrupt functioning, the driver just hangs as it waits for something that will never happen.

Similarly, if a program sends a syscall interrupt to read from the keyboard, the kernel will then wait for a key to be pressed. But if the hardware interrupt isn't working, then once again, the driver will hang as it waits.

Is there something I need to enable/disable in order to allow nested interrupts like this? I thought that I could at least find a workaround for IDE... but for the keyboard (and anything else I may implement in the future), I'm not as certain.
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: Using hardware interrupts while servicing software inter

Post by nullplan »

If the software interrupt is installed into the IDT as an interrupt gate, then the interrupt flag is disabled when the interrupt is invoked. That is normally a good thing, but you do need to re-enable interrupts once you have completed the transition into kernel mode.
Carpe diem!
Post Reply