kernel: add linux compatibility layer
~~It does not quite work yet, although binaries built for ArvernOS run on Linux... "Just" need to make the opposite to happen now.~~
It totally works ~~on x86_64 (because other archs don't have support for loading executing ELFs)~~, although there are hacks everywhere! There are also many limitations, e.g., Linux binaries should be:
- executable and not shared objects (
-fno-pie) - compiled statically and with
muslbecause glibc does weird stuff before calling amain()function...
Other limitations are related to ArvernOS itself:
- no good multi-tasking (so no
fork/clone) - no heap memory for user processes but I managed to fake that
- no dedicated virtual memory for user processes so we can only execute a (user) binary once as long as it does not want to be loaded in memory areas already used by the kernel
- no good
sleepimplementation
Screenshots
(rebased)
It isn't working anymore since the x86_64 "process" code has been removed in the main branch.
I updated this POC to run unmodified binaries in kernel mode.
The same program compiled for Linux on two different (64bit) architectures and running on ArvernOS:
(BusyBox) uname -a: