Port-mac68k archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: native booting

June 30, 2014 at 9:34 AM
I've always wanted to be able to install and boot NetBSD on my 68K
Macs without needing Mac OS.
Here's some of my notes on the process of booting from SCSI for mac68k:

pram stores the partition number, device ID (scsi id or nubus slot), and OS type to boot.

On boot, SCSIManager iterates over scsi ID's looking for the device to boot.  If found, it tries to load block0 (512bytes) from the scsi device.
block size is determined from block0
It then iterates over the device driver list in block0, matching the DDType field against the OS type from PRAM.  If a match is not found, it bails and is not a bootable device.

If the OStype/DDtype is not macos (type1), the driver is called, and not expected to return (although should be fine if it does...)

If the OStype/DDtype is macos, block1 is inspected to determine partition map.

The partition map is then iterated looking for an Apple_Driver partition that matches the driver information loaded from block0.  If everything matches and a checksum verifies, and the partition we're booting is an HFS partition, the driver is called.

At this point, there should be an entry in the drive queue for the HFS partitions, and the partition we're booting from, and the boot blocks are loaded from the partition.  From here on, booting is the same regardless of the medium being booted from, whether it's a floppy, scsi disk partition, Nubus card, ROM disk, etc.  The boot procedure from this point on is the same as: https://mac68k.info/wiki/display/mac68k/System+6+Boot+Process and https://mac68k.info/wiki/display/mac68k/System+7+Boot+Process

Note that although boot block information is contained within the partition information, it's not actually used for booting on any 68k mac ROM I'm aware of.

So, it seems like initial testing from a floppy is a good idea, since you can focus on the actual bootloading part without the added complexity of the SCSI process.
Once that is working, it seems like there's a couple different approaches that can be taken to booting from SCSI:
- Use a device driver type, and boot directly from the device driver.  This would mean a separate utility to update the disk's block0 with the netbsd bootloader/device driver, and set the proper bits in PRAM, since Startup Disk won't know anything about this new OS type, and the device driver won't be invoked unless the PRAM matches its type.  This seems like a relatively clean way to do it, but has a downside of being unbootable if PRAM isn't set (such as a dead pram battery).  In that case it'd continue looking for a bootable HFS partition.
- Use an HFS partition, but with boot blocks setup to load a netbsd bootloader.  This will be a valid hfs partition to MacOS in the case of a multiboot scenario, so should contain an actual, even if minimal, filesystem.  If not, and you ever boot macos, you'll get the dialog to initialize it.  It could even be setup in such a way that Startup Disk thinks it is a valid MacOS, and could be used to bless it appropriately.

Once valid boot blocks for netbsd are available, true diskless netbooting from the stock ROM (on machines that support it) becomes almost feasible: https://mac68k.info/forums/thread.jspa?threadID=76&tstart=0


Home | Main Index | Thread Index | Old Index