CD to boot both Mac and PC

From Organic Design
Jump to: navigation, search

Preliminary research suggests it may be possible to boot both Mac and x86 hardware from the same CD. It seems that the boot sector for the El Torito boot disk specification used by most PCs is different from the boot sector used by the Mac.

ISO9660 standard

El Torito is a subset of the ISO9660 standard as implemented on most modern PCs. It determines where the computer finds it's master boot record when booting from CD (or other ISO9660 filesystem).

Logical sectors (logical address blocks)

Each 2048 bytes

In unix the raw datablocks can be read by:

dd if=/dev/disk1s0 of=output.file ibs=2048 obs=2048 count=1

Will read one 2048 byte block from the device. Note that you must unmout the filesystem first.

Sectors 0 to 15 are reserved for system use by ISO9660 standard.

The Volume Descriptors shall be recorded in consecutively numbered Logical Sectors starting with the Logical Sector having Logical Sector Number 16. The Logical Sectors in the Data Area shall be available for the assignment of Volume Partitions and the recording of File Sections, File Descriptors, Directory Descriptors and Path Tables.

Space within the Data Area may be assigned to one or more Volume Partitions. Each Volume Partition shall be recorded in an Extent and shall be identified by a Volume Descriptor.

The first place the PC goes to find it's boot record is sector 17, after the volume descriptor (stored in sector 16). This entry points to one or several bootable images (images of floppy disks or of other media).

The Mac boot CDs are different. The volume format is HFS. The search for the boot sector begins at sector 0.

There seem to be a couple of solutions (see article above - Bootable hybrid). It looks like a matter of constructing a logical map of the cd and ensuring both Mac and PC boot information is available. PC seems to ignore HFS filesystems and only boot from ISO, so this is good. Mac only boots from HFS, so it must be directed to a bootable HFS volume from the boot sector partition table.

HFS

HFS and HFS+ are the standard filesystem on the Mac. HFS is the filesystem used on bootable CDs for the mac.

| Map of HFS/ISO9660 filesystem

Unix tools

mkisofs

hfsutils

dd if=/dev/disk1s0 of=output.file ibs=2048 obs=2048 count=1

bvi is a binary editor for unix

Potential benefits

If you can dual boot from a CD then you can dual boot from a DVD, USB or any other device that uses the El Torito standard.