Developing my own OS Executable File Format

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
taradinhu
Posts: 1
Joined: Thu Nov 27, 2008 3:23 am

Developing my own OS Executable File Format

Post by taradinhu »

Hello everyone.

I am developing a small kernel, to learning purposes. I am at a point, which I believe, the development would benefit of some sort of 'my own' executable format, either for loadable modules, in kernel, as for latter on, in hosted-application.
I do wish to do this also for learning purposes.
I have search for a starting point in developing one's own image, however, I only seem to draw blanks... I do not know how to, if it is at all possible, extent current tools ( GCC, Nasm/ld ) formats to support my own.
If not possible, could you please advice on how to "Roll with my own executable"?

Thank you in advance.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Developing my own OS Executable File Format

Post by jal »

taradinhu wrote:If not possible, could you please advice on how to "Roll with my own executable"?
You do not say anything about your needs for this executable, which makes it very hard to say anything about it. Basically, if you want a completely new format, you'll have to either write your own linker, or (slightly easier) make a converter that converts a standard executable (e.g. ELF) to your own format.


JAL
DeletedAccount
Member
Member
Posts: 566
Joined: Tue Jun 20, 2006 9:17 am

Re: Developing my own OS Executable File Format

Post by DeletedAccount »

Hi,
theoretically an excutable file has following records.
  • Header Record
  • Text Record
  • Relocaton Record
  • Data Record
  • UnInitialized Data Record
You may take various design desicions depending upon your situation.


Regards
Shrek
User avatar
i586coder
Member
Member
Posts: 143
Joined: Sat Sep 20, 2008 6:43 am

Re: Developing my own OS Executable File Format

Post by i586coder »

Shrek wrote: theoretically an excutable file has following records.
  • Header Record
  • Text Record
  • Relocaton Record
  • Data Record
  • UnInitialized Data Record
Shrek was right, if you want to make your executable file, first of all
you need to creat your own Header Record to be unique,unlike .EXE or .ELF, or you can crack existing executable like .EXE by changing
.EXE signature "MZ" to any other value :mrgreen:

Cheers,
Ahmad T. Dajani
Distance doesn't make you any smaller,
but it does make you part of a larger picture.
cpumaster
Member
Member
Posts: 58
Joined: Fri Nov 28, 2008 10:00 am

Re: Developing my own OS Executable File Format

Post by cpumaster »

You will have to have librarys for the application to run corectly because with no librays the comands mean nothing. They do nothing and link to nothing. So what kind of executable? examples .bzz .tar .exe .pif .bat. What would the application do? Dose your current kernel support multible procces? Will the app have to be installed or can it run instanly? We would like some ore information before you ask. So any information about your current stable relese would be very helpful. If you want it to work you need librarys and supporting files to controll the comants you give the app. So may we have more infomation on you kernel. :?:
Cpu master owns your cpu.
User avatar
carbonBased
Member
Member
Posts: 382
Joined: Sat Nov 20, 2004 12:00 am
Location: Wellesley, Ontario, Canada
Contact:

Re: Developing my own OS Executable File Format

Post by carbonBased »

taradinhu wrote: I do not know how to, if it is at all possible, extent current tools ( GCC, Nasm/ld ) formats to support my own.
If not possible, could you please advice on how to "Roll with my own executable"?
I started off using the RDOFF2 executable and linker format, mostly because it was easy to write a loader and get up and running fairly quickly. There's an article and code somewhere (unfortunately, I can't find it offhand... I may have it on my other system, though. Let me know, and I'll see if I can provide it) to configure LCC to use NASM as a backend; you could easily re-purpose this to use your own assembler/linker once developed, or keep the nasm backend, and look into adding your new format to the list of supported nasm formats (I believe there's mailing lists off the nasm website that could be helpful here).

If you're not quite sure where to start, though, I'd suggest it might be more beneficial to write your own loader for an existing format. That way you'll gain valuable experience and knowledge as to how linkers and loaders work and, if you then desired, you could put that towards making your own format.

--Jeff
Post Reply