Re:Loadin up the GDT whilst in protected mode.
Posted: Wed Jan 08, 2003 1:10 pm
hi
i took curufir advice oand added this statement to my code:
dw gdt_end - gdt - 1
now it links fine without ne errors
so my gdt loadin funcion is:
[BITS 32]
segment .text
[global _loadGDT]
gdtr
dw gdt_end - gdt - 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
; Begin Load GDT
_loadGDT:
;push ebp
;mov ebp, esp
lgdt [gdtr] ; Load GDT
;pop ebp ; Restore Caller's stack frame
ret
; End Load GDT
so is dat all i need to do 2 load the GDT or do i need to do nething else?
so wot do i do next after setting up the gdt?
thnx
i took curufir advice oand added this statement to my code:
dw gdt_end - gdt - 1
now it links fine without ne errors
so my gdt loadin funcion is:
[BITS 32]
segment .text
[global _loadGDT]
gdtr
dw gdt_end - gdt - 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
; Begin Load GDT
_loadGDT:
;push ebp
;mov ebp, esp
lgdt [gdtr] ; Load GDT
;pop ebp ; Restore Caller's stack frame
ret
; End Load GDT
so is dat all i need to do 2 load the GDT or do i need to do nething else?
so wot do i do next after setting up the gdt?
thnx