Page 1 of 1

Using hardware interrupts while servicing software interrupt

Posted: Wed May 29, 2024 11:46 am
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.

Re: Using hardware interrupts while servicing software inter

Posted: Tue Jun 11, 2024 12:41 pm
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.