Getting meaty skeleton to run on bare metal
Posted: Mon Jul 22, 2024 3:26 pm
I made my OS based on the "meaty skeleton" example, and it was all working great on qemu, but I tried burning the .iso to a USB the same way I did to install linux (cat my_file.iso > /dev/sdx). I was then met with the error message:
I tried the same with the default meaty skeleton, just cloning the repository, running iso.sh and burning it to a USB, and got the exact same error message, so I don't think I've messed anything up adding to the code.
I've looked online for this sort of error message, and it seems like there's something wrong with the boot.s file that defines the magic number and other information for grub to boot from, but this doesn't explain why it runs in a VM fine.
Thus, I'm guessing it's a hardware issue, especially since I'm using a modern x86_64 laptop, not an old x86 32 bit computer, though most things in osdev seem to be backwards compatible, so I don't think that should be an issue... (?)
This is my first OS so I've never had to mess about getting grub to work before, so I'd appreciate help with finding what's causing the error, especially since it's happening for me even on the meaty skeleton example.
I'm using i686-elf-gcc version 14.1.0, i686-elf-as version 2.42 and grub version 2.06, if that's significant. I don't believe any of those are outdated.
Code: Select all
error: invalid arch-independent ELF magic.
I've looked online for this sort of error message, and it seems like there's something wrong with the boot.s file that defines the magic number and other information for grub to boot from, but this doesn't explain why it runs in a VM fine.
Thus, I'm guessing it's a hardware issue, especially since I'm using a modern x86_64 laptop, not an old x86 32 bit computer, though most things in osdev seem to be backwards compatible, so I don't think that should be an issue... (?)
This is my first OS so I've never had to mess about getting grub to work before, so I'd appreciate help with finding what's causing the error, especially since it's happening for me even on the meaty skeleton example.
I'm using i686-elf-gcc version 14.1.0, i686-elf-as version 2.42 and grub version 2.06, if that's significant. I don't believe any of those are outdated.