about summary refs log tree commit diff stats
path: root/boot.subx
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-03-23 21:27:06 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-03-23 21:27:06 -0700
commit7b89f8e67e037f014e156336efa216d5c901a283 (patch)
treecd33c5b8ce8892d28a5770a8a8bb9ca79acc507a /boot.subx
parent49a99383330f1d0d5dfb2887ad7e9fd782680c3d (diff)
downloadmu-7b89f8e67e037f014e156336efa216d5c901a283.tar.gz
reorg boot.subx
Diffstat (limited to 'boot.subx')
-rw-r--r--boot.subx19
1 files changed, 9 insertions, 10 deletions
diff --git a/boot.subx b/boot.subx
index 59569889..69d94c42 100644
--- a/boot.subx
+++ b/boot.subx
@@ -133,7 +133,7 @@
   # We can't refer to the label directly because SubX doesn't do the right
   # thing for lgdt, so rather than make errors worse in most places we instead
   # pin gdt_descriptor below.
-  0f 01 2/subop/lgdt 0/mod/indirect 6/rm32/use-disp16 0x7cf8/disp16/gdt_descriptor
+  0f 01 2/subop/lgdt 0/mod/indirect 6/rm32/use-disp16 0x7cf0/disp16/gdt_descriptor
   # enable paging
   0f 20/<-cr 3/mod/direct 0/rm32/eax 0/r32/cr0
   66 83 1/subop/or 3/mod/direct 0/rm32/eax 1/imm8  # eax <- or 0x1
@@ -180,11 +180,16 @@ gdt_start:
   00  # base[24:32]
 # gdt_end:
 
-== data 0x7cf8
+== data 0x7cf0
 gdt_descriptor:
   0x17/imm16  # final index of gdt = size of gdt - 1
   gdt_start/imm32/start
 
+== data 0x7cf8
+idt_descriptor:
+  ff 03  # final index of idt = size of idt - 1
+  idt_start/imm32/start
+
 ## 32-bit code from this point
 
 == code 0x7d00
@@ -202,7 +207,7 @@ initialize_32bit_mode:
   # We can't refer to the label directly because SubX doesn't do the right
   # thing for lidt, so rather than make errors worse in most places we instead
   # pin idt_descriptor below.
-  0f 01 3/subop/lidt 0/mod/indirect 5/rm32/use-disp32 0x8000/disp32/idt_descriptor
+  0f 01 3/subop/lidt 0/mod/indirect 5/rm32/use-disp32 0x7cf8/disp32/idt_descriptor
 
   # For now, not bothering reprogramming the IRQ to not conflict with software
   # exceptions.
@@ -361,13 +366,7 @@ $keyboard-interrupt-handler:epilogue:
   fb/enable-interrupts
   cf/return-from-interrupt
 
-## the rest of this file is all data
-
-== data 0x8000
-idt_descriptor:
-  ff 03  # final index of idt = size of idt - 1
-  idt_start/imm32/start
-
+== data
 Keyboard-shift-pressed?:  # boolean
   0/imm32