The boot project contains the bootloader that is used to boot the system on generic hardware through BIOS. boot is a series of files that collectively act as bootloader for BIOS-based hardware.
Another alternative to the above two bootloaders, is the new XNU loading support in grub2, which works on both platforms (EFI and BIOS based) . For more information, check out this page. RequirementsTo use boot, you need: InstallationThe disk needs to contain a HFS+ volume, and it must not be mounted. launchctl unload /System/Library/LaunchDaemons/com.apple.diskarbitrationd.plist startupfiletool ${RDEVICE}s1 boot sleep 3 dd if=boot1h of=${RDEVICE}s1 bs=512 count=1 sleep 3 dd if=boot0 of=${DEVICE} bs=440 count=1 sync launchctl load /System/Library/LaunchDaemons/com.apple.diskarbitrationd.plist The chameleon boot loader (a fork of boot-132) has a greatly simplified installation procedure, since it does NOT need the disk to be unmounted, and it does NOT need startupfiletool: fdisk -f boot0 -u -y /dev/rdiskX # Install boot0 to the MBR dd if=boot1h of=/dev/rdiskXsY # Install boot1h to the partition's bootsector cp boot /Volumes/XXX # Install boot to the volume's root directory TroubleshootingNon-System DiskProblem: You get the error Boot0: MBR Boot0: Done Non-System Disk Solution: You need to set the partition bootable ("boot flag", "set partition active"), e.g., using fdisk: sh-3.2# fdisk -e /dev/rdisk1 Enter 'help' for information fdisk: 1> f 1 Partition 1 marked active. fdisk:*1> w Device could not be accessed exclusively. A reboot will be needed for changes to take effect. OK? [n] y Writing MBR at offset 0. fdisk: 1> q sh-3.2# Wrong system booted by defaultProblem: On a system with multiple OSes, boot wants to boot the wrong (non-PureDarwin) one by default. This happens when a non-HFS+ partition (e.g., FAT32 or NTFS) has the bootable ("active") flag and comes before the HFS+ partition that contains PureDarwin. Solution: Modify boot so that it uses the first HFS+ partition instead of the first partition with the bootable ("active") flag: In boot-132/i386/lib/libsaio/sys.c, comment the following line: for ( bvr = chain; bvr; bvr = bvr->next ) { if ( bvr->flags & kBVFlagNativeBoot ) bvr1 = bvr; // if ( bvr->flags & kBVFlagPrimary ) bvr2 = bvr; } To be continued... |
The goal of this project is to make Darwin more usable by providing an installation ISO, documentation, and add-on software. You are welcome to join #puredarwin on irc.freenode.net if you would like to join PureDarwin development and to add to this site.