Protect mode and GDT?
Protect mode and GDT?
Can anyone please tell me how i can go abt building my own GDT and loading it with lgdt.
Re:Protect mode and GDT?
Look in the FritzOS boot.asm code:
In your PMode code:
lgdt[gdtr] ; Load GDT
just before your boot sector's times directive:
gdtr
dw gdt_end-1
dd gdt
gdt
nullsel equ $-gdt
gdt0
dd 0
dd 0
codesel equ $-gdt
dw 0ffffh
dw 0
db 0
db 09ah
db 0cfh
db 0h
datasel equ $-gdt
dw 0ffffh
dw 0h
db 0h
db 092h
db 0cfh
db 0
gdt_end
In your PMode code:
lgdt[gdtr] ; Load GDT
just before your boot sector's times directive:
gdtr
dw gdt_end-1
dd gdt
gdt
nullsel equ $-gdt
gdt0
dd 0
dd 0
codesel equ $-gdt
dw 0ffffh
dw 0
db 0
db 09ah
db 0cfh
db 0h
datasel equ $-gdt
dw 0ffffh
dw 0h
db 0h
db 092h
db 0cfh
db 0
gdt_end
Re:Protect mode and GDT?
..
Last edited by Perica on Fri Dec 01, 2006 8:38 pm, edited 1 time in total.
Re:Protect mode and GDT?
For better understanding, http://abless.inet-sec.org/segment.html might perhaps help you...