I have a small assembly bootloader that I got from this Tutorial. The code for the boot loader can be found here. I want to know if its possible to run c++ from this boot loader. I want to run a simple thing like this:
#include <iostream>
using namespace std;
int main () {
cout << "Hello World!\n";
return 0;
}
But as I can see it brings up 2 issues. First somehow the C++ file has to be included in the compiled bin file. Also #include <iostream>… Is iostream included included in a compiled C++ file or dose it need to be included in some sort of library in the boot loader?
Thanks for any help as this is really puzzling me.
To call a C function from your assembly code, here’s a schematic. Using g++ in place of gcc should allow you to use C++ code. But I wonder how much of ‘C++’ you’d be able to write since you cannot use the library functions, as some of the earlier replies to your question clearly point out. You may end up writing assembly in your C++ code finally!
cboot.c
boot.asm
You compile and link them this way to create the executable prog.