OSDev.org
https://forum.osdev.org/

If is kernel bigger than 44 kb, qemu have error
https://forum.osdev.org/viewtopic.php?f=1&t=33784
Page 1 of 1

Author:  Klakap [ Tue Jul 23, 2019 10:16 am ]
Post subject:  If is kernel bigger than 44 kb, qemu have error

Good day!

If is my kernel bigger than 44 kb, qemu crash and say:

Code:
qemu: fatal: Trying to execute code outside RAM or ROM at 0x000b0000


My bootloader code is in https://github.com/Klaykap/LightningOS/blob/master/bootloader.asm

Please where is error?

Author:  thomtl [ Tue Jul 23, 2019 10:19 am ]
Post subject:  Re: If is kernel bigger than 44 kb, qemu have error

Because you're running into the BIOS MMIO space, you shouldn't allocate your kernel under the 1meg mark and IMHO use grub or something

Author:  Klakap [ Tue Jul 23, 2019 10:24 am ]
Post subject:  Re: If is kernel bigger than 44 kb, qemu have error

ummm... :? I have my kernel on 0x10000. But please how I can load my kernel from my bootloader with bios read function 0x13 on 0x100000?

Author:  iansjack [ Tue Jul 23, 2019 11:01 am ]
Post subject:  Re: If is kernel bigger than 44 kb, qemu have error

Use Grub.

Author:  Klakap [ Tue Jul 23, 2019 11:12 am ]
Post subject:  Re: If is kernel bigger than 44 kb, qemu have error

I dont want use GRUB because I want install my os on hard disc and easiest way is use my own bootloader.

Author:  thomtl [ Tue Jul 23, 2019 1:13 pm ]
Post subject:  Re: If is kernel bigger than 44 kb, qemu have error

Why wouldn't grub work on a harddrive?

Author:  iansjack [ Tue Jul 23, 2019 1:22 pm ]
Post subject:  Re: If is kernel bigger than 44 kb, qemu have error

Klakap wrote:
easiest way is use my own bootloader.

Fair enough - do so.

You could have installed Grub in the time it took to post and answer this question, but if you r own bootloader is easier....

Author:  MichaelPetch [ Tue Jul 23, 2019 4:07 pm ]
Post subject:  Re: If is kernel bigger than 44 kb, qemu have error

Out of curiosity what command line option do you use to launch your bootloader with QEMU? When you say 44kb did you mean 64kb?

Author:  AJ [ Wed Jul 24, 2019 4:02 am ]
Post subject:  Re: If is kernel bigger than 44 kb, qemu have error

Hi,

It seems to me that you think your own loader is easier simply because you don't want to read the GRUB documentation. +1 to iansjack - you could have installed GRUB by now. If you think you can easily code a bootloader that will work on as big a range of configurations as GRUB then good luck to you.

What is the last instruction executed before the error message? I bet your code doesn't just naturally run in to 0xb0000. I expect the most likely thing is that you are using ret where 0xb0000 is on the stack.

One other thing that makes no difference. Your comments say "load to 1000h". If you need that comment, it's worth making it obvious that you mean *segment* 1000h.

Cheers,
Adam

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/