commit 025f4ff2388d1c4e4d1b3d3fbabc6ddccfa0c6f2
parent 902cc0ed86bcc2b369ea9ecd092ac0dc32a2c705
Author: Virgil Dupras <hsoft@hardcoded.net>
Date: Sun, 6 Nov 2022 14:35:13 -0500
i386/pc: apply dummy PIC IRQ handlers to all IRQs on boot
Previously, we only targeted IRQ 0 and 6, but on real hardware, it turns out
that it's better to have those dummy handlers everywhere.
Diffstat:
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/fs/xcomp/i386/pc/kernel.fs b/fs/xcomp/i386/pc/kernel.fs
@@ -30,16 +30,21 @@ xcode int13h ( drv head cyl sec dst -- )
AX pspop, dl al mov, \ drive
cli, $18 L1 jmpfar,
-\ IRQ 0 and 6 have to be mapped to End Of Interrupt handlers early because when
-\ booting from floppy, the system hangs early from those IRQs not being handled.
-\ The rest of PIC initialization is done in /drv/pc/pic.fs
+\ To avoid lockups, we map all PIC IRQs on boot to words that acknowledge those
+\ IRQs. The rest of PIC initialization is done in /drv/pc/pic.fs
xcode piceoi pc
ax push, al $20 i) mov, $20 i) al out, ax pop, iret,
-( pc ) lblidt pc>addr 1+ 1+ @ pc>addr 8 8 * + 2dup w! 6 8 * + w!
+( pc ) lblidt pc>addr 1+ 1+ @ pc>addr 8 8 * + 2dup w!
+8 + 2dup w! 8 + 2dup w! 8 + 2dup w! 8 + 2dup w!
+8 + 2dup w! 8 + 2dup w! 8 + w!
-xcode piceoi2 \ slave IRQs have to EOI both master and slave.
+xcode piceoi2 pc \ slave IRQs have to EOI both master and slave.
pc w>e lblsysdict pc>addr ! \ last word of the kernel dict
ax push, al $20 i) mov, $a0 i) al out, $20 i) al out, ax pop, iret,
+( pc ) lblidt pc>addr 1+ 1+ @ pc>addr 16 8 * + 2dup w!
+8 + 2dup w! 8 + 2dup w! 8 + 2dup w! 8 + 2dup w!
+8 + 2dup w! 8 + 2dup w! 8 + w!
+
pc lblbootptr pc>addr !