Problem with the Bare-Bones Kernel
Posted: Mon Nov 25, 2013 3:34 am
Hey There. After I solved the problem with my boot_sect I wanted to start with the "Just OS-Dev", meaning no Boot, no Realmode, just pure Kernel.
I used the Bare-Bones-Tut on the Wiki.
I did it several times, the last one only copy the scripts and built and executed them.
All I get (with qemu and grub) that there is no Magic Entry Point for Grub to load myOS.
When I start via qemu and -kernel it just exits with errors.
Here is what I used:
I am on a 64 Bit Machine (Ubuntu 13.04)
Bootstrap via NASM (meaning its 32Bit for me)
GCC
Couldnt use "i586-elf-gcc -c kernel.c -o kernel.o -std=gnu99 -ffreestanding -O2 -Wall -Wextra" (there is no such command)
So I used "gcc -c kernel.c -o kernel.o -std=gnu99 -ffreestanding -O2 -Wall -Wextra" at first.
Linking
For linkink i couldn't use "i586-elf-gcc -T linker.ld -o myos.bin -ffreestanding -O2 -nostdlib boot.o kernel.o -lgcc"
So I used "gcc -T linker.ld -o myos.bin -ffreestanding -O2 -nostdlib boot.o kernel.o -lgcc"
BUT There was an Error, cuz myos.bin in fact IS A 32 BIT thing while I am trying to link with other things lol.
So i added -m32 on both compile and linking.
Made the image like in the description.
Like I said, everything worked fine, til trying to boot
Whats wrong?
The code now is 1:1 from the website
I used the Bare-Bones-Tut on the Wiki.
I did it several times, the last one only copy the scripts and built and executed them.
All I get (with qemu and grub) that there is no Magic Entry Point for Grub to load myOS.
When I start via qemu and -kernel it just exits with errors.
Here is what I used:
I am on a 64 Bit Machine (Ubuntu 13.04)
Bootstrap via NASM (meaning its 32Bit for me)
GCC
Couldnt use "i586-elf-gcc -c kernel.c -o kernel.o -std=gnu99 -ffreestanding -O2 -Wall -Wextra" (there is no such command)
So I used "gcc -c kernel.c -o kernel.o -std=gnu99 -ffreestanding -O2 -Wall -Wextra" at first.
Linking
For linkink i couldn't use "i586-elf-gcc -T linker.ld -o myos.bin -ffreestanding -O2 -nostdlib boot.o kernel.o -lgcc"
So I used "gcc -T linker.ld -o myos.bin -ffreestanding -O2 -nostdlib boot.o kernel.o -lgcc"
BUT There was an Error, cuz myos.bin in fact IS A 32 BIT thing while I am trying to link with other things lol.
So i added -m32 on both compile and linking.
Made the image like in the description.
Like I said, everything worked fine, til trying to boot
Whats wrong?
The code now is 1:1 from the website