I've run into an obstacle, that a very simple code, switching CPU to PM doesn't work in VMWare and on real hardware, but excellent works in Bochs.
Code: Select all
org 0x7C00
xor ax, ax
mov ds, ax
mov es, ax
mov ss, ax
mov sp, 0x7C00
cli
lgdt [GDTR]
mov eax, cr0
or al, 0x1
mov cr0, eax
;This jump causes reboot.
jmp 0x8:pm
use32
pm:
jmp $
GDT_START:
;Empty descriptor
dq 0x0
;CS
dw 0xFFFF ;limit
dw 0x0 ;dw_base
db 0x0 ;db_base2
db 10011010b ;AR (P=1,DPL=0,S=1,TYPE=e/r,A=0)
db 11001111b ;G=1,D=1,L=0,U=0,LIMIT=1111b
db 0x0 ;db_base3
GDT_SIZE = $ - GDT_START - 1
GDTR:
dw GDT_SIZE
dd GDT_START
TIA,
Mikae.