[Solved] AHCI - Enabling port interrupts causes hanging
Posted: Tue Dec 24, 2024 2:35 pm
Hello,
I am following the instructions in https://wiki.osdev.org/AHCI. So far I have been able to get basic reading and writing from disk set up.
Now I am following the checklist at the end to set up interrupts. I've found when setting PxIE.DHRE or PxIE.PSE, execution stops completely and I have no idea why. Setting any other interrupt bit does not cause this to happen. Disabling paging before setting the register didn't help either.
PCI Bus mastering and interrupts are enabled.
Interrupts are enabled in the GHC register.
HBA and port memory have been memory mapped with caching disabled.
The HBA and port has been reset before trying to set the register.
Has anyone else encountered this problem? Does anyone know what might be going on? The AHCI code is attached, if more is needed let me know. Any help is appreciated.
As an example:
This will cause "One" to be printed, "Two" will not print.
I am following the instructions in https://wiki.osdev.org/AHCI. So far I have been able to get basic reading and writing from disk set up.
Now I am following the checklist at the end to set up interrupts. I've found when setting PxIE.DHRE or PxIE.PSE, execution stops completely and I have no idea why. Setting any other interrupt bit does not cause this to happen. Disabling paging before setting the register didn't help either.
PCI Bus mastering and interrupts are enabled.
Interrupts are enabled in the GHC register.
HBA and port memory have been memory mapped with caching disabled.
The HBA and port has been reset before trying to set the register.
Has anyone else encountered this problem? Does anyone know what might be going on? The AHCI code is attached, if more is needed let me know. Any help is appreciated.
As an example:
Code: Select all
kprintf("One\n");
mem->ports[port].ie = PxIE_TFEE | PxIE_HDRE;
kprintf("Two\n");