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.
I think that you might need to specify the size of _start for you symbol :shrug:
Also, if you are using GRUB, which version is it? Because I see that your multiboot portion of the code is really messed up
Last edited by TheCool1Kevin on Wed Dec 28, 2016 9:01 am, edited 1 time in total.
LiquiDOS, my weird hobbyist OS.
"Strive for progress, not perfection" - Anonymous
Yes, I've read those. And my code isn't much different, just I'm using multiboot 2. And grub-file says that my file is indeed compatible. I'd like to know exactly what went wrong
Oh? I thought GRUB2 had the same multiboot specs (because I use GRUB2 with the BareBones code, and it works fine)
If possible, double check the output binary:
animefreak1233 wrote:But the value in the register eax is 0x9020. In fact, _start never executes. Why?
So GRUB accepts your kernel binary, loads it and starts executing something, but not your kernel? If so, the next two question I would ask are: What does it execute? (Have a look at the eip register.) Did it load your binary correctly? (Have a look at the memory at 1M.)
FLAGS equ 0 ;Change to fit your preference, preferably to 1<<0 | 1<<1
MAGIC equ 0x1BADB002
CHECKSUM equ -(MAGIC + FLAGS)
section .multiboot
align 4
multiboot_start:
DD MAGIC
DD FLAGS
DD CHECKSUM
multiboot_end:
You were missing the FLAGS field, and there were a lot of random fields that I had no idea why you had them in there.
The magic, flags and checksum fields are marked as required according to the: GRUB Multiboot Specs Header Layout. Anyways, after the modification, the bootloader seemed to work without any errors.
LiquiDOS, my weird hobbyist OS.
"Strive for progress, not perfection" - Anonymous
animefreak1233 wrote:Actually GRUB works, but I get the error - "can't find command multiboot".
Maybe you should have mentioned that error message.
If GRUB doesn't have the multiboot module available, then the problem isn't with your kernel, but with your GRUB setup. You could try doing an "insmod multiboot" first. If that works, the "multiboot" command should be available afterwards.
animefreak1233 wrote:That's because I'm using the newer multiboot spec. You can find it on the wiki.
Your multiboot header is the older one. The newer one is much nicer
Oh ok. But GRUB2 should work with the Multiboot 1 specs nevertheless... But if you REALLY really want to stick with the Multiboot 2 specifications, then welp.
Kevin wrote:If GRUB doesn't have the multiboot module available, then the problem isn't with your kernel, but with your GRUB setup. You could try doing an "insmod multiboot" first. If that works, the "multiboot" command should be available afterwards.
I disagree. When I ran the original file, it gave me the same "multiboot header no found" message - and I assure you, my GRUB setup is perfectly fine
I'll look more into it.
LiquiDOS, my weird hobbyist OS.
"Strive for progress, not perfection" - Anonymous