Page 1 of 1
Bootloader not working.
Posted: Thu Feb 28, 2013 5:29 pm
by gabemaiberger
My bootsector works fine and dandy but my bootloader keeps restarting my emulator when I try to jump to my kernel at the end of my bootloader. The code is in the file attached.
Re: Bootloader not working.
Posted: Thu Feb 28, 2013 6:57 pm
by justin
I think you might need to include the selector for the kernel code segment:
Does that work?
Re: Bootloader not working.
Posted: Thu Feb 28, 2013 7:20 pm
by gabemaiberger
No, it keeps restarting in bochs and aborts in qemu.
Re: Bootloader not working.
Posted: Thu Feb 28, 2013 8:08 pm
by Kazinsal
Look at bochsout. Check to see if it shows any errors, like "not a valid cs segment".
Re: Bootloader not working.
Posted: Thu Feb 28, 2013 8:21 pm
by justin
Hmm, ok I thought of one more thing. You probably want BITS 32 before your protected mode code.
Re: Bootloader not working.
Posted: Thu Feb 28, 2013 9:02 pm
by gabemaiberger
It still restarts. How do I access bochsout?
Re: Bootloader not working.
Posted: Thu Feb 28, 2013 9:54 pm
by iansjack
How do you know that the fault is when it tries to jump to the kernel code rather than some error in that code? The problem may not be with the bootloader. It can be misleading to make assumptions.
Re: Bootloader not working.
Posted: Fri Mar 01, 2013 12:08 am
by egos
Are you sure that "kernel" code was loaded? I don't.
gabemaiberger, what values registers have at loadkernel? Are you sure that es=0 during reading?
Re: Bootloader not working.
Posted: Fri Mar 01, 2013 3:26 pm
by MilkyGirl
You didn't add the TIMES directive to the end, nor the BIOS magic number.
Re: Bootloader not working.
Posted: Fri Mar 01, 2013 4:09 pm
by gabemaiberger
It wasn't the bootloader at all. It was the kernel calling an interrupt in protected mode.
Re: Bootloader not working.
Posted: Fri Mar 01, 2013 6:54 pm
by Kazinsal
gabemaiberger wrote:It still restarts. How do I access bochsout?
In bochsrc: