gate type 0 unsupported?
Posted: Mon Dec 01, 2003 5:27 pm
yes, i'm a newbie. I'm trying to load a new GDT (with lgdt), but when I try to flush the registers, bochs crashes saying:
my code is as follows:
gdt_init is then called from my main() function in main.c how should i fix this?
thanx
Code: Select all
gate type 0 unsupported
Code: Select all
;.gdt.asm
;------------GDT Table---------------;
GDTR:
GDTsize DW GDT_END-GDT-1
GDTbase DD 0x500
GDT:
NULL_SEL EQU $-GDT ; null descriptor is required (64bit per entry)
DD 0x0
DD 0x0
CODESEL EQU $-GDT ; 4GB Flat Code at 0x0 with max 0xFFFFF limit
DW 0xFFFF ; Limit(2):0xFFFF
DW 0x0 ; Base(3)
DB 0x0 ; Base(2)
DB 0x9A ; Type: present,ring0,code,exec/read/accessed (10011000)
DB 0xCF ; Limit(1):0xF | Flags:4Kb inc,32bit (11001111)
DB 0x0 ; Base(1)
DATASEL EQU $-GDT ; 4GB Flat Data at 0x0 with max 0xFFFFF limit
DW 0xFFFF ; Limit(2):0xFFFF
DW 0x0 ; Base(3)
DB 0x0 ; Base(2)
DB 0x92 ; Type: present,ring0,data/stack,read/write (10010010)
DB 0xCF ; Limit(1):0xF | Flags:4Kb inc,32bit (11001111)
DB 0x0 ; Base(1)
GDT_END:
;----------End GDT Table-------------;
[global gdt_init]
gdt_init:
lgdt [GDTR] ;load GDT
jmp CODESEL:FLUSH ;clear cs/ip/eip
FLUSH:
;refresh all segment registers
mov eax,DATASEL
mov ds,eax
mov es,eax
mov fs,eax
mov gs,eax
mov ss,eax
ret
thanx