Developer combines a ZIP archive with a bootable BIOS image

Developer David Oberhollenzer, known as Goliath, created a ZIP archive that can be unpacked normally and also used as a bootable image. According to Tom’s Hardware, the file can be launched using Multiboot-compatible tools and, on a compatible PC, directly from a floppy disk through the BIOS.
The idea works because of how ZIP files are structured. The file directory in such an archive is at the end, while the file data comes before it in sequence. The first file in the archive is ZIPHEAD.COM, which is stored uncompressed, so its contents can also serve as part of a bootable image.
Reported by tomshardware.com.
For Multiboot compatibility, the first 8 KB of the image must contain the 0x1BADB002 signature, flags and a checksum. Tom’s Hardware reports that the required data was placed in the contents of ZIPHEAD, which also contains the bootloader. GRUB, QEMU and other compatible tools use this initial information, then hand control to the bootloader.
To enable booting through a standard BIOS, the developer added another required feature to the archive: the bytes 0x55AA at position 510. The BIOS reads the first 512 bytes of the disk and, if they end with this signature, begins executing the code. In this case, the beginning of the disk is also the ZIP header, so its bytes had to be executable by the processor without breaking the archive’s structure.
According to the publication, the first four bytes of the header correspond to instructions that do not write data to memory, although one of them pushes a value onto the stack. Goliath chose the other metadata fields so that they corresponded to harmless commands or commands needed for startup. In particular, the modification-time bytes are used as instructions to jump further into the data.
The result is still a ZIP archive that can be unpacked, but its contents also meet the requirements for booting through Multiboot and the BIOS. Tom’s Hardware notes that selecting the bytes was more complicated than it might seem: they had to form a valid ZIP header, avoid causing the processor to crash and help configure startup at the same time.