Um..., noob Question...
Um..., noob Question...
So how do you get a C++ program into a .bin file? I've managed to compile it into a .obj format, but now I really don't know what to do. The reason why I ask, is I got a bootloader that loads a .bin file off a floppy, and I wanna write my OS in C++, so how do I turn my OS into something a bootloader can recognize?
Hmm... For this you'll need a linker, such as LD (the GNU linker) which is very good. That will take any number of *.o or *.obj files, as well as libraries (*.a) and turn them into executables. LD is capable of generating flat binary files, which is the *.bin format you're talking about.
Also remember that if you are using flat binary, you will probably (you might not, but probably) need an assembly stub before you can go into C/C++ code. See the wiki page Bare bones for an idea on how to do it. It is targetted for ELF, but it should be fairly easy to turn into into a flat binary kernel.
Hope this helps.
Also remember that if you are using flat binary, you will probably (you might not, but probably) need an assembly stub before you can go into C/C++ code. See the wiki page Bare bones for an idea on how to do it. It is targetted for ELF, but it should be fairly easy to turn into into a flat binary kernel.
Hope this helps.