Booting AmigaOS 4.1 on QEMU with BBoot

This page is about running AmigaOne or PegasosII versions of AmigaOS 4.1. For other operating systems and more details see the main page.

These versions of AmigaOS does not contain the necessary video card driver so booting the CD directly produces no picture. To fix that the SiliconMotion 502 driver has to be added which also needs the latest kernel. This can be done without modifying the CD in a zip file that can then be booted using BBoot as described on this page.

Prerequisites

  1. AmigaOS 4.1 AmigaOne or PegasosII version. Preferably 4.1 Final Edition (AmigaOneInstallCD-53.54.iso or Pegasos2InstallCD-53.54.iso but older 4.1 versions may also work, tested with 4.1 Update 1 Peg2InstallCD-Upd1.iso). This is commercially available from Hyperion Entertainment or retailers.
  2. A QEMU version that emulates the right machine: at least v8.2.0 for amigaone or for pegasos2 machine at least v8.1.0 but the latest version is recommended. See main page for details..
  3. The AmigaOS4.1FinalEditionUpdate2-53.14.lha update from Hyperion website.
  4. The siliconmotion502.chip driver for AmigaOS Kickstart from OS4Depot.
  5. My BBoot boot loader at least version 0.6 but latest version should work for all.

Step 1: Preparing boot files for BBoot

  1. Copy the whole System/Kickstart directory which contains the kernel and all modules from the install CD to a temporary place where it can be modified. You should end up with a Kickstart directory containing the contents of System/Kickstart on the CD. Beware, there's also a Kickstart directory with just a Kicklayout file in it at the root of the CD but that file has wrong paths so ignore it and only use files and Kicklayout from System/Kickstart directory from the CD.
  2. Replace the kernel in the Kickstart directory from AmigaOS4.1FinalEditionUpdate2-53.14.lha with the one appropriate for the machine: Content/KickstartA1/kernel for amigaone or Content/KickstartPeg2/kernel for pegasos2. (If PCIGraphics.card is older than version 53.9 then update that to a newer version as well with Content/Kickstart/PCIGraphics.card from the update. This is only needed for AmigaOS versions older than final edition as 4.1FE contains new enough version.)
  3. Copy siliconmotion502.chip to the Kickstart directory from siliconmotion502_chip.lha from OS4Depot.
  4. Modify Kickstart/Kicklayout to add the SM502 driver. Add a MODULE line for siliconmotion502.chip right after where other chip drivers are loaded after PCIGraphics.card. (The PCIGraphics.card is already there so no change is needed for that even if it had to be updated to newer version.) The result should look like this:
    MODULE Kickstart/PCIGraphics.card
    MODULE Kickstart/ATIRadeon.chip
    MODULE Kickstart/3dfxVoodoo.chip
    MODULE Kickstart/siliconmotion502.chip
    
    If you see files listed as System/Kickstart/PCIGraphics.card instead of Kickstart/PCIGraphics.card then you are editing the wrong file, go back to step 1. above. Some other chip drivers may also be present depending on your AmigaOS version. No need to change or remove those, just make sure there is a line for the added SM502 driver. Make sure file names match upper/lower case in Kicklayout as they are named on disk. In particular SFSFileSystem is sometimes written as SFSFilesystem which may be a problem as BBoot is case sensitive.
  5. Create a zip file of the whole Kickstart directory. E.g.
    zip -r Kickstart.zip Kickstart
    
    The zip file should also contain the Kickstart directory with files under it not only the files from it.
  6. Get the bboot executable binary from the BBoot release.

Step 2: Booting AmigaOS

  1. Create a hard disk image for the virtual machine: For example:
    qemu-img create -f raw amigahd.img 1G
    
    that creates a 1 gigabyte image file.
  2. Start QEMU with the hard disk image and the installation CD-ROM. The command line for pegasos2:
    qemu-system-ppc -machine pegasos2 -rtc base=localtime \
      -serial stdio -vga none -device sm501 \
      -drive media=disk,format=raw,file=amigahd.img \
      -cdrom InstallCD.iso \
      -kernel bboot -initrd Kickstart.zip
    
    for amigaone when using QEMU v10.0.0 and BBoot v0.8 or newer the same command works as above with -machine amigaone, for older QEMU versions that don't support -kernel with amigaone or when using BBoot v0.7 and less use this command:
    qemu-system-ppc -machine amigaone -rtc base=localtime \
      -serial stdio -vga none -device sm501 \
      -drive media=disk,format=raw,file=amigahd.img \
      -cdrom AmigaOneInstallCD.iso \
      -device loader,cpu-num=0,file=bboot \
      -device loader,addr=0x600000,file=Kickstart.zip
    
    From here installation should be the same as on real machine.

Running the installed system

After instalation the system should boot with same command as above with -cdrom option removed. It is recommended to install the updates at this point. Remember when installing updates or making any changes to SYS:Kickstart the same steps need to be done as above in Step 1 to update the Kickstart.zip so don't forget to add the siliconmotion502.chip driver to Kicklayout, make zip file of Kickstart dir and copy the modified zip from the updated machine before rebooting as the updated system may only boot with the new Kickstart.zip.

Settings and NVRAM

With QEMU less than v10.0.0 on amigaone UDMA mode for IDE devices is not enabled by default and U-Boot environment variables that can force this were not emulated yet so this could be enabled by adding a command to startup-sequence such as:
idetool >NIL: -x a1ide.device 0 69
which enables UDMA for IDE device 0 (first hard disk) for more devices similiar line is needed, e.g. a1ide.device 2 refers to secondary master (usually CDROM drive). One can check current xfer mode with idetool -u a1ide.device 0 and so on for up to device 3. Missing NVRAM emulation can also cause some applications that want to access it to crash such as SysMon or C:NVGetVar so using at least QEMU v10.0.0 for amigaone machine is recommended.

With QEMU v10.0.0 and newer NVRAM is emulated and variables enabling UDMA are added automatically so no extra lines are needed in startup-sequence any more. Settings in NVRAM are not saved between runs and reset to defaults on every reboot but if needed this can be enabled by creating an image with qemu-img create -f raw nvram.bin 4k and then adding -drive if=mtd,format=raw,file=nvram.bin to QEMU command line to keep NVRAM contents in this backing file so settings stored in it will be preserved between sessions. This is not necessary in most cases as the defaults should work so this is documented here for reference but you likely won't need this.

See Pegasos2 install page for alternative method using original firmware ROM and known problems at the end of that page or main page for more information.