kutkloon7 wrote:I was confusing the compiler runtime library with parts of the language that are defined in header files (not in the compiler).
Things as booleans, for example. They are part of the C-language, but they are specified in - *peeks at kernel.c* - stdbool.h.
It is pretty confusing, as some parts that you always considered to be part of the language (and thus, handled by the compiler) are actually handled by object and header files. For example, looking at .../cross/lib/gcc/i386-elf/4.7.3 (I came across thar while trying to find stdbool.h), I see crtbegin.o and crtend. I have no idea if they are used by gcc. I certainly don't link against them, but maybe gcc does this internally? I think this is the code that calls global constructors and destructors (is this only used in c++, or are the global initializer functions just called constructors?). Weird: in the dissassembly of crtbegin.o I see symbols about destructors, and in crtend.o about constructors, I would expect them the other way around...
Questions, questions, questions. Well, at least I got it all working!
I want to stress again how helpful you guys have been!
If you are used to visual studio, also need to keep in mind there are many things that visual studio is supposed to do with project wizzards, when you create a project in visual studio, it ask many things about the type of project, if it's a dll, a static library, an executable, if it's a console or windows program, if it use MFC or ATL , and there are many things visual studio then assume regarding the runtime to use, and general project setting, for it to fit it all together, but it's not always very well documented on the low level side, and it's also very specific to the windows system, and the platform sdk visual studio use, before vc 2005 it could become really ugly once you wanted to do something without using wizzards, as well to generate project setting, but also some code for class definition, if working with MFC or ATL.
Linux doesn't really have such a system, and gcc is much more structured and can allow for great customization of any part of the process of compilation and of the system dependent application context, with visual studio normally you are supposed to use project wizzards to setup the project, and it will assume a particular configuration from the project type, and there is no project type that really fit what you need to develop an OS, and most likely the runtime will make some problem if you run it outside of windows, so you need to setup the project manually and deal with all the visual studio options on your own, and you more likely want visual studio to assume as little as possible about the environment in which the exe will be run.
But C always came with the C library, and C programers always assumed a program in C can use those functions, and that a C build environment would be able to compile exe that use the C library, even in time of Turbo C in dos there was already the C Library headers, which already implied a whole framework of execution for programs with the stdin/stdout, that is not entierly part of the C language definition but that most application developed in C would use and depend on, and a an operating system who want to run C application must provide an implementation of the C Library, and C compiler must also provide some specific code to implement this application framework for a particular system.
But it's more to be seen as an application context model, that require system specific implementation, that most application made in C use, rather than being part of the language itself, it's just that application made in C always relied on some system specific layer of software , and C building environment/compilers always made in sort to make it as transparent as possible, and this standard set of system specific functions as well as the application model as been defined very early and all compilers/C building tools used this same standard.
Even now visual studio can handle even high level system specific thing in sort that the system specific layer is transparent to the developers, when you use wizzard to setup ATL or MFC class for example to be used as COM components, the wizzard can handle many things, and on the functional level of the IDE for people who work entierly under visual studio, ATL/MFC/DirectX could be also considered as part of the language as it's under the scope of type and components that the building tool know of internally.It can allow to setup application context specific to windows that are very complex very easily using visual studio.