Using gcc
Okay I have a couple of questions for using gcc. I''ve spent hours looking in the docs for help on these but I couldn''t find anything. First of all I''m using the windows version of gcc, just so nobody gives me any unix/linux commands :D. Anyway I want to be able to compile a .c file into a flat binary file, as in the pure compiled code with no .exe headers or stuff, like a .com file. I also read that somewhere that you can tell gcc to use either 16 bit or 32 bit compiling/linking is this true? And if it is how do you do it?
I would like to say that I''m not really a beginning programmer, I''ve been using VC++6.0 for many years but would like to do this in gcc, unless anybody knows how the above things can be done in VC++6.0.....
I''ve never done it before, so I don''t have any advice from personal experience. But, using Google, I came up with this, which seems to be applicable.
So you want to write a binary Os> Or 16 bit?
Also, do you have a current OS written already? (if so, I am very impressed )
Also, do you have a current OS written already? (if so, I am very impressed )
lol. I DON''T have an OS written, why do you think I wanna know how to use gcc? In reality I have zero idea of what I''m doing but it''s just fun to fiddle around
You might run into difficulties with the 2.95 mingw32 package, I was attempting to use that (it''s actually the linker ld which produces the flat binary from the .o files) to do the exact same thing, you should be able to compile your c to a collection of .o and then do:
(e.g. this is taken from OS FAQ)
GCC -c my_kernel.c
LD my_kernel.o -o kernel.bin -oformat binary -Ttext 0x100000
However, with the mingw32 distro, ld crashes when you try this (I''m assuming it is compiled with *only* PE support).
DJGPP the DOS version of gcc is supposed to work, but I could never be bothered to set it up.
You might be lucky and the newer versions of mingw32 (or some other windows version) will work.
(e.g. this is taken from OS FAQ)
GCC -c my_kernel.c
LD my_kernel.o -o kernel.bin -oformat binary -Ttext 0x100000
However, with the mingw32 distro, ld crashes when you try this (I''m assuming it is compiled with *only* PE support).
DJGPP the DOS version of gcc is supposed to work, but I could never be bothered to set it up.
You might be lucky and the newer versions of mingw32 (or some other windows version) will work.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement