I narrowed it down to the far jump into PMode. The code as worked fine on x86/x86_64 cpus (p4, p4d, c2d/q) and has never given me any issues between them, but for some reason the xeons don't like the code at all. I looked through the intel sd manuals and could find no alterations that need to be made for PMode initialization on the xeon cpus. Here is the code for the basic PMode setup. btw, this works fine in bochs, qemu, vpc2007, and virtualbox OSE on my ubuntu 8.04.1 machine (running the dual xeons).
Code: Select all
[ORG 0x7C00]
[bits 16]
start:
xor ax, ax
xor bx, bx
xor cx, cx
xor dx, dx
floppy_reset:
sti
int 0x13
cmp ah, 0
jne floppy_reset
floppy_load_sector:
mov ax, 0x1000
mov es, ax
mov bx, 0x0
mov ah, 02h
mov al, 18
mov ch, 0
mov cl, 01h
mov dh, 0x00
floppy_load_sector_loop:
int 0x13
mov ax, es
add ax, 0x0240
mov es, ax
mov ah, 0x02
mov al, 18
inc dh
cmp dh, 2
jne floppy_load_sector_loop
mov dh, 0
inc ch
cmp ch, 0x3
jne floppy_load_sector_loop
floppy_stop_motor:
mov dx, 0x3F2
mov al, 0x0C
out dx, al
setup_gdt:
cli
lgdt [gdt_desc]
setup_cr0:
mov eax, cr0
or al, 1
mov cr0, eax
; -- gets to here just fine, but fails on the jump -- ;
far_jump:
jmp 0x08:setup_stack
[bits 32]
setup_stack:
xor eax, eax
xor ebx, ebx
xor ecx, ecx
xor edx, edx
mov ax, 0x10
mov ds, ax
mov es, ax
mov fs, ax
mov gs, ax
mov ss, ax
mov esp, 0x90000
; -- never reaches here -- ;
mov word [0xb8000], 0xA053
hlt
gdt_start:
gdt_null_desc:
dd 0
dd 0
gdt_sys_code_desc:
dw 0xffff
dw 0x0
db 0x0
db 0x9a
db 0xcf
db 0x0
gdt_sys_data_desc:
dw 0xffff
dw 0x0
db 0x0
db 0x92
db 0xcf
db 0x0
gdt_end:
gdt_desc:
dw gdt_end - gdt_start - 1
dd gdt_start
times 510 - ($ - $$) db 0
dw 0xAA55