Linux/WASM
6 months ago
- #Browser
- #Linux
- #WebAssembly
- The console uses Ctrl + C and similar shortcuts, with Shift potentially modifying behavior depending on the platform and browser.
- Copy and paste can be done using Ctrl + Insert and Shift + Insert, respectively, or via the context menu.
- The demo showcases the Linux kernel booting in a browser using WebAssembly (Wasm), with BusyBox providing shell and standard commands.
- This is a proof-of-concept, not a stable or secure system, requiring numerous workarounds.
- Known bugs include system lockups, console freezes after 5 minutes, and issues with longjmp() and vfork().
- Wasm operates similarly to other architectures in Linux but lacks task suspension capabilities, requiring workarounds like dedicating CPUs to tasks.
- Limitations include no task interruptions, no MMU, and a strict Harvard architecture preventing runtime code modification.
- The system is not optimized, with potential improvements like parallel CPU booting and using SharedArrayBuffer for communication.
- Previous attempts at running Linux in the browser involved slow emulation or running Linux as a library, unlike this direct approach.
- Future possibilities include graphics support with WebGL, Dwarf support for debugging, and exploring C++ compatibility.
- Wasm wish list includes MMU for memory protection, thread suspension, ELF format adoption, and better debugging capabilities.
- The Stack Switching and Memory Control proposals could enhance Linux on Wasm, with potential for true hibernation of execution state.
- clone() syscall is recommended over fork/vfork for safer and more capable functionality, especially in Wasm environments.