Problems jumping to kernel code
Posted: Tue Jul 10, 2007 12:24 pm
I'm writing my own bootloader ( it's for a floppy ).
I've tested it in 16 bits and I was able to load and jump to the code loaded ( and everything work ok )
But now I'm trying to load the code at the 1 MB mark and jump to it
So I enable A20 Line. Load the kernel code with BIOS int 0x13 ( where ES = 0xFFFF and BX = 0x0010 , so 0x100000 ). Set a small temporary GDT ( 3 segments: intel reserved, code and data) and go to protected mode.
Jump to kernel code ( jmp 0x08: 0x100000 ).
When I boot this code in my computer it resets.
So I removed the line that jumps to the kernel code and wrote this:
And it worked! So the error was when the computer jumped to the kernel code. checking the kernel code I see that everything is ok ( The kernel code is the same as above, just try to write a character at the video). So , my question is what this error could be? ( if is the kernel code really being loaded at 0x100000, or another error )
I've tested it in 16 bits and I was able to load and jump to the code loaded ( and everything work ok )
But now I'm trying to load the code at the 1 MB mark and jump to it
So I enable A20 Line. Load the kernel code with BIOS int 0x13 ( where ES = 0xFFFF and BX = 0x0010 , so 0x100000 ). Set a small temporary GDT ( 3 segments: intel reserved, code and data) and go to protected mode.
Jump to kernel code ( jmp 0x08: 0x100000 ).
When I boot this code in my computer it resets.
So I removed the line that jumps to the kernel code and wrote this:
Code: Select all
;test if computer is really in PM
; and if going to PM is not the cause of the computer resets
mov byte [ds:0B8000h], 'P' ; Move the ASCII-code of 'P' into first video memory
mov byte [ds:0B8001h], 1Bh ; Assign a color code