about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-12-23 12:14:01 -0800
committerKartik Agaram <vc@akkartik.com>2020-12-23 12:14:01 -0800
commit63362f814bed6d48f1c83abc97cac8d46bd3de6f (patch)
tree3064fa8955fe8dadff0d7631cbafeb4c349d895f
parente60e0e06453788c769c457c64448fa5d00681707 (diff)
downloadmu-63362f814bed6d48f1c83abc97cac8d46bd3de6f.tar.gz
7390 - null interrupt tables
Looks like the reset loops stop if we create null handlers for the first
10 indexes in the IDT.
-rw-r--r--apps/boot.hex80
1 files changed, 69 insertions, 11 deletions
diff --git a/apps/boot.hex b/apps/boot.hex
index e526eea6..4ec143bd 100644
--- a/apps/boot.hex
+++ b/apps/boot.hex
@@ -205,8 +205,12 @@ e9 fb ff ff ff  # loop forever
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 
 # 120:
+# null interrupt handler:
+  cf  # iret
 
-00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+# padding
+# 121:
+   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
@@ -230,17 +234,71 @@ e9 fb ff ff ff  # loop forever
 # offset 200 (address 0x7e00): interrupt descriptor table
 # 32 entries * 8 bytes each = 256 bytes (0x100)
 # idt_start:
-00 00 00 00 00 00 00 00
-00 00 00 00 00 00 00 00
-00 00 00 00 00 00 00 00
-00 00 00 00 00 00 00 00
-00 00 00 00 00 00 00 00
-00 00 00 00 00 00 00 00
-00 00 00 00 00 00 00 00
-00 00 00 00 00 00 00 00
-00 00 00 00 00 00 00 00
 
-# offset 9: keyboard, following https://alex.dzyoba.com/blog/os-interrupts
+# offset 0
+  20 7d  # offset[0:16]
+  08 00  # segment selector (gdt_code)
+  00  # unused
+  8e  # 1/p 00/dpl 0 1110/type/32-bit-interrupt-gate
+  00 00  # offset[16:32]
+
+# offset 1
+  20 7d  # offset[0:16]
+  08 00  # segment selector (gdt_code)
+  00  # unused
+  8e  # 1/p 00/dpl 0 1110/type/32-bit-interrupt-gate
+  00 00  # offset[16:32]
+
+# offset 2
+  20 7d  # offset[0:16]
+  08 00  # segment selector (gdt_code)
+  00  # unused
+  8e  # 1/p 00/dpl 0 1110/type/32-bit-interrupt-gate
+  00 00  # offset[16:32]
+
+# offset 3
+  20 7d  # offset[0:16]
+  08 00  # segment selector (gdt_code)
+  00  # unused
+  8e  # 1/p 00/dpl 0 1110/type/32-bit-interrupt-gate
+  00 00  # offset[16:32]
+
+# offset 4
+  20 7d  # offset[0:16]
+  08 00  # segment selector (gdt_code)
+  00  # unused
+  8e  # 1/p 00/dpl 0 1110/type/32-bit-interrupt-gate
+  00 00  # offset[16:32]
+
+# offset 5
+  20 7d  # offset[0:16]
+  08 00  # segment selector (gdt_code)
+  00  # unused
+  8e  # 1/p 00/dpl 0 1110/type/32-bit-interrupt-gate
+  00 00  # offset[16:32]
+
+# offset 6
+  20 7d  # offset[0:16]
+  08 00  # segment selector (gdt_code)
+  00  # unused
+  8e  # 1/p 00/dpl 0 1110/type/32-bit-interrupt-gate
+  00 00  # offset[16:32]
+
+# offset 7
+  20 7d  # offset[0:16]
+  08 00  # segment selector (gdt_code)
+  00  # unused
+  8e  # 1/p 00/dpl 0 1110/type/32-bit-interrupt-gate
+  00 00  # offset[16:32]
+
+# offset 8
+  20 7d  # offset[0:16]
+  08 00  # segment selector (gdt_code)
+  00  # unused
+  8e  # 1/p 00/dpl 0 1110/type/32-bit-interrupt-gate
+  00 00  # offset[16:32]
+
+# offset 9
   20 7d  # offset[0:16]
   08 00  # segment selector (gdt_code)
   00  # unused