Page 1 of 1

CPU Rebooting when jmp to selctor

Posted: Sat Nov 10, 2001 12:00 am
Hello!
I've created a boot trap that should put up the
computer in protected mode, but when I makes the
far jump to the selector and its offset the computer
just reboots.
I copied the code from someone else that does
exactly what I want my boot to do and it didn’t
work either. I use a 80486DX2 and a P133 both
these computers resets when the boot executes
the jmp command.

I would be grateful for an answer.

RE:CPU Rebooting when jmp to selctor

Posted: Tue Nov 13, 2001 12:00 am
by Chase
>On 2001-11-10 10:58:38, [email protected] wrote:
>Hello!
>I've created a boot trap that should put up the
>computer in protected mode, but when I makes the
>far jump to the selector and its offset the computer
>just reboots.
>I copied the code from someone else that does
>exactly what I want my boot to do and it didn?t
>work either. I use a 80486DX2 and a P133 both
>these computers resets when the boot executes
>the jmp command.
>
>I would be grateful for an answer.

Really could be any thing. Very possibly your segment
descriptors aren't set correctly. You may also want to
douple check your A20 code. Mine was broken at one point
and it would work on some machines and not others(caused reboots)

-Chase

RE:CPU Rebooting when jmp to selctor

Posted: Sun Nov 18, 2001 12:00 am
by notten
>On 2001-11-10 10:58:38, [email protected] wrote:
>Hello!
>I've created a boot trap that should put up the
>computer in protected mode, but when I makes the
>far jump to the selector and its offset the computer
>just reboots.
>I copied the code from someone else that does
>exactly what I want my boot to do and it didn’t
>work either. I use a 80486DX2 and a P133 both
>these computers resets when the boot executes
>the jmp command.
>
>I would be grateful for an answer.

Ok, you can't just copy code and expect it to
work out, but I will help you. The steps are
as follows:

Create a GDT:

First selector should be a dummy.
I would make the second cover all ram (0 to FFFFF)
and exec + read.
If you do this then make the third the same
except make it write instead of exec + read.

Enable A20 Gate:

Copying the code for this should just work.

Load the GDT:

lgdt instruction should do it. Check the
syntax for your assembler. Most code
noawadays is NASM.

Switch to Pmode:

mov eax, cr0
inc eax
mov cr0, eax

This is usually the same.

Make sure 32 bit code follows here.
If anything just make a hardcoded
32 bit jump to some 32 bit code.


If any of the above is incorrect
feel free to correct me. I'm rusty on
these matters since I started working
on other stuff.