Hey can anybody help me
I have written a small program/kernel in c and want the bootloader to load it.
But when I compile it with gcc it turns into a *.exe file and the bootloader only loads *.com files
So my question is
How do I compile my c program/kernel into a *.com file?
or
How do I make the bootloader load an *.exe file
compiling my c program/kernel
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:compiling my c program/kernel
there's nothing like .COM out of DJGPP (or any other 32 bits linker) as .COM is per se a 16 bits format (or rather lack of format :p )
however, by selecting "binary" as output format (look at your linker's options, but i think -oformat binary should do the trick), you can have a flat binary ready-to-run-if-loaded-at-address-X 32 bit image.
also note that .EXE files usually include some stub code that will either enter pmode using DPMI services or perform windows-specific initializations, thus they must be forgotten at this point ... (though COFF .o may be translated into something loadable)
however, by selecting "binary" as output format (look at your linker's options, but i think -oformat binary should do the trick), you can have a flat binary ready-to-run-if-loaded-at-address-X 32 bit image.
also note that .EXE files usually include some stub code that will either enter pmode using DPMI services or perform windows-specific initializations, thus they must be forgotten at this point ... (though COFF .o may be translated into something loadable)
Re:compiling my c program/kernel
Thanks
I'll try as soon as I get some spare time
I'm all new to osdev, so if this work then I'll have a bootloader theres able to boot a program writting in c
What should I do next then, I know that I have to make a console, and I think, I'm not sure, I know how to do that, but how do I make it load/start up a program on the disk?
I'll write it in c
I'll try as soon as I get some spare time
I'm all new to osdev, so if this work then I'll have a bootloader theres able to boot a program writting in c
What should I do next then, I know that I have to make a console, and I think, I'm not sure, I know how to do that, but how do I make it load/start up a program on the disk?
I'll write it in c
Re:compiling my c program/kernel
.:QuickLinkz:. <-- read this before you post !Zalzer wrote: I'm all new to osdev...
What should I do next then...?
Every good solution is obvious once you've found it.