A high school student, Ading2210, has created a new project called LinuxPDF, which runs a version of the Linux operating system inside a 6MB PDF document that can be opened by a Chromium-based browser. The LinuxPDF project uses a modified version of the TinyEMU RISC-V emulator to achieve this feat.
The LinuxPDF interface resembles the one in Ading2210’s previous project, DoomPDF, with a low-contrast gray display and ASCII output on the screen. Users can input commands using a soft keyboard or type directly into a field at the bottom of the keyboard UI area.
However, performance is an issue, as the Linux kernel takes around 30-60 seconds to boot up within the PDF, which is significantly slower than normal. Ading2210 attributes this to Chrome’s current PDF engine having its Just-in-Time (JIT) compiler disabled, making it difficult to speed up the code.
The source code for LinuxPDF is available on GitHub, and users can try out the project by opening a Chromium-based browser. The project requires some technical know-how, but Ading2210’s previous experience with DoomPDF makes it an interesting example of what can be achieved with creative coding and emulator workarounds.
Source: https://www.tomshardware.com/software/linux/minimal-linux-os-runs-in-a-6mb-pdf-document-in-chrome-linuxpdf-leverages-risc-v-emulator