Can i write bootloader in C++

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
nepos
Posts: 3
Joined: Thu Mar 16, 2006 12:00 am

Can i write bootloader in C++

Post by nepos »

hi to all,
i want to write bootloader in c++. can i write ?
User avatar
smiddy
Member
Member
Posts: 127
Joined: Sun Oct 24, 2004 11:00 pm
Location: In my cube, like a good leming. ;-)

Re: Can i write bootloader in C++

Post by smiddy »

It would probably be more difficult to write one in C++ than to learn ASM and write a simple one. I say this because I think you would have to make certain you don't use any libraries that rely on a specific OS as an interface, you would have to tell the compiler to compile the code in a flat manner (i.e. from start to finish without reorganizing things), you may have to write your own libraries for BIOS useage. And lastly, you would probably need to use in-line ASM anyhow which comes back to my first assertion, if you're going to use ASM anyhow, why not just write the plain ASM?

Mileage may very though according to who you ask.
-smiddy
Da_Maestro
Member
Member
Posts: 144
Joined: Tue Oct 26, 2004 11:00 pm
Location: Australia

Re: Can i write bootloader in C++

Post by Da_Maestro »

It might be possible if you use a 16-bit compiler like Turbo C V1.

This compiler is pretty much a straight compiler..no optimisation or fancy features and I'm pretty sure the linker supports flat output. If you don't use any header files it might be possible...no promises though
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
Post Reply