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'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:
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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
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.
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:
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++.