Kernel.bin not compiling correctly.

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.
User avatar
carbonBased
Member
Member
Posts: 382
Joined: Sat Nov 20, 2004 12:00 am
Location: Wellesley, Ontario, Canada
Contact:

Re: Kernel.bin not compiling correctly.

Post by carbonBased »

The use of underscore is actually a part of the ABI, not the compiler. ELF states no underscores, COFF uses underscores.

You can force GCC to generate or remove understores with command line options if you need to, with the following (iirc):
-fno-leading-underscore
-fleading-underscore
robert macabre
Member
Member
Posts: 26
Joined: Fri Nov 18, 2005 12:00 am
Location: a perfect view out of the novotel

Re: Kernel.bin not compiling correctly.

Post by robert macabre »

ah, i didn't know that.
User avatar
UnsurpassedBlaze
Posts: 10
Joined: Wed Nov 02, 2005 12:00 am
Location: Somewhere on Earth...

Re: Kernel.bin not compiling correctly.

Post by UnsurpassedBlaze »

Well in my other posts I already stated that it's not the underscores that's the problem, it's the actual compilation.

Now I'm wondering, is there a good linker for the windows os that I can use to compile my kernel?
The code is only as good as the programmer.
User avatar
carbonBased
Member
Member
Posts: 382
Joined: Sat Nov 20, 2004 12:00 am
Location: Wellesley, Ontario, Canada
Contact:

Re: Kernel.bin not compiling correctly.

Post by carbonBased »

You mean its the linking, not the compilation. In all your posts, the errors have been during linking.

Linkers never compile code, they just link.

As per a good linker, why wouldn't you continue to use ld?

This seems like a fairly trivial linking issue... have you ever written a multi-file project before?

Using 'objdump' might give you some insight into what's going wrong.

--Jeff
blackcatcoder
Member
Member
Posts: 132
Joined: Wed Nov 03, 2004 12:00 am
Location: Austria
Contact:

Re: Kernel.bin not compiling correctly.

Post by blackcatcoder »

if you compile with gcc try to use -fnobuiltin

use:

gcc -c -fnobuiltin -o .......

and if it works -fnostdinc i think!
dave
Member
Member
Posts: 42
Joined: Sat Jul 09, 2005 11:00 pm

Re: Kernel.bin not compiling correctly.

Post by dave »

As I originally told him there is subtle problems gcc and ld on windows which can cause some incredible headaches. While yes it is a linking problem the only work arounds I found fixed one problem but created another. I recommend jsut setting up a linux machine ( virtual or real ) to do your work on as it will just save you many headaches if your going to continue using gcc and ld.

dave
User avatar
UnsurpassedBlaze
Posts: 10
Joined: Wed Nov 02, 2005 12:00 am
Location: Somewhere on Earth...

Re: Kernel.bin not compiling correctly.

Post by UnsurpassedBlaze »

I'll try to do what dave said about creating a virtual linux machine. It seems like a good shot and I'll try it out. If things still go wrong I'll post up the new problems, thanks for helping me out ^_^. Anyways, yes it is a linker problem and it always seem to have to do with my main Kernel file.
The code is only as good as the programmer.
la_virtud
Posts: 1
Joined: Fri Jan 06, 2006 12:00 am

Re: Kernel.bin not compiling correctly.

Post by la_virtud »

If you want to write the kernel on Windows, you should use DJGPP. When compiling C++ code for the kernel, you should use "-fnostdlib", "-fno-rtti", "-fno-exceptions", and it should work.
Post Reply