about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-12-20 20:03:02 -0800
committerKartik Agaram <vc@akkartik.com>2020-12-20 20:03:02 -0800
commit72e34ecb63d0d26ed0568702344e44b6034227bd (patch)
treeac5473dfa8dae0f8daa130a94c3c9f2b8703b1ca
parent02135b7ae8ca3e4515ae3b9ee0940ba212e11676 (diff)
downloadmu-72e34ecb63d0d26ed0568702344e44b6034227bd.tar.gz
7360
Insert padding in a few places so we don't have to recalculate addresses
quite so much.
-rw-r--r--apps/bos/32bit.hex34
1 files changed, 21 insertions, 13 deletions
diff --git a/apps/bos/32bit.hex b/apps/bos/32bit.hex
index 80852c4c..8b396fcd 100644
--- a/apps/bos/32bit.hex
+++ b/apps/bos/32bit.hex
@@ -20,15 +20,19 @@
 # 00:
   fa
   0f 01 16  # lgdt 00/mod/indirect 010/subop 110/rm32/TODO
-    2d 7c  # *gdt_descriptor
+    38 7c  # *gdt_descriptor
   0f 20 c0  # eax <- cr0
   66 83 c8 01  # eax <- or 0x1
   0f 22 c0  # cr0 <- eax
-  ea 33 7c 08 00  # far jump to initialize_32bit_mode after setting cs to the record at offset 8 in the gdt (gdt_code)
+  ea 50 7c 08 00  # far jump to initialize_32bit_mode after setting cs to the record at offset 8 in the gdt (gdt_code)
+
+# padding
+# 15:
+                 00 00 00 00 00 00 00 00 00 00 00
 
 ## GDT: 3 records of 8 bytes each
 
-# 15:
+# 20:
 # gdt_start:
 # gdt_null:  mandatory null descriptor
   00 00 00 00 00 00 00 00
@@ -49,14 +53,20 @@
   00  # base[24:32]
 # gdt_end:
 
-# 2d:
+# 38:
 # gdt_descriptor:
   17 00  # final index of gdt = gdt_end - gdt_start - 1
-  15 7c 00 00  # start = gdt_start
+  20 7c 00 00  # start = gdt_start
+
+# padding
+# 3e:
+                                            00 00
+# 40:
+  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 
 ## 32-bit code from this point (still some instructions not in SubX)
 
-# 33:
+# 50:
 # initialize_32bit_mode:
   66 b8 10 00  # ax <- offset 16 from gdt_start
   8e d8  # ds <- ax
@@ -64,16 +74,15 @@
   8e c0  # es <- ax
   8e e0  # fs <- ax
   8e e8  # gs <- ax
-# 40:
-  e9 0a 00 00 00  # jump to 0x7c50, leaving some extra padding
+  e9 0d 00 00 00  # jump to 0x7c70, leaving some extra padding
 
 # padding
-# 45:
-                  00 00 00 00 00 00 00 00 00 00
+# 63:
+           00 00 00 00 00 00 00 00 00 00 00 00 00
 
 ## 'application' SubX code: print one character to top-left of screen
 
-# 50:
+# 70:
 # *0xb8000 <- 0x0f48
 c7  # opcode
   # modrm
@@ -89,8 +98,7 @@ e9 fd ff  # loop forever
 
 # more padding to 512 bytes
                                        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
+# 80:
 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