About lldt
Posted: Thu Oct 12, 2006 12:27 am
Code: Select all
GDT:
....
....
;-----------------------------LDT-------------------------------
GdtLdt:
dw LDTLen
dw LDT
dw 8200
dw 0000
GdtSysTSS:
dw TSS_Len
dw TSS_Sys
.....
SelLDT equ GdtLdt-GDT
....
;-------------------------GDT End---------------------------
;-------------------------LDT-------------------------------
align 32
LDT:
dw TSSCode1_Len
dw TSSCode1
dw 0x9800
dw 0x0040
LDTLen equ $-LDT-1
SelLdtCode equ 0x4
[bits 32]
align 32
PStart:
mov ax,SelData
mov ds,ax
mov ax,SelSysStack
mov ss,ax
mov eax,0x00FF
mov esp,eax
mov ax,SelVideo
mov gs,ax
;---------------------------------------------------------------
mov ax,SelLDT
lldt ax ;Error in here;
jmp SelLdtCode:0
jmp $
It error and stop when running into "lldt ax"
why?