The header of, for example, an elf file contains a lot more information than just the entry point. What about all the entries for dynamic linking? Load address of the code segment (as opposed to entry point), load address of the data segment, details of the amount of space to reserve for uninitialized variables (and where to reserve it), debug information, etc., etc.Qbyte wrote:Another thing I don't like about existing operating systems is that they mandate a program format, such as an ELF/COFF header in the case of *nix or a PE header in the case of windows. I'm usually a fan of "mechanism, not policy", so I'd prefer programs to have no header at all, but instead simply have the entry point of a program be the base address of the file. The program itself can then make various system calls during initialization in order to achieve what the header would normally do, if desired. This is better because it eliminates the distinction between programs and functions and it also makes programs simpler because most of the time a program won't need to make any system calls and will be content with the default scheme of having the whole program image instantiated as a single WRX segment.
It's not a question of the header "doing stuff" that system calls could do (system calls do that stuff anyway), but the information needed for those system calls to do their job.