As said in the OSDEV Wiki GDT Tutorial I reload the Code&Data segments with new descriptors
Code: Select all
reloadSegments:
; Reload CS register containing code selector:
JMP 0x08:reload_CS ; 0x08 points at the new code selector
reload_CS:
; Reload data segment registers:
MOV AX, 0x10 ; 0x10 points at the new data selector
MOV DS, AX
MOV ES, AX
MOV FS, AX
MOV GS, AX
MOV SS, AX
RET
By basic debugging I found out it's the
Code: Select all
JMP 0x08:reload_CS ;
If my kernel code segment is the second entry in the GDT (the first one being null) what have could I done wrong that it does not work?