-
Executable-code relation
I'm interested in the nature of the executables produced by compilers, and I wonder of their makup in DOS, windows and Linux, respectively.
DOS doesn't have alot of an API so it probably doesn't have it's own executable format either - or does it? Are DOS .EXEs X86 machine code?
Windows has the (strange?) portable executable (which still isn't very portable for what I understand - there may be problems between different CPUs even if both computers run Windows)
What about linux's executables?
-
-
DOS dose have it's own EXE format, all valid windows PE format files are also valid DOS exe files that way if you run a windows program from DOS the DOS stub at the start of the file can run and give the message "This program requires windows". The windows PE loader skips the DOS stub and starts execution in the windows code.
In the PE header is a flag saying which CPU aarchitecture the program was intended for so an x86 program will only run in an x86 environment.