Do I have to compile my kernel normally like
gcc -o kernel.bin kernel.c
I heard, that some people use
gcc -ffreestanding -o kernel.bin kernel.c
Does it make a difference and if yes, which?
gcc
Re: gcc
Actually, output it as a COFF file like this:
gcc -c kernel.c
You should find a file named kernel.o in the directory where kernel.c was. Now like the kernel.o to a binary with LD like this:
ld --oformat binary kernel.o
You should now find a file name a.out in the directory where kernel.c was. Rename a.out to kernel.bin and there you(should) have it!
K.J.
gcc -c kernel.c
You should find a file named kernel.o in the directory where kernel.c was. Now like the kernel.o to a binary with LD like this:
ld --oformat binary kernel.o
You should now find a file name a.out in the directory where kernel.c was. Rename a.out to kernel.bin and there you(should) have it!
K.J.
Re: gcc
Hi, I am new to the board. I am just in the process of learning where to begin to code an Operating System (which will, for sure, take a few months more).
Well, I heard about the -ffreestanding option on gcc meaning something like 'generates code to run without an operating system'. I also have seen that ld should link to 0x1000000 (perhaps there's a 0 more or less ) and now I see here something different. What is correct/wrong and why?
Thanks,
John
Well, I heard about the -ffreestanding option on gcc meaning something like 'generates code to run without an operating system'. I also have seen that ld should link to 0x1000000 (perhaps there's a 0 more or less ) and now I see here something different. What is correct/wrong and why?
Thanks,
John