Bootloader not working.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
gabemaiberger
Member
Member
Posts: 40
Joined: Tue Nov 13, 2012 2:54 pm

Bootloader not working.

Post 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.
Attachments
bootload.asm
(1.42 KiB) Downloaded 88 times

Code: Select all

var myCat="marshmallow"
justin
Member
Member
Posts: 43
Joined: Sun Jan 11, 2009 2:09 pm

Re: Bootloader not working.

Post by justin »

I think you might need to include the selector for the kernel code segment:

Code: Select all

jmp 08h:startkernel
Does that work?
gabemaiberger
Member
Member
Posts: 40
Joined: Tue Nov 13, 2012 2:54 pm

Re: Bootloader not working.

Post by gabemaiberger »

No, it keeps restarting in bochs and aborts in qemu.

Code: Select all

var myCat="marshmallow"
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: Bootloader not working.

Post by Kazinsal »

Look at bochsout. Check to see if it shows any errors, like "not a valid cs segment".
justin
Member
Member
Posts: 43
Joined: Sun Jan 11, 2009 2:09 pm

Re: Bootloader not working.

Post by justin »

Hmm, ok I thought of one more thing. You probably want BITS 32 before your protected mode code.
gabemaiberger
Member
Member
Posts: 40
Joined: Tue Nov 13, 2012 2:54 pm

Re: Bootloader not working.

Post by gabemaiberger »

It still restarts. How do I access bochsout?

Code: Select all

var myCat="marshmallow"
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Bootloader not working.

Post 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.
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Bootloader not working.

Post 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?
If you have seen bad English in my words, tell me what's wrong, please.
MilkyGirl
Posts: 10
Joined: Fri Mar 01, 2013 3:10 pm

Re: Bootloader not working.

Post by MilkyGirl »

You didn't add the TIMES directive to the end, nor the BIOS magic number.
gabemaiberger
Member
Member
Posts: 40
Joined: Tue Nov 13, 2012 2:54 pm

Re: Bootloader not working.

Post by gabemaiberger »

It wasn't the bootloader at all. It was the kernel calling an interrupt in protected mode.

Code: Select all

var myCat="marshmallow"
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: Bootloader not working.

Post by Kazinsal »

gabemaiberger wrote:It still restarts. How do I access bochsout?
In bochsrc:

Code: Select all

log: bochsout.txt
Post Reply