4 stage1/boot.bin: stage1/boot.asm
5 nasm -f bin -o stage1/boot.bin stage1/boot.asm
8 echo -en "\x55\xAA" > magic.bin
10 nothing.img: magic.bin stage1/boot.bin
11 dd if=/dev/zero of=nothing.img bs=2M count=1
12 parted -s nothing.img mklabel msdos
13 parted -s -a optimal nothing.img mkpart primary fat32 1M 100%
14 doas losetup /dev/loop1 nothing.img
15 doas mkfs.fat /dev/loop1p1
16 doas losetup -d /dev/loop1
17 dd if=stage1/boot.bin of=nothing.img bs=1 count=446 conv=notrunc
18 dd if=magic.bin of=nothing.img bs=1 seek=510 count=2 conv=notrunc
21 qemu-system-x86_64 -hda nothing.img
24 rm -f magic.bin stage1/boot.bin nothing.img