Reply inline.
"Mike Gonta" <spamtrap@[EMAIL PROTECTED]
> wrote in message
news:770a0df6-a9d3-46c6-b5d2-76ea248fc4fc@[EMAIL PROTECTED]
> On Apr 26, 10:25 am, "Helge Kruse" wrote:
>
>> I wrote a x86 boot loader a long time ago. One step is to jump form 16
bit to 32 bit segment before entering protected mode.
>> Is there any way to write a clean jump to 32 bit segment?
>
> ;assemble with FASM
> use16
> 66 31 C0 xor eax, eax
> 8E D8 mov ds, ax
> 0F 01 16 18 00 lgdt [gdt]
> 0F 20 C0 mov eax, cr0
> 24 EF and al, 0EFh
> 0F 22 C0 mov cr0, eax
> EA 30 00 08 00 jmp 8:protected_mode
I dont know the syntax 8:Label. Is 8 the selector offset?
In that case I would expect a far jump. This would need 16 bit selector
offset and 32 bit offset, wouldn't it? But I think EA is the
opcode for a near jump.
I will try it when I am at the target device.
> 90 align 8
> gdt:
> 17 00 dw 23 ; Global
> Descriptor Table size - 1
> 18 00 00 00 dd gdt ; pointer to
> table, null selector
> 00 00 dw 0 ; is a good
> location for this
> FF FF 00 00 00 9A CF 00 dw 0FFFFh, 0, 9A00h, 0CFh ; maximum pm code
> selector = #8
> FF FF 00 00 00 92 CF 00 dw 0FFFFh, 0, 9200h, 0CFh ; maximum pm data
> selector = #16
> use32
> protected_mode:
>
Best regards,
Helge


|