zainka
Full Member level 2
Hi
Beeing an embedded sw writer I have a fundamental question according to how a PC (for DOS /Win) and a compiler for such a platform are cooperating to make a program.
When writing a program for an embedded platform like a microcontroller, the compiler for this platform knows exactly where to place variables and constant for the program i write and I can find the correct address and location by looking into the generated suport files like tha map file or I can even defne these locations my self.
However, this is not the case with DOS programs (for exampel), at compiling time you do not know where in ram your variables and constants are placed and so on. How does the program know at running time where to find its variables?
I/O resources like the PCI bus and printerports and so on has well defined addresses like on embedded systems since this is defined by the prefferences the board manufacturers has to follow. But the rest?
I guess the PC compiler must add something like an init section at the beginning of the pc programm written by me (like the compiler for embedded systems also do, i know that) which talks to the OS running on the PC, but how is the things working in real (bad) life. A bad tutorial will do well for me at this point since, obviously, I know nottingh aboute this topic, and my english is bad too.
Thanks in advance for wathever you bring
Regards
Vidar(Z)
Beeing an embedded sw writer I have a fundamental question according to how a PC (for DOS /Win) and a compiler for such a platform are cooperating to make a program.
When writing a program for an embedded platform like a microcontroller, the compiler for this platform knows exactly where to place variables and constant for the program i write and I can find the correct address and location by looking into the generated suport files like tha map file or I can even defne these locations my self.
However, this is not the case with DOS programs (for exampel), at compiling time you do not know where in ram your variables and constants are placed and so on. How does the program know at running time where to find its variables?
I/O resources like the PCI bus and printerports and so on has well defined addresses like on embedded systems since this is defined by the prefferences the board manufacturers has to follow. But the rest?
I guess the PC compiler must add something like an init section at the beginning of the pc programm written by me (like the compiler for embedded systems also do, i know that) which talks to the OS running on the PC, but how is the things working in real (bad) life. A bad tutorial will do well for me at this point since, obviously, I know nottingh aboute this topic, and my english is bad too.
Thanks in advance for wathever you bring
Regards
Vidar(Z)