Page 1 of 1
Bare Bones tutorial, grub2 says "no multiboot header found"
Posted: Sat Jan 25, 2014 3:00 am
by erynofwales
Hi all,
I'm working through the Bare Bones tutorial in C++. I've got all the code written and I'm trying to link it together. Two things are happening that I'm not sure how to fix. First, when I link with GNU ld, I get this:
Code: Select all
% ld -m elf_i386 -T linker.ld -o paisley.bin -nostdlib boot.o kernel.o
ld: warning: section `.bss' type changed to PROGBITS
Second, after I assemble the image and try to boot it (I'm using VMware for this), grub2 says this:
I'm not sure if the first part (the .bss section thing) is related at all, but I've never seen it before and googling doesn't turn up much.
Any thoughts?
Re: Bare Bones tutorial, grub2 says "no multiboot header fou
Posted: Sat Jan 25, 2014 3:07 am
by Combuster
erynofwales wrote:I'm working through the Bare Bones tutorial in C++
ld -m elf_i386
Apparently you're really bad in following a tutorial.
Re: Bare Bones tutorial, grub2 says "no multiboot header fou
Posted: Sat Jan 25, 2014 6:28 am
by handuel
What tutorial are you using? What you're doing looks odd to me, so I wonder how good that tutorial is... If you want a C++ bare bones style of thing I would highly recommend following this tutorial:
http://wiki.osdev.org/C%2B%2B_Bare_Bones on the wiki. That sets up the multiboot header properly, and should solve your problem.
Re: Bare Bones tutorial, grub2 says "no multiboot header fou
Posted: Sat Jan 25, 2014 8:24 am
by Bender
Erm, according to the tutorial you need i586-gcc/i586-g++, not sure if this could help.
Barebones C++ wrote:
With these components you can now actually build the final kernel. We use the compiler as the linker as it allows it greater control over the link process. Note that if your kernel is written in C++, you should use the C++ compiler instead. You can then link your kernel using:
Code: Select all
i586-elf-gcc -T linker.ld -o myos.bin -ffreestanding -O2 -nostdlib boot.o kernel.o -lgcc
U sure man?, you're following Barebones C++?
Cheers,
Sid
Re: Bare Bones tutorial, grub2 says "no multiboot header fou
Posted: Sat Jan 25, 2014 10:33 am
by sortie
As the others are trying to hint, you need a cross-compiler to carry out the Bares Bones tutorial.
@handuel: There is no special C++ Bare Bones tutorial, I collapsed them into a single tutorial to avoid a multiple maintenance problem. The regular Bare Bones tutorial has instructions for both C and C++.