Hello all,
How can i write a c or c++ program without any runtime library at all.My basic requirement is i will write all the functions myself and the compiler should only produce the code that my source code says.I will not use any function from the runtime library and i will not even include any header.If it could be done using command line swicthes then please let me know about it.I prefer C Compiler.
I would like to make a boot loader like program using either C or C++.With a little or no ASM
1.Which compiler the BIOS making people use.Do they code only in ASM ?.I assume they use both. 2.What compiler the Single board microprocessor trainer people use ?. 3.Is the simulator like Virtual PC).Like the one available for microcontrollers,like IARs,etc which has editor,compiler & simulator all built in. 4.Where can i get the latest Standard call info which is supported by all processors.Who is standardizing the code.
Thanks
Pak
You don't mention an architecture.
It is hard to write a C program completely without any CRTL. You can replace - or avoid using - the "normal" CRTL functions, but the compiler oftan makes use of internal helper functions. These are hidden functions that are normally not documented anywhere, and you have to look through the produced assemply code to notice the accesses (or single-step in the debugger).
You obviously can't ask what compilers people use to write a BIOS, since that depends on target platform. With a lot of resources, a C compiler may be possible but writing directly in assembler is often a very good idea. Note that the BIOS most people think about - then one in the PC - now has huge amount of flash available and sometimes even have part of the BIOS stored on a hard drive. All just to be able to display a more-or-less graphical configuration interface for setting a number of parameters.
Most boot loaders for embedded systems are free of - or have very limited - configuration support. Since a boot loader are so hard to update (most systems don't allow it to be updated at all, or have a upload sequence where you loose the unit if you get a power loss when updating the boot loader) it is important to minimize the amount of code (and chances of bugs) in a boot loader.
You mention C++. If C can be used, so can C++. However, that would not be the C++ of a normal PC program. A lot of features of C++ are not very suited for boot loaders or embedded systems, because they are aimed at minimizing number of source lines - not amount of RTL help functions.
What compiler to use for embedded programming? Asked on a Keil forum? Wouldn't it be reasonable that we would say Keil???
There are obviously no standard call info for a microcontroller. It is just raw hardware. It isn't until you select a standard language, that you will get a subset of the standard RTL for that language - a subset, since a microcontroller can't really make us of everything in the full language standard. Different compiler vendors differs a bit in how they adjust the standard to fit the target. The smaller the microcontoller, the more design decisions has to be made and the more the different compiler vendors will diverge from each other.