In Bochs, no response, nothing happened..
Here is my very simple source code to enter PM
Code: Select all
; TODO
; 1. Load Kernel at 0x10000
; 2. Enter to the PM
; 3. Jump to Kernel
; 2004-06-15 changed for nasm
[BITS 16]
ORG 0x0000
start:
db 0x66
lgdt [gdt_desc]
mov eax,cr0
or al,1
mov cr0,eax
jmp dword 0x0008:0x1000+next
[BITS 32]
next:
nop
nop
cli
mov ax,10h
mov ds,ax
mov es,ax
mov fs,ax
mov gs,ax
mov ss,ax
mov esp,(2*1024*1024)
sti
mov byte [0x0b8000],'X'
mov byte [0x0b8001],0x1b
hang:
jmp hang
;IMPL ME
;Enter to the Kernel
;call _test
gdt_desc:
dw 0x0004*0x08
dd gdt+0x1000
;gdt_48:;
; dw 0x0004*0x08 ; gdt limit=4 max GDT entries
; dd BIG_GDT+0x7c00 ; gdt base
;------------------------------------------------------------------------------
; NULL DESCRIPTER
;------------------------------------------------------------------------------
ALIGN 4
gdt db 0,0,0,0
db 0,0,0,0
;------------------------------------------------------------------------------
; DESCRIPTER #1
; Index 08h
; Base 0 / Limit FFFFFFFFh
; Code/Readable/Nonconforming
; Level 0
;------------------------------------------------------------------------------
dw 0ffffh ; 0-15 Limit
dw 0h ; 16-31 Base
db 0h ; 0-7 Base
db 10011010b ; 8-15 Type Privilege Present
db 11001111b ; 16-23 Limit Attr Granularity
db 0h ; 24-31 Base
;------------------------------------------------------------------------------
; DESCRIPTER #2
; Index 10h
; Base 0 / Limit FFFFFFFFh
; Data/
; Level 0
;------------------------------------------------------------------------------
dw 0ffffh ; 0-15 Limit
dw 0h ; 16-31 Base
db 0h ; 0-7 Base
db 10010010b ; 8-15 Type Privilege Present
db 11001111b ; 16-23 Limit Attr Granularity
db 0h ; 24-31 Base
gdt_size equ $ - gdt ;in bytes
END
What is expeted is to print 'X' out..
In VMWare It is printed out and then Stack Fault
In Bochs no print out and hang...
What is the problem...?
I think stack is set up well...
umm...