multiboot1: When on BIOS, set IDTR to BIOS defaults before handoff
diff --git a/stage23/protos/multiboot1.32.c b/stage23/protos/multiboot1.32.c
index 45d81ce8..8c8786ac 100644
--- a/stage23/protos/multiboot1.32.c
+++ b/stage23/protos/multiboot1.32.c
@@ -2,9 +2,26 @@
#include <stddef.h>
#include <stdbool.h>
#include <mm/vmm.h>
+#if bios == 1
+# include <sys/idt.h>
+#endif
__attribute__((noreturn)) void multiboot1_spinup_32(
uint32_t entry_point, uint32_t multiboot1_info) {
+#if bios == 1
+ struct idtr idtr;
+
+ idtr.limit = 0x3ff;
+ idtr.ptr = 0;
+
+ asm volatile (
+ "lidt %0"
+ :
+ : "m" (idtr)
+ : "memory"
+ );
+#endif
+
asm volatile (
"cld\n\t"
