about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-06-29 21:54:22 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-06-29 21:54:22 -0700
commit069a8df45c13e2d390211ddf9aebe09a34f2e510 (patch)
tree37d79f9c1b112844a0c246b410083b0e779a1f28
parent5616691621ea4da75fb29713851da31a15d4cb81 (diff)
downloadmu-069a8df45c13e2d390211ddf9aebe09a34f2e510.tar.gz
.
-rw-r--r--timer.subx24
1 files changed, 23 insertions, 1 deletions
diff --git a/timer.subx b/timer.subx
index 9095b323..31c42955 100644
--- a/timer.subx
+++ b/timer.subx
@@ -292,7 +292,13 @@ idt_start:
   8e  # 1/p 00/dpl 0 1110/type/32-bit-interrupt-gate
   0/imm16  # target[16:32] -- timer-interrupt-handler must be within address 0x10000
 
-00 00 00 00 00 00 00 00
+# entry 9: keyboard
+  null-interrupt-handler/imm16  # target[0:16]
+  8/imm16  # segment selector (gdt_code)
+  00  # unused
+  8e  # 1/p 00/dpl 0 1110/type/32-bit-interrupt-gate
+  0/imm16  # target[16:32] -- null-interrupt-handler must be within address 0x10000
+
 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00
@@ -320,6 +326,22 @@ idt_start:
 
 == code
 
+null-interrupt-handler:
+  # prologue
+  fa/disable-interrupts
+  60/push-all-registers
+  9c/push-flags
+  # acknowledge interrupt
+  b0/copy-to-al 0x20/imm8
+  e6/write-al-into-port 0x20/imm8
+  31/xor %eax 0/r32/eax
+$null-interrupt-handler:epilogue:
+  # epilogue
+  9d/pop-flags
+  61/pop-all-registers
+  fb/enable-interrupts
+  cf/return-from-interrupt
+
 timer-interrupt-handler:
   # prologue
   fa/disable-interrupts