Page 2 of 2

Re: Desire to make my own executable format, like ELF, COFF,

Posted: Tue May 07, 2013 12:38 am
by dozniak
bluemoon wrote:or zip multiple ELF together to implement multi-target.
https://icculus.org/fatelf/

Re: Desire to make my own executable format, like ELF, COFF,

Posted: Tue May 07, 2013 2:39 pm
by LieutenantHacker
Yeah, FatELF binaries work fine, but my original plan was to make my own executable format and release binaries, not use or add on to existing ones.

But nonetheless all the responses have been great, so thanks for all of the input.

Re: Desire to make my own executable format, like ELF, COFF,

Posted: Tue May 07, 2013 6:46 pm
by feare56
I would use elf or pe until you have you os near finished to your initial design. You can make it ahead of time but as said you would have to edit someone else's code which will be the hard part. I would make it when you have all you want ported to the os and can run some type of game/graphical program

Re: Desire to make my own executable format, like ELF, COFF,

Posted: Wed May 08, 2013 3:50 pm
by LieutenantHacker
Yeah, I might just come up with some specification as mentioned earlier, but just implement an existing format for now, or modify one, or just go flat for now.

Nonetheless, I still want my own format, but thanks for the heads up again.

Re: Desire to make my own executable format, like ELF, COFF,

Posted: Sat Aug 31, 2013 7:52 am
by h0bby1
i did my own relocatable/dynamically exe format already, the motivation was specially because i worked sometime with different compiler and development environement, and even if pe/elf format can seem simple enougth, there are many way cross compiler compatibility can break, if only because of name mangling, and i don't like the idea to implement broken loader who fail to deal with a particular elf , and as i want to be able to develop module for my os from all plateform, and i didn't want the hassle to implement fully the whole spec of PE and elf, and that otherwise there is always a risk that the pe or elf will use some fancy thing from hell, i prefered to go that way

and also i wanted something that can be run 'in place' without needing memory allocation, and can be easily relocated anywhere even with simple asm code

i could have gone by make an elf or PE post processor to handle name mangling and basic sanity check to make sure the object is conform to what i expect, but then i'd either have to handle both format natively, or to onvert from each other, to be able to develop things from both windows and unix plateform without problem

i opted to make tool to convert so and dll to my own format, it's very simple tool made in plain C that can compile without problem with gcc or windows, and can easily be included into building tool chain without any kind of overhead, i compile everything under visual and just add the conversion in the custom post build step, and i generate the makefile for unix from the visual studio project, so it doesn't change anything for the building tool chain at all, just a little command run after the compilation to generate the file to the image, it also support to make compressed image

the name mangling is unified and so module can link with each other without any kind of specific interaction due to the file format, no matter if they are compiled to a .so under linux or to a dll under windows, and it doesn't change anything to the way i develop everything in general

for now it works pretty well, at first i wondered if that was the best way to go, but it didn't take that much time to make, and i only had to change the design once to handle relative relocation from the elf format, and it can already handle pretty complex module definition

and also i plan to do something similar to com, and to have some higher level component definition and encapsulation in binary module, and i like the idea to have more flexibility to handle this because elf is not supposed to handle anything simiar at all, and COM dlls can be pretty much of a mess as well, i don't see myself porting the whole com layer to my OS, not even sure it would be legal to do so, and i could use this format as a basis to make a more evolved component definition

Re: Desire to make my own executable format, like ELF, COFF,

Posted: Tue Nov 26, 2013 10:29 am
by bubach
I'm thinking of this too, mostly because my OS is such a primitive little experiment, that I have no need for 90% of the header information. I might just write a converter from some existing format - would probably be much easier and also support any toolchain capable of outputting to that format.

Re: Desire to make my own executable format, like ELF, COFF,

Posted: Wed Nov 27, 2013 3:47 pm
by linguofreak
I have from time to time mused about an multifile executable format taking the form of one file for each segment of the executable plus a plaintext file looking something like the following:

Code: Select all

#loadscriptMarkerString
text = /bin/Foo.code $RELOCATION_OPTIONS1
data = /bin/Foo.data $RELOCATION_OPTIONS2
library1 = /lib/Bar.code $RELOCATION_OPTIONS3
#And so forth