Page 1 of 1

If is kernel bigger than 44 kb, qemu have error

Posted: Tue Jul 23, 2019 10:16 am
by Klakap
Good day!

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

Code: Select all

qemu: fatal: Trying to execute code outside RAM or ROM at 0x000b0000
My bootloader code is in https://github.com/Klaykap/LightningOS/ ... loader.asm

Please where is error?

Re: If is kernel bigger than 44 kb, qemu have error

Posted: Tue Jul 23, 2019 10:19 am
by thomtl
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

Re: If is kernel bigger than 44 kb, qemu have error

Posted: Tue Jul 23, 2019 10:24 am
by Klakap
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?

Re: If is kernel bigger than 44 kb, qemu have error

Posted: Tue Jul 23, 2019 11:01 am
by iansjack
Use Grub.

Re: If is kernel bigger than 44 kb, qemu have error

Posted: Tue Jul 23, 2019 11:12 am
by Klakap
I dont want use GRUB because I want install my os on hard disc and easiest way is use my own bootloader.

Re: If is kernel bigger than 44 kb, qemu have error

Posted: Tue Jul 23, 2019 1:13 pm
by thomtl
Why wouldn't grub work on a harddrive?

Re: If is kernel bigger than 44 kb, qemu have error

Posted: Tue Jul 23, 2019 1:22 pm
by iansjack
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....

Re: If is kernel bigger than 44 kb, qemu have error

Posted: Tue Jul 23, 2019 4:07 pm
by MichaelPetch
Out of curiosity what command line option do you use to launch your bootloader with QEMU? When you say 44kb did you mean 64kb?

Re: If is kernel bigger than 44 kb, qemu have error

Posted: Wed Jul 24, 2019 4:02 am
by AJ
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