Hiho,
mov eax,dseg-GDT
mov ds,eax
mov es,eax
mov fs,eax
mov gs,eax
es heißt ax!! Außerdem kann dseg-GDT nicht klappen, da nach dem GDT label noch dw+dd kommen... Nimm einfach 16. Wie wärs wenn du mal guckst, ob du richtig in den PMode kommst:
mov esi,0xb8000
mov eax,0xFFFFFFFF
mov [esi],eax
hlt
Wenn nun die ersten Zeichen am Bildschirm weiß werden, klappt schonmal der PMode!
MfG GhostCoder
P.S.:
Hier mal mein Bootloader, der schaltet auch in den PMode, schau dir den Mal an, der klappt...
; Written by the great white GhostCoder
[Bits 16]
[org 0x7C00]
%define COPY_BASE 0x10000
%define KERNEL_BASE 0x100000
Start:
xor ax,ax
mov ds,ax
mov ss,ax
mov sp,0xFFFE
xor bx,bx
mov ax,(COPY_BASE >> 4) & 0xFFFF
mov es,ax
mov cx,10
mov ax,1
.Read:
Call ReadSector
inc ax
push ax
mov ax,es
add ax,0x20
mov es,ax
pop ax
loop .Read
jmp PMode
ReadSector:
push ax
push cx
; Calc chs address for bios call
xor dx,dx
div word [SectorsPerTrack]
inc dl
mov [absoluteSector], dl
xor dx,dx
div word [NumHeads]
mov [absoluteHead],dl
mov [absoluteTrack],al
; Read sector via bios with 5 retries
mov ax,0x0201
mov ch,[absoluteTrack]
mov cl,[absoluteSector]
mov dh,[absoluteHead]
mov dl,0
int 0x13
pop cx
pop ax
ret
absoluteSector db 0x00
absoluteHead db 0x00
absoluteTrack db 0x00
SectorsPerTrack dw 0x0012
NumHeads dw 0x0002
PMode:
xor eax,eax
mov ax,ds
shl eax,4
add ax,Selectors
mov dword [GDT+2],eax
lgdt [GDT]
; Don't allow interrupts anymore
cli
; Enable protected mode
mov eax,cr0
or eax,1
mov cr0,eax
mov ax,16
mov ds,ax
mov ds,ax
mov es,ax
mov fs,ax
mov gs,ax
mov ss,ax
mov sp,0x5000
; Jump to protected mode code
jmp 8:dword flush
flush:
[Bits 32]
; Copy buffer to above the 1mb mark
mov esi,COPY_BASE
mov edi,KERNEL_BASE
mov ecx,0x4000
rep movsb
jmp KERNEL_BASE
GDT:
dw 72
dd 0
Selectors:
dd 0x00000000,0x00000000 ; Dummy
dd 0x0000FFFF,0x00CF9A00 ; 4GB Flat Code, DPL0
dd 0x0000FFFF,0x00CF9200 ; 4GB Flat Data, DPL0
dd 0x0000FFFF,0x00CFBA00 ; 4GB Flat Code, DPL1
dd 0x0000FFFF,0x00CFB200 ; 4GB Flat Data, DPL1
dd 0x0000FFFF,0x00CFDA00 ; 4GB Flat Code, DPL2
dd 0x0000FFFF,0x00CFD200 ; 4GB Flat Data, DPL2
dd 0x0000FFFF,0x00CFFA00 ; 4GB Flat Code, DPL3
dd 0x0000FFFF,0x00CFF200 ; 4GB Flat Data, DPL3
times 510-($-$$) db 0
dw 0xAA55