Ich benutze folgenden Code, um in den PM zu kommen. Wenn ich ihn starte, stürzt VMWare ab, Bochs und mein PC starten neu. Codesegment und Datensegment im Real Mode sind 2000h
load_pm:
xor eax,eax
mov ax,cs
shl eax,4
add ax,eos_null_desc
mov dword [BaseAddr],eax
bits 32
lgdt [eos_gdt_desc+20000h]
mov eax,cr0
or eax,1
mov cr0,eax
mov word ax, [eos_code_selector]
mov cs, ax
mov word ax, [eos_data_selector]
mov ds, ax
mov word [kernlin],kernel_pm
DB 0EAh
DW 0000000000010000b
kernlin DW 0
;Data
eos_data_selector:
dw 0000000000001000b
eos_code_selector:
dw 0000000000010000b
eos_gdt_desc:
Limit dw 3*8
BaseAddr dd 0
eos_gdt:
eos_null_desc:
dw 0
dw 0
dw 0
dw 0
eos_firstmb_data_desc:
dw 100h ;Segment Limiter 0-15
dw 2000h ;Segmentbasisadresse 0-15
db 0 ;Segmentbasisadresse 16-23
db 10010010b ;Data Segement (Writeable), Ring-0, no expand-down, present
db 11000000b ;4KB Granularity, 386, 0,0 , Segment Limiter 16-19
db 0 ;Segmentbasisadresse 24-31
eos_firstmb_code_desc:
dw 100h ;Segment Limiter 0-15
dw 2000h ;Segmentbasisadresse 0-15
db 0 ;Segmentbasisadresse 16-23
db 10011010b ;Code Segement (Readable), Ring-0, no expand-down, present
db 11000000b ;4KB Granularity, 386, 0,0 , Segment Limiter 16-19
db 0 ;Segmentbasisadresse 24-31
kernel_pm:
bits 32
;Hier fängt der 32-Bit Kernel an!
mov word [ds:0B8000h],"P "
test_hang:
jmp test_hang