Writing C/C++ Compiler to the MBR to execute source code before Booting up the OS
I am trying to write the full OS independent program on C++. I want to load the program just before booting up the OS (i.e. Windows). I tried to replace the MBR with my simple “Hello World” program, but nothing happens and I lost Partition table of Virtual Hard disk. 
I think I should write the C++ compiler to the MBR to directly execute the program or source code.

Q. The Compiler is in EXE format so should require Windows or DOS. Does it can be written on MBR?

Q. The C/C++ program require DOS platform. Does it can be run without any OS?

I am trying to write a Boot loader and some same sort of programs.

Writing C/C++ Compiler to the MBR to execute source code before Booting up the OS
===

I am trying to write the full OS independent program on C++. I want to load the program just before booting up the OS (i.e. Windows). I tried to replace the MBR with my simple “Hello World” program, but nothing happens and I lost Partition table of Virtual Hard disk. 
I think I should write the C++ compiler to the MBR to directly execute the program or source code.

Q. The Compiler is in EXE format so should require Windows or DOS. Does it can be written on MBR?

Q. The C/C++ program require DOS platform. Does it can be run without any OS?

I am trying to write a Boot loader and some same sort of programs.
