Ultimate-Linux: Userspace for Linux in Pure JavaScript
4 months ago
- #JavaScript
- #Linux
- #Syscalls
- A fun project to build a tiny Linux distribution using JavaScript and a bit of C.
- The project includes an 'Ultimate Linux Shell' with commands like ls, cd, cat, mkdir, mount, and exit.
- Discussion on Linux's unique position as a kernel shipped independently from the OS, unlike BSDs.
- Exploration of Linux's stable syscall ABI as its contract with software, contrasting with macOS's approach.
- Insight into how pure Go binaries can target the Linux kernel directly via syscalls, bypassing system libraries.
- Mention of the u-root project and its relevance to static binaries.
- Addressing criticisms about discussions on C, Go, Rust, and the nature of Linux as a kernel.
- Creation of a libc-less micro Linux distribution in JavaScript, with a transpilation step through C.
- Instructions for downloading and setting up QuickJS and musl libc for the project.
- Steps to transpile JavaScript to C, link with system operations, and produce a standalone ELF file.
- Guide to building an initramfs and running the Ultimate Shell in a VM using QEMU.
- Demonstration of the shell's functionality, including mounting proc and inspecting system information.