After Recent Kernel Drama, Rust for Linux Policy Put in Place
The recent Linux kernel drama over Rust code has resulted in the creation of a Rust kernel policy.
Other than being a reliable piece of software, Linux has made some really cool things a reality, be it by powering a coffee maker or running Doom on a terminal. Of course, the tinkerers who dedicate their time and resources to innovate are the real MVPs here.
One such tinkerer, vk6_ (aka ading2210/Allen), a high-school student with an affinity for programming, web development, and cybersecurity, has managed to do something very noteworthy.
They successfully managed to run Linux inside a PDF file on a web browser. π€―
Just a short demo of LinuxPDF booting up and the man command being executed.
Building on an earlier project where they got Doom to run in a PDF file, the developer has now released LinuxPDF, that is powered by a modified version of the TinyEMU RISC-V emulator that has been compiled to asm.js using an older version of Emscripten.
By leveraging the PDF format's JavaScript support, they enabled Linux to run within the document, utilizing the limited but functional JavaScript support available in Chromium-based browsers.
In its current state, users can use the virtual keyboard to interact with LinuxPDF, run commands, or send keystrokes to the virtual machine using the text box. Another thing to note is that this uses the same display code as DoomPDF (linked above).
To quote Allen, they define the inner workings of LinuxPDF like this:
C code can be compiled to run within a PDF using an old version of Emscripten that targets asm.js instead of WebAssembly. With this, I can compile a modified version of the TinyEMU RISC-V emulator to asm.js, which can be run within the PDF. For the input and output, I reused the same display code that I used for DoomPDF.
It works by using a separate text field for each row of pixels in the screen, whose contents are set to various ASCII characters. For inputs, there is a virtual keyboard implemented with a bunch of buttons, and a text box you can type in to send keystrokes to the VM.
For a quick test run, you can visit the official website that hosts the live demo; just keep in mind that it only works on Chromium-based web browsers. If you want to build it from source, then you should visit GitHub.
Additionally, I highly recommend you read the original Reddit thread for some great community commentary on this project.
Suggested Read π
Stay updated with relevant Linux news, discover new open source apps, follow distro releases and read opinions