Key Takeaways
1. Ading2210 created LinuxPDF, allowing users to run Linux within a PDF document.
2. The program builds on his previous success, DoomPDF, which runs the game Doom inside a PDF.
3. LinuxPDF uses TinyEMU, a compact RISC-V emulator, enabling Linux to run in a 15 MB file.
4. Emscripten is used to convert C code into asm.js for compatibility with PDF viewers.
5. Ading2210 overcame limitations of modern PDF viewers regarding Javascript execution, similar to his approach with DoomPDF.
A high school student known as ading2210 has introduced LinuxPDF, a program that allows users to run Linux directly within a PDF document. This follows the success of his previous creation, DoomPDF, which enables users to play the game Doom inside a PDF. Users can try the demo version of LinuxPDF through a Chromium-based web browser at the provided link.
Web Technologies in Action
Web browsers utilize HTML, CSS, and Javascript to build the interactive pages we encounter online today. Some parts of these languages are also available in current PDF viewers to enable code execution.
Emulating Linux in a PDF
TinyEMU is an efficient RISC-V system emulator that can run Linux, and the uncompiled TinyEMU code along with the Linux operating system can be downloaded in a compact 15 MB file. This small size makes it feasible to run within a PDF viewer, particularly when the PDF is opened in a web browser as mentioned earlier.
The Challenge of Compatibility
However, operating systems such as Linux are written in C, a programming language that isn’t natively recognized by web or PDF browsers. To address this, Emscripten, a cross-compiler, was employed to transform C code into a version of Javascript called asm.js, which is compatible with PDF files.
Modern PDF viewers have certain restrictions that limit the execution of Javascript code. Ading2210 addressed these constraints in his prior work, DoomPDF, notably in terms of text input and system display output, and he applied similar solutions in LinuxPDF.
Source:
Link
Leave a Reply