Protect mode and GDT?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Guest

Protect mode and GDT?

Post by Guest »

Can anyone please tell me how i can go abt building my own GDT and loading it with lgdt.
jrfritz

Re:Protect mode and GDT?

Post 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
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:Protect mode and GDT?

Post by Perica »

..
Last edited by Perica on Fri Dec 01, 2006 8:38 pm, edited 1 time in total.
Whatever5k

Re:Protect mode and GDT?

Post by Whatever5k »

For better understanding, http://abless.inet-sec.org/segment.html might perhaps help you...
Post Reply