Page 1 of 1

Bootloader: Reading sectors to address 0xFE00

Posted: Mon May 18, 2009 6:13 am
by kraks
Hi,

I just can't get my bootloader to load to address 0xFE00 with interrupt 0x13, ah=2. It works with any address below and also 0x10000. My tries were:

Code: Select all

es=0x0000, bx=0xFE00
es=0x0FE0, bx=0x0000
es=0x0F00, bx=0x0E00
Bochs tells me in bochsout.txt:

Code: Select all

Booting from 0000:7c00
prefetch: EIP [00010000] > CS.limit [0000ffff]
WARNING: HLT instruction with IF=0!
I really have no clue why this fails, it never returns from the interrupt. Does someone know the problem or could look through the source-code? I cut it down to a minimal example, see here.

Thank you in advance,
kraks

Re: Bootloader: Reading sectors to address 0xFE00

Posted: Mon May 18, 2009 7:30 am
by sebihepp
You didn't initialize the Stack. The Stack grows downwards. Therefore your have to set
the stackpointer (sp) to a value greater than 0. And make sure you don't overwrite anything
like the BIOS.

Sebihepp

Re: Bootloader: Reading sectors to address 0xFE00

Posted: Mon May 18, 2009 7:35 am
by kraks
Gnarg, what a dumb error! Thank you so much! :)