problem in reloading GDT
Posted: Fri Jan 23, 2004 3:10 am
my boot loader copies kernel linked at 0xc000_0000 at 0x100000.then it switches to protected mode.
the selectors in boot loader have base zero and limit 4 gb.then i jump to kernel.
in kernel i reload the selectors with base 0x4010_0000.but as soon as execute the jump instruction to load CS:IP with new values ,computer restarts.
please tell me the problem and how to remove it.
the selectors in boot loader have base zero and limit 4 gb.then i jump to kernel.
in kernel i reload the selectors with base 0x4010_0000.but as soon as execute the jump instruction to load CS:IP with new values ,computer restarts.
please tell me the problem and how to remove it.
Code: Select all
[bits 32]
[SECTION .text]
start:?????????
lgdt[GDTR] ;reload the GDT
jmp CODESEL:jump
jump:
jmp $
;==========DATA (GDT) AREA==========
GDTR:????????????
GDTsize DW GDT_END-GDT-1???
GDTbase DD GDT?????????
GDT:
NULL_SEL EQU $-GDT
DD 0x0?????????
DD 0x0
CODESEL EQU $-GDT
DW 0xFFFF
DW 0x0000
DB 0x10
DB 0x9A
DB 0xCF
DB 0x40
GDT_END: