Bootfähiges Disk Image unter Mac OS X erstellen

Um unter Mac OS X ein bootfähiges Disk Image (z.B. für Qemu) zu erstellen, muss man zunächst mit Hilfe von fink das Programm mkisofs installieren.

Dann legt man sich ein neues Verzeichnis (hier: "iso_fs") an und füllt es mit folgendem Inhalt:

iso_fs/boot
iso_fs/boot/yaboot
iso_fs/boot/yaboot.conf
iso_fs/boot/ofboot.b
iso_fs/boot/kernel.image

Die Datei yaboot ist ein kompiliertes Yaboot und kernel.image ist die Binärdatei des Kernels. Der Inhalt von yaboot.conf sieht wie folgt aus:

# It is important not to have a comma after cd:
device=cd:
default=kernel.image
timeout=100

image=/boot/kernel
label=fiasco
read-only

und der von ofboot.b:

<CHRP-BOOT>
  <COMPATIBLE>MacRISC</COMPATIBLE>
  <DESCRIPTION>FiascPPC boot image</DESCRIPTION>
  <BOOT-SCRIPT>
    " screen" output
    load-base release-load-area
    boot cd:,\boot\yaboot
  </BOOT-SCRIPT>
</CHRP-BOOT>

Mit dem Befehl

mkisofs -hfs -part -map ./maps -no-desktop -hfs-volid "FIASCOPPC_Boot_CD" -hfs-bless iso_fs/boot -r -o fiasco.iso iso_fs

erstellt man ein Disk image mit dem Namen fiasco.iso. Dieses kann jetzt von Qemu mit dem Befehl

qemu-system-ppc -cdrom fiasco.iso -boot d

gestartet werden. Die Datei maps hat folgenden Inhalt:

# EXTN XLate CREATOR TYPE Comment
.b Raw 'UNIX' 'tbxi' "bootstrap"
yaboot Raw 'UNIX' 'boot' "bootstrap"
kernel Raw 'UNIX' 'boot' "kernel"
linux Raw 'UNIX' 'boot' "kernel"
vmlinux Raw 'UNIX' 'boot' "kernel"
.conf Raw 'UNIX' 'conf' "bootstrap"
root.bin Raw 'UNIX' 'root' "root_image"
* Raw 'UNIX' 'UNIX' "unix"