Bootloader: Reading sectors to address 0xFE00

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
kraks
Posts: 10
Joined: Fri May 08, 2009 10:56 am

Bootloader: Reading sectors to address 0xFE00

Post 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
sebihepp
Member
Member
Posts: 195
Joined: Tue Aug 26, 2008 11:24 am
GitHub: https://github.com/sebihepp

Re: Bootloader: Reading sectors to address 0xFE00

Post 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
kraks
Posts: 10
Joined: Fri May 08, 2009 10:56 am

Re: Bootloader: Reading sectors to address 0xFE00

Post by kraks »

Gnarg, what a dumb error! Thank you so much! :)
Post Reply