From 1afc9d3fcaa7c5992659bb8b69f639b746dda2bc Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Thu, 5 Aug 2010 21:16:55 -0400 Subject: add some comments find out the hard way why user and kernel must have separate segment descriptors --- bootasm.S | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bootasm.S') diff --git a/bootasm.S b/bootasm.S index f6af255..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 -- cgit v1.2.3