If is kernel bigger than 44 kb, qemu have error

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
Klakap
Member
Member
Posts: 297
Joined: Sat Mar 10, 2018 10:16 am

If is kernel bigger than 44 kb, qemu have error

Post 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/blob/master/bootloader.asm

Please where is error?
User avatar
thomtl
Member
Member
Posts: 66
Joined: Mon Sep 03, 2018 2:25 am

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

Post 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
Klakap
Member
Member
Posts: 297
Joined: Sat Mar 10, 2018 10:16 am

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

Post 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?
User avatar
iansjack
Member
Member
Posts: 4604
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

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

Post by iansjack »

Use Grub.
Klakap
Member
Member
Posts: 297
Joined: Sat Mar 10, 2018 10:16 am

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

Post by Klakap »

I dont want use GRUB because I want install my os on hard disc and easiest way is use my own bootloader.
User avatar
thomtl
Member
Member
Posts: 66
Joined: Mon Sep 03, 2018 2:25 am

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

Post by thomtl »

Why wouldn't grub work on a harddrive?
User avatar
iansjack
Member
Member
Posts: 4604
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

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

Post 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....
MichaelPetch
Member
Member
Posts: 712
Joined: Fri Aug 26, 2016 1:41 pm
Freenode IRC: mpetch

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

Post 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?
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

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

Post 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
Post Reply