Page 1 of 1
Executable file format
Posted: Fri Mar 12, 2004 12:00 am
by pepito
Hello:
Which could be the simplest already existing 'executable file format'
(a.out, coff, elf, exe, etc) ?
pepito
RE:Executable file format
Posted: Fri Mar 12, 2004 12:00 am
by Neptune
I'm not sure, though from what I have learned of the PE (.exe) format, I can say with certainty that it is *not* one of them! (Since it is based on the COFF format, the two are probably quite similar). I far as I know, the .com file is probably closest thing to straight binary - maybe that would be a good starting point?
RE:Executable file format
Posted: Sat Mar 13, 2004 12:00 am
by Gandalf
hi pepito,
I believe though elf is not simple but still using it will pay off in the future.
rgds
Gandalf
RE:Executable file format
Posted: Sat Mar 13, 2004 12:00 am
by jmpnop
Isn't COM-files raw binary executables??
RE:Executable file format
Posted: Sat Mar 13, 2004 12:00 am
by Khumba
Yes but a header is attached to it when it's loaded.
RE:Executable file format
Posted: Sat Mar 13, 2004 12:00 am
by ASHLEY4
If you want the simplist file format the, COM file is it,they do not come much simpler than eg:
1)find program on disk.
2)allocate all memory.
3)get file size.
4)load file size bytes form file.
5)default CS and SS to load address,IP to 100h and SP to FFFEh.
(This is in dos).
ASHLEY4.
RE:Executable file format
Posted: Sun Mar 14, 2004 12:00 am
by Chris Giese
>Which could be the simplest already existing 'executable file format'
.COM files are a good starting point for a 16-bit OS. But .COM files are
essentially plain binary files, which have their disadvantages:
http://my.execpc.com/~geezer/osd/exec/index.htm#binary
For a 32-bit OS, use the "native" file format produced by whatever linker
you're using: DJGPP COFF for DJGPP, Win32 PE COFF for Windows-based
compilers, and ELF for Linux compilers (usually GCC).
With static linking, code to load DJGPP COFF, Win32 PE COFF, and ELF
executables are all roughly equal in complexity:
http://my.execpc.com/~geezer/osd/exec/i ... m#snippets
djcoff.c - 3.7K, 121 lines of code
elf.c - 4.4K, 134 lines of code
pecoff.c - 5.5K, 178 lines of code
If you later want to support dynamic linking, I would use either ELF
or Win32 PE COFF.
RE:Executable file format
Posted: Mon Mar 15, 2004 12:00 am
by pepito
OK,
I see that the simplest 'executable file format' (.com) is not the best chioce!
I will try COFF or ELF...
Thank you very much for every one!
pepito