29jm / SnowflakeOS

"It is very special"
https://jmnl.xyz
MIT License
316 stars 18 forks source link

Add support for an executable format #28

Open xadaemon opened 3 years ago

xadaemon commented 3 years ago

I'm opening this to look into discussing this and see if:

the main objective with having an executable format is to make adding applications easier, I'd say we go with elf since that's what the tool-chain is putting out.

29jm commented 3 years ago

It'd make a lot of sense! I tried writing an elf (elf it is) parser at some point, but found an easier workaround for what I wanted to do at the time, so I ended up dumping it, barely started. Having an elf loader would fix a few hacks:

and it'd allow for cool things later on (dynamic linking?). Not sure how it would all fit together, proc_run_code (in proc.c) or even earlier proc_exec could make use of it probably. I'll have more time later this week to investigate. Is it something you'd be interested in working on?

xadaemon commented 3 years ago

Yes, I'm interested in doing it, however this one is going to take longer than usual because it's larger and, work has resumed so back to writing saas stuff most of the day it is.

-------- Original Message -------- On 4 Jan 2021, 08:05, Johan Manuel wrote:

It'd make a lot of sense! I tried writing an elf (elf it is) parser at some point, but found an easier workaround for what I wanted to do at the time, so I ended up dumping it, barely started. Having an elf loader would fix a few hacks:

  • the kernel can only load programs whose entry point is at address 0x1000
  • executable files must include the entirety of their data, even .bss sections (see the comment in modules/mod.ld)

and it'd allow for cool things later on (dynamic linking?). Not sure how it would all fit together, proc_run_code (in proc.c) or even earlier proc_exec could make use of it probably. I'll have more time later this week to investigate. Is it something you'd be interested in working on?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

29jm commented 3 years ago

Yeah I get that, similar situation for me basically, this week especially. Anyway that'd be a long awaited feature, and don't hesitate to open a draft pr early!

xadaemon commented 3 years ago

@29jm let's do this assign me and I will prob open the PR pretty early on since I might need a lot more input from you this time around (so we can keep a consistent design).

29jm commented 3 years ago

Alright, let's do this!