Minimal Linux OS runs in a 6MB PDF document in Chrome — LinuxPDF leverages RISC-V emulator

Source: Tom's Hardware added 07th Feb 2025

  • minimal-linux-os-runs-in-a-6mb-pdf-document-in-chrome-—-linuxpdf-leverages-risc-v-emulator

A version of the Linux operating system can now be run inside a PDF opened by a Chromium-based browser. The brains behind the coding gymnastics involved in this 6MB LinuxPDF project belong to high school student Ading2210. If the name is familiar, it might be because the same person created DoomPDF, which we reported on in January.

Ading2210 explains that Linux runs in the PDF within a modified version of the TinyEMU RISC-V emulator. The developer notes that LinuxPDF “works in a very similar way to my previous DoomPDF project.” Like DoomPDF, this Linux-in-a-doc project also has a bit of a performance problem, as it is claimed to be “over 100x slower” than it should be.

(Image credit: Future)

The TinyEMU RISC-V emulator runs in the PDF thanks to a technique where its code is compiled “using an old version of Emscripten that targets asm.js instead of WebAssembly.” This is embedded and loads in the PDF, subsequently auto-running a minimal Linux kernel targeting that architecture. In this implementation, once you agree to ‘Start Emulator’ in your browser, you will see the LinuxPDF UI load, and a welcome message in the Linux viewport, as you wait for the OS to boot.

Those who dabbled with the DoomPDF release will see some familiarity with LinuxPDF’s low-contrast gray display. LinuxPDF also outputs to the screen via the same line-by-line ASCII output that drove the gaming PDF.

Below the Linux viewport in the PDF is a soft keyboard created by an array of PDF buttons. However, it is likely quicker for everyone with a decent physical keyboard to input commands into the ‘type here for keyboard inputs’ field to the lower right of the keyboard UI area.

On the topic of speed and efficiency, Ading2210 humbly admits that performance might be the largest problem with LinuxPDF. “The Linux kernel takes about 30-60 seconds to boot up within the PDF, which [is] over 100x slower than normal,” notes the developer. With Chrome’s current PDF engine having its Just-in-Time (JIT) compiler disabled, Ading2210 sees no way of speeding up the code, for now.

If you wish to try out the LinuxPDF, it requires a Chromium-based browser to work correctly (we checked, but it didn’t work in Firefox on PC). Others might be satisfied to simply watch Ading2210’s video of LinuxPDF starting, booting, and responding to a handful of commands. As with Ading2210’s previous projects, the source code is all available to read and tinker with on GitHub.

Get Tom’s Hardware’s best news and in-depth reviews, straight to your inbox.

Read the full article at Tom's Hardware

media: Tom's Hardware  

Related posts


Notice: Undefined variable: all_related in /var/www/vhosts/rondea.com/httpdocs/wp-content/themes/rondea-2-0/single-article.php on line 88

Notice: Undefined variable: all_related in /var/www/vhosts/rondea.com/httpdocs/wp-content/themes/rondea-2-0/single-article.php on line 88

Related Products



Notice: Undefined variable: all_related in /var/www/vhosts/rondea.com/httpdocs/wp-content/themes/rondea-2-0/single-article.php on line 91

Warning: Invalid argument supplied for foreach() in /var/www/vhosts/rondea.com/httpdocs/wp-content/themes/rondea-2-0/single-article.php on line 91