wiiMac Bootloader

repository·main·Indexed 20 days ago

https://github.com/bryankeller/wiimac

A bootloader that enables PowerPC-based Mac OS X operating systems to run natively on Nintendo Wii hardware. It currently provides full support for Mac OS X 10.0 Cheetah via a patched kernel and specific drivers. The project includes detailed guides for partitioning SD cards on macOS, Linux, and WSL, as well as instructions for configuring video modes and boot arguments via config.txt.

Tokens
3K
Snippets
7
Records
15
Agent score
21%

What's inside wiiMac

  1. Set up the BootMii SD Card

    main

    The BootMii SD card is used to load the wiiMac bootloader.

    1. Download the latest release from the wiiMac Releases page.
    2. Copy the entire wiiMac folder (which includes wiiMac.elf and config.txt) to the root of your SD card.
    3. Verify the file structure is as follows:
    /
    ├── bootmii
    │   ├── ppcboot.elf
    │   └── armboot.bin
    └── wiiMac
        ├── wiiMac.elf
        └── config.txt
    1. Edit /wiiMac/config.txt to set the correct video_mode for your Wii region: ntscp, ntsci, pal60, or pal50.
    /
    └── bootmii
        ├── ppcboot.elf
        └── armboot.bin
    └── wiiMac
        ├── wiiMac.elf
        └── config.txt
  2. Partition the Mac OS X System SD Card (WSL Host)

    main

    To use WSL, you must first expose the USB device using usbipd-win on Windows, then perform partitioning inside WSL.

    1. On Windows (Administrator PowerShell):
      • Install usbipd-win: winget install --interactive --exact dorssel.usbipd-win
      • List devices: usbipd list
      • Bind and attach the SD card (replace 7-1 with your BUSID):
        usbipd bind --busid 7-1
        usbipd attach --wsl --busid 7-1
    2. In WSL:
      • Install utilities: sudo apt install parted hfsprogs dosfstools mtools kpartx
      • Identify device: lsblk -f
      • Partition (replace sdX with your device):
        sudo parted /dev/sdX
        mklabel mac
        mkpart primary hfs+ 1MiB -1088MiB
        mkpart primary hfs+ -1088MiB -64MiB
        mkpart primary fat32 -64MiB 100%
        quit
      • Format partitions:
        sudo mkfs.hfsplus -v "Macintosh HD" /dev/sdX2
        sudo mkfs.hfsplus -v "Install" /dev/sdX3
        sudo mkfs.vfat -F 32 -n "Support" /dev/sdX4
    # Example WSL partitioning steps
    # Replace sdX with the correct device for the SD card
    sudo parted /dev/sdX
    # (Inside parted interactive shell)
    mklabel mac
    mkpart primary hfs+ 1MiB -1088MiB
    mkpart primary hfs+ -1088MiB -64MiB
    mkpart primary fat32 -64MiB 100%
    quit
    
    # Then format
    sudo mkfs.hfsplus -v "Macintosh HD" /dev/sdX2
    sudo mkfs.hfsplus -v "Install" /dev/sdX3
    sudo mkfs.vfat -F 32 -n "Support" /dev/sdX4
  3. Prerequisites for wiiMac installation

    main

    To use wiiMac, ensure you meet the following requirements:

    • Hardware: A Wii with an SD card slot (Note: Wii Mini is not supported).
    • Software: A soft-modded Wii with BootMii installed as boot2 or IOS.
    • BootMii SD Card: An MBR-formatted SD card with a FAT32 partition containing the following files:
      • /bootmii/ppcboot.elf
      • /bootmii/armboot.bin
    • Mac OS X System SD Card: A second SD card (at least 4 GB) to hold the Mac OS X system, installer, and support files.
  4. Flash the Mac OS X Installer to the SD Card

    main

    Once the SD card is partitioned, you must copy a Mac OS X installer image to the Install partition.

    macOS Host

    1. Identify partitions: diskutil list
    2. Unmount partitions: diskutil unmount diskXsA (Install partition) and diskutil unmount diskYsB (Installer partition).
    3. Perform block-level copy:
      # Replace diskXsA with SD card Install partition and diskMsY with source installer partition
      sudo dd if=/dev/rdiskYsB of=/dev/rdiskXsA bs=512k status=progress

    Linux Host

    1. Create logical devices for the ISO: sudo kpartx -av /path/to/installer/iso
    2. Identify partitions: lsblk -f
    3. Unmount partitions: sudo umount /dev/sdXA (Install partition) and sudo umount /dev/sdYB (Installer partition).
    4. Perform block-level copy:
      # Replace sdXA with SD card Install partition and sdYB with source installer partition
      sudo dd if=/dev/sdYB of=/dev/sdXA bs=1M status=progress conv=fsync

    WSL Host

    1. Create logical devices: sudo kpartx -av /path/to/installer/iso
    2. Identify partitions: lsblk -f (Note: loopback partitions are under /dev/mapper/)
    3. Perform block-level copy:
      # Replace sdXA with SD card Install partition and loopYpB with source installation
      sudo dd if=/dev/mapper/loopYpB of=/dev/sdXA bs=1M status=progress conv=fsync
  5. Partition the Mac OS X System SD Card (Linux Host)

    main

    On a Linux host, use parted and mkfs tools. Warning: This will erase the SD card.

    1. Identify the device:
      lsblk -f
    2. Partition the card using the mac label:
      # Replace sdX with the correct device for the SD card
      sudo parted /dev/sdX --script \
        mklabel mac \
        mkpart primary hfs+ 1MiB -1088MiB \
        mkpart primary hfs+ -1088MiB -64MiB \
        mkpart primary fat32 -64MiB 100%
    3. Install required HFS+ tools if not present:
      • Debian/Ubuntu: sudo apt install hfsprogs
      • Arch: sudo pacman -S hfsprogs
      • Fedora: sudo dnf install hfsplus-tools
    4. Format the partitions:
      # Replace sdX with the correct device for the SD card
      sudo mkfs.hfsplus -v "Macintosh HD" /dev/sdX2
      sudo mkfs.hfsplus -v "Install" /dev/sdX3
      sudo mkfs.vfat -F 32 -n "Support" /dev/sdX4
    # Replace sdX with the correct device for the SD card
    sudo parted /dev/sdX --script \
      mklabel mac \
      mkpart primary hfs+ 1MiB -1088MiB \
      mkpart primary hfs+ -1088MiB -64MiB \
      mkpart primary fat32 -64MiB 100%
    
    # then
    
    # Replace sdX with the correct device for the SD card
    sudo mkfs.hfsplus -v "Macintosh HD" /dev/sdX2
    sudo mkfs.hfsplus -v "Install" /dev/sdX3
    sudo mkfs.vfat -F 32 -n "Support" /dev/sdX4
  6. Boot and Install Mac OS X on Wii

    main

    1. Running the wiiMac Bootloader

    1. Insert the BootMii SD card and enter the BootMii menu.
    2. Select the SD card icon.
    3. Navigate to the wiiMac folder and open wiiMac.elf.

    2. Booting the Installer

    1. Remove the BootMii SD card.
    2. Insert the Mac OS X System SD card.
    3. Use the Wii Power button to select the Mac OS X installer partition.
    4. Press the Reset button to boot the installer.
    5. Use a USB mouse and keyboard to install Mac OS X to the partition named Macintosh HD.

    3. Booting the Installed System

    1. Remove the Mac OS X System SD card.
    2. Insert the BootMii SD card and load wiiMac.elf via the BootMii menu.
    3. Remove the BootMii SD card.
    4. Insert the Mac OS X System SD card.
    5. Use the Reset button to select the Macintosh HD partition.
    6. Crucial: Use the Eject button to override boot arguments to include Force800x600=1 (required for the initial setup process).
    7. Press the Reset button to boot.
  7. Optimize Mac OS X on Wii

    main

    After the initial setup, perform these steps to improve performance and visual quality:

    1. Resolution: Open System Preferences > Display and reduce the resolution to 640x480.
    2. Dock: Open System Preferences > Dock and reduce the size or enable Dock hiding to save screen real estate.
    3. Swap File: Reduce the swap file size to improve responsiveness. Edit /etc/rc and change the dynamic_pager line:
      • From: dynamic_pager -H 40000000 -L 160000000 -S 80000000 -F ${swapdir}/swapfile
      • To: dynamic_pager -H 40000000 -L 160000000 -S 8000000 -F ${swapdir}/swapfile
      • Reboot for changes to take effect.
    dynamic_pager -H 40000000 -L 160000000 -S 8000000 -F ${swapdir}/swapfile
  8. Prepare the Support Partition

    main

    The FAT32 Support partition requires a patched kernel and drivers to function on the Wii.

    1. Create a folder named wiiMac at the root of the Support partition.
    2. Copy the appropriate mach_kernel and driver .kext files into that folder.
    3. Verify the structure:
    /
    └── wiiMac
        ├── mach_kernel
        ├── IOUSBFamily.kext
        └── NintendoWii*.kext (all other drivers)

    Note for WSL Users: Since the WSL2 kernel often lacks vfat support, use mtools to copy files:

    sudo mmd -i /dev/sdXA ::/wiiMac
    sudo mcopy -s -i /dev/sdXA /mnt/c/path/to/files/* ::/wiiMac
    /
    └── wiiMac
        ├── mach_kernel
        ├── IOUSBFamily.kext
        └── NintendoWii*.kext
  9. Partition the Mac OS X System SD Card (macOS Host)

    main

    On a macOS host, use diskutil to partition the target SD card. Warning: This will erase the SD card.

    1. Identify the device identifier:
      diskutil list
    2. Partition the card using the APM scheme with three partitions: Macintosh HD (HFS+), Install (1GB HFS+), and Support (64MB FAT32).
      # Replace diskX with the correct device for the SD card
      diskutil partitionDisk diskX APM \
        HFS+ "Macintosh HD" R \
        HFS+ "Install" 1G\
        FAT32 "Support" 64M
    # Replace diskX with the correct device for the SD card
    diskutil partitionDisk diskX APM \
      HFS+ "Macintosh HD" R \
      HFS+ "Install" 1G\
      FAT32 "Support" 64M
  10. Use hardware buttons to control wiiMac boot behavior

    main

    While running in the wiiMac bootloader, you can use the following hardware inputs (GPIO) to change boot behavior:

    • Power Button (GPIO_POWER): Cycles through available bootable partitions. If no partition is selected, it increments the selected_boot_partition_index to the next bootable partition found on the SD card.
    • Reset Button (GPIO_RESET): Triggers an immediate attempt to load the kernel from the currently selected partition.
    • Eject Button (GPIO_EJECT): Cycles through the predefined sets of boot arguments (overriding the default command line). There are up to 5 different boot argument sets available.