readme
[bootcard] / README.md
1 Bootable wedding card
2 =====================
3
4 About
5 -----
6 This is a bootable wedding card for our friends Michael (Samurai) and Athena.
7 It was meant to be included alongside the regular wedding card as a QR code with
8 the source code. The code starts with a comment with instructions for how to
9 assemble it and write it to a USB stick, which would run the program when booted
10 on a PC. Sortof like an easter egg to go along the regular wedding card. It also
11 works from a floppy disk, for use in retro PCs.
12
13 Hardware requirements:
14
15   - PC with "legacy boot" (BIOS) support.
16   - 386 or higher CPU with an FPU (386+x87, 486 DX, or anything newer).
17   - PC-speaker for sound (otherwise it runs silent).
18
19 The main constraint for this project was that the source code should fit in
20 a QR code, which means it should be no more than about 3kb. This in turn makes
21 it impossible to have a complicated 2-stage boot loader which loads a protected
22 mode C program; it had to be a tiny real mode assembly program which
23 fits entirely inside the boot sector. Furthermore, the requirement to run on
24 modern PCs, bootable from a USB stick, necessitates the presence of a dummy
25 partition table in the boot sector, otherwise some BIOSes will refuse to load
26 it. This leaves 446 bytes available for the whole program.
27
28 Due to all the above, the wedding card program is very simple. It draws a nice
29 backdrop, prints the names of the couple, and plays a few notes of Richard
30 Wagner's Lohengrin bridal chorus on the PC speaker, with some visual feedback
31 for the notes being played.
32
33 Authors: John Tsiombikas <nuclear@mutantstargoat.com> and
34  Eleni Maria Stea <elene.mst@gmail.com>
35
36 This program is in the public domain. Do whatever you like with it.
37
38 Instructions
39 ------------
40
41   1. To build the bootable disk image, assuming you have `nasm` installed, just
42      type `make`. Or build it manually with: `nasm -f bin -o bootcard.img
43      bootcard.asm`.
44
45   2. Write the image to a USB stick or floppy disk:
46      `cat bootcard.img >/dev/whatever`
47
48   3. Insert the USB stick and reboot. If necessary use your BIOS boot menu
49      (usually pops up with F12 or ESC during POST) to select booting from the
50      USB stick, if it doesn't happen automatically. On modern PCs you need
51      "legacy boot" enabled.
52
53   4. Enjoy!