Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

x86 ASM --> entering protected mode.

Name: Anonymous 2008-09-20 22:32

Dear /prog/

Why does this fail?

BITS 16
        cli

        lgdt [cs:pGDT32]

        mov eax, 11h
        mov cr0, eax

        jmp far SEL_CODE:pm_start
SEL_NULL equ 0
SEL_DATA equ 1 << 3
SEL_CODE equ 2 << 3
SEL_LONG equ 3 << 3

pGDT32:
        dw 4*8-1
        dd GDT32
align 4
GDT32: 
        dq 0
        dw 0FFFFh, 0, 9200h, 08Fh
        dw 0FFFFh, 0, 9A00h, 0CFh
        dw 0FFFFh, 0, 9A00h, 0AFh
msg.woohoo:
        db "Win, baybe!", 0
BITS 32
pm_start:
        mov si, msg.woohoo
        call puts

Name: Anonymous 2008-09-21 2:16

>>1
Do you know where things are blowing up? That would be helpful.

1. You are not updating ds and ss after jumping into protected mode.
2. I presume your 'puts' takes a string pointer in 'esi'. Why are you using only half of the register and not the full 32 bits?

>>5
qemu is dicks for debugging these sorts of problems

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List