I wanted to know the easiest way of making a SIMPLE bootable c++ program (command line) that I could boot from. I already have the program written, but it uses #include <ofstream> and I don't know if that would work because there's nowhere to save the files to (unless they were already there ex: pass.dat stores the user's password, user.dat stores his username). I'm not trying to make an ultra-secure thing, just a simple c++ program that looks like an operating system from the 80's. Like I said, something simple. If it can only boot from the CD, that's fine by me. All I want here is to boot from my c++ program. Is this possible? It must be. Also, I have done some research, and I came across a thing called a boot loader. If I got a boot loader, how would I make it and how would it work? I have mac OS X 10.6.8 using the Qt SDK as my compiler, but if I absolutely needed Xcode I could get it. I'd like to know if there's a step by step tutorial on booting up from c++ code, because that's all I'm doing.
C++ is defined specifically to allow writing bootloaders or OS kernels, but (perhaps due to low demand) not many compilers even care to support freestanding implementation, which is how this is called in standardese.
IMO: you should look into some basic asm programming - although cpp might be used for free standing systems - your primary task will be to write a bootsector (as the name implies you've got exactly one sector (512 bytes) of free space available to pull the rest of your code). I would go for assembler for this reason to avoid any code not essentially neccessary!
I wrote a small "commandline OS" (not really functional but still...) some day myself (was quite a hazzle and I got some input by friends) which was capable of booting from floppy on an ancient 386...