3 ms·
I think you're making a wrong assumption about how this OS works, its programs are still loaded from ELF executables, the parser is here: https://github.com/Rud
by DSMan195276 3y ago
I think you're making a wrong assumption about how this OS works, its programs are still loaded from ELF executables, the parser is here: https://github.com/Ruddle/Fomos/blob/91cf732f173a01cdec3df438617c87b6dd8dcf8e/bootloader/kernel/src/app.rs#L70 https://github.com/Ruddle/Fomos/blob/91cf732f173a01cdec3df43...
The "app is a function" distinction is simply about the `Context` struct passed it, otherwise it loads and runs executables as expected (load ELf memory segments in, jump to entrypoint)
Edit: I guess I'd also add that on Linux or other OSs it's possible to construct and run process completely from memory with no on-disk executable file. JIT compilers do effectively this, the produce the executable code completely in memory and run it.
- aleph_minus_one 3y ago> I guess I'd also add that on Linux or other OSs it's possible to construct and run process completely from memory with no on-disk executable file. This is rather likely true. But since writing such code is much harder than, say, writing FizzBuzz, I assume that somewhere in the OS code, a "wrong" abstraction is used which makes this task far too complicated.
- DSMan195276 3y agoWhy do you assume it's complicated? It's not hard, it's actually very straight forward. The hard part is generating the executable code in the first place (if you're not reading it out of an executable file). I'm not really sure what you're looking for or expecting unless you want the OS to compile your code for you (which this OS doesn't do either).