Hacker News new | ask | show | jobs
by tombl 903 days ago
Rather than the "easy" way of porting an x86 emulator to WASM, I've been trying to natively port the Linux kernel to WASM.

UML[0] and LKL[1] prove that running the kernel in a process is viable. μClinux efforts like NOMMU and binfmt_flat prove that you don't need memory-management nor ELF to run the kernel.

Both my own independent experiments and WALI[2] have shown it's possible to port the Linux syscall interface and userland ecosystem to WASM.

I'm confident it's doable, but there are a number of other challenges to solve along the way (like dynamic linking, the Harvard architecture, etc). Currently I'm blocked on the fact that while the kernel supports running non-ELF binaries, it really wants to be an ELF itself.

[0]: https://en.wikipedia.org/wiki/User-mode_Linux

[1]: https://github.com/lkl/linux

[2]: https://arxiv.org/abs/2312.03858

1 comments

Share your work? ;-) Are you doing something like adding "arch/wasm"? I'm just someone who wondered about how possible it was on a rainy day...