A ZIP Archive That Boots Your PC Is Now a Reality

A new proof of concept demonstrates how a valid ZIP archive can double as a bootable disk image on x86 computers.

A ZIP archive that can boot a computer directly without extraction might sound unusual, but developer David Oberhollenzer, known for creating squashfs-tools-ng, has demonstrated exactly that.

His experimental project turns an ordinary ZIP file into a bootable image while preserving compatibility with standard archive utilities.

The concept builds on self-extracting ZIP archives, which combine executable code and archived files into a single package. However, instead of running an executable within an operating system, Oberhollenzer’s implementation allows the ZIP archive itself to boot on x86 hardware.

What makes the project particularly interesting is that the resulting file remains a valid ZIP archive. It can be opened and extracted using standard tools, and the unzip -t command successfully verifies its contents. The archive even includes its own source code and build scripts.

The trick lies in how the ZIP format organizes its data. Unlike TAR or CPIO, ZIP stores a central directory with file locations near the end of the archive. This structure provides flexibility, although modern ZIP utilities may reject archives containing unexpected data between entries.

To maintain compatibility, Oberhollenzer carefully constructed the ZIP header so its opening bytes also function as valid x86 instructions. The familiar PK signature, followed by the remaining header fields, is interpreted by the processor as machine code. A jump instruction embedded in the ZIP timestamp field transfers execution to the actual bootloader.

The implementation also includes a Multiboot header, identified by the magic value 0x1BADB002, allowing compatible bootloaders such as GRUB to load the archive. It can also be launched directly in QEMU using qemu-system-i386 -kernel boot.zip.

However, the archive does not depend entirely on an external bootloader. Its first 512 bytes form a valid BIOS boot sector, allowing boot from floppy disks or hard drives on compatible x86 systems.

The bootloader handles the necessary initialization, including detecting available memory, enabling the A20 address line, loading the remaining archive into memory, and switching to 32-bit protected mode.

Remarkably, all this initial bootstrapping functionality fits into 817 bytes, including the ZIP and Multiboot headers and the Global Descriptor Table.

Oberhollenzer also tested the archive on actual vintage hardware, successfully booting it on systems equipped with an Intel Pentium MMX, Intel 486 DX2, and AMD 386DX-40 processors.

For now, the project is primarily a technical proof of concept rather than a practical replacement for conventional boot images. Nevertheless, it offers an interesting demonstration of how an established file format can be repurposed to perform an entirely different task.

Those interested in experimenting with the implementation can download the bootable ZIP archive, which includes its source code and build instructions, from Oberhollenzer’s original technical write-up.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Leave a Reply

Your email address will not be published. Required fields are marked *