summaryrefslogtreecommitdiff
path: root/bootasm.S
diff options
context:
space:
mode:
Diffstat (limited to 'bootasm.S')
-rw-r--r--bootasm.S8
1 files changed, 5 insertions, 3 deletions
diff --git a/bootasm.S b/bootasm.S
index 059cc1b..56175ce 100644
--- a/bootasm.S
+++ b/bootasm.S
@@ -51,8 +51,10 @@ seta20.2:
orl $CR0_PE, %eax
movl %eax, %cr0
- # Jump to next instruction, but in 32-bit code segment.
- # Switches processor into 32-bit mode.
+ # This ljmp is how you load the CS (Code Segment) register.
+ # SEG_ASM produces segment descriptors with the 32-bit mode
+ # flag set (the D flag), so addresses and word operands will
+ # default to 32 bits after this jump.
ljmp $(SEG_KCODE<<3), $start32
.code32 # Assemble for 32-bit mode
@@ -88,5 +90,5 @@ gdt:
SEG_ASM(STA_W, 0x0, 0xffffffff) # data seg
gdtdesc:
- .word (gdtdesc - gdt - 1) # sizeof(gdt) - 1
+ .word (gdtdesc - gdt - 1) # sizeof(gdt) - 1
.long gdt # address gdt