Page 1 of 1

Protect mode and GDT?

Posted: Tue Dec 24, 2002 7:52 am
by Guest
Can anyone please tell me how i can go abt building my own GDT and loading it with lgdt.

Re:Protect mode and GDT?

Posted: Tue Dec 24, 2002 12:14 pm
by jrfritz
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

Re:Protect mode and GDT?

Posted: Thu Dec 26, 2002 6:01 am
by Perica
..

Re:Protect mode and GDT?

Posted: Thu Dec 26, 2002 7:22 am
by Whatever5k
For better understanding, http://abless.inet-sec.org/segment.html might perhaps help you...