about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--boot.subx31
1 files changed, 18 insertions, 13 deletions
diff --git a/boot.subx b/boot.subx
index dd01f409..d1d8a3bc 100644
--- a/boot.subx
+++ b/boot.subx
@@ -164,7 +164,9 @@
   66 83 c8 01  # eax <- or 0x1
 == code
   0f 22/cr<- 3/mod/direct 0/rm32/cr0 0/r32/eax
-  # . far jump that sets cs to offset 8 in the gdt in the process
+  # far jump to initialize_32bit_mode that sets cs to offset 8 in the gdt in the process
+  # We can't refer to the label directly because SubX doesn't have syntax for
+  # segment selectors. So we pin initialize_32bit_mode instead below.
   ea/jump-far-absolute 0x00087d00/disp32  # address 0x7d00 in offset 8 of the gdt
 
 == data
@@ -219,20 +221,21 @@ gdt_descriptor:
   0x17/imm16  # final index of gdt = size of gdt - 1
   gdt_start/imm32/start
 
-# padding
-# fe:
-                                          00 00
-
-## 32-bit code from this point (still some instructions not in SubX)
+## 32-bit code from this point
 
-# offset 100 (address 0x7d00):
-# initialize_32bit_mode:
+== code 0x7d00
+initialize_32bit_mode:
+== data
+  # TODO: SubX doesn't understand 66 prefix
   66 b8 10 00  # ax <- offset 16 from gdt_start
-  8e d8  # ds <- ax
-  8e d0  # ss <- ax
-  8e c0  # es <- ax
-  8e e0  # fs <- ax
-  8e e8  # gs <- ax
+== code
+  8e/seg-> 3/mod/direct 0/rm32/ax 3/r32/ds
+  8e/seg-> 3/mod/direct 0/rm32/ax 2/r32/ss
+  8e/seg-> 3/mod/direct 0/rm32/ax 0/r32/es
+  8e/seg-> 3/mod/direct 0/rm32/ax 4/r32/fs
+  8e/seg-> 3/mod/direct 0/rm32/ax 5/r32/gs
+
+== data
 
 # 10e:
   bc 00 00 07 00  # esp <- 0x00070000
@@ -271,6 +274,8 @@ gdt_descriptor:
     e0  # 11/mod/direct 100/r32/CR4 000/rm32/eax
   e9 d0 16 00 00  # jump to 0x9400 [label]
 
+== data
+
 # padding
 # 130:
 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ion' href='/danisanti/profani-tty/blame/src/contact_list.h?id=a061b0d45261e39c53e5734518eb2860706ef99f'>^
768b2aa4 ^
d13794bf ^
2f2fa8de ^
a0eda420 ^
8e90f7a4 ^
a061b0d4 ^

0756a9ce ^
a336148c ^
e0732ad0 ^
e486114e ^
78bd151c ^

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46