Subject: Re: how to format/partition a SCSI disk for a PowerMac 8500 (OF 1.0.5)
To: Henry B. Hotz <hotz@jpl.nasa.gov>
From: Bob Nestor <rnestor@augustmail.com>
List: port-macppc
Date: 02/28/2000 18:17:43
Henry B. Hotz  (hotz@jpl.nasa.gov) wrote:

[...]

>>True, but none of the mac68k programs knows how to put a bootstrap on the
>>disk since NetBSD/mac68k is always booted via the Booter application.
>>The macppc port does this (I think) when the disk is dedicated to NetBSD.
>> This would have to be updated to place the bootstrap or a bootstrap
>>process in the proper places on the disk if it contained a mix of HFS
>>partitions and NetBSD ones.  Isn't this needed for the macppc port since
>>we don't have something like the Booter application?  I may be wrong, but
>>I thought we'd either need to have ofwboot.* on an small HFS partition on
>>the disk or we'd have some type of bootcode on the disk that would take
>>us right into NetBSD from a hardware reset.
>
>OK, I *think* you've confirmed what I thought.  If we're using mixed-format
>disks then there will be an HFS partition somewhere to put ofwboot.* on.
>No bootstrap is needed because ofwboot.* *is* the bootstrap.
>
>So if you want to boot NetBSD/MacPPC on a mixed-format disk right now you
>do the following:
>1) Partition the disk into both HFS and FFS partitions the same way we do
>it in port-mac68k.

Yes, most 3rd party disk formatters will do this and on the PPC you can 
even use Apple's now form most non-Apple disks.  It certainly works on 
all the IDE disks I have and has yet to fail on any of my non-Apple SCSI 
disks (unless my memory is failing me).

>2) Format the FFS partition(s) with Mkfs or however else you might do it
>under port-mac68k.

Sort of.  Mkfs can't handle IDE disks at all right now, nor can it handle 
SCSI disks on Bus 1.  On my G3 system that's where the SCSI disk hangs.  
I was working on a version of Mkfs that would solve both of these 
problems, but then the light went off and I knew how to do all of this 
with sysinst.  So I dropped my Mkfs work and did the initial version of 
sysinst/mac68k which worked on my system.  Colin Wood did a lot of work 
on it whipping it into something that he and others could use and that's 
what's now in the source tree.  NetBSD 1.4.2 will have an experimental 
Install Kernel with sysinst for the mac68k port thanks to Frederick 
Bruckman, and I think Scott Reynolds is anxious to get it into 1.5 as the 
primary installation mechanism.

>3) Download base and etc tarballs with the Installer, or however else you
>might do it under port-mac68k.

Again, same answer as above.  When Stephen Brown did the last version of 
the Installer for the mac68k port he lifted the low level I/O routines 
from Mkfs which I had modified to fix at least one "large disk" problem.  
(Disks over 1Gig in size were always being corrupted because the I/O 
routines were using 6-byte SCSi Commands rather than 10 or 12-byte 
command formats.)  So, the mac68k Installer will be a problem on either 
IDE or SCSI Bus 1 disks just like Mkfs.

>4) Put ofwboot.{xcf,elf} on an HFS partition on the disk.  Figure out which
>actual partition number that is using Drive Setup or similar utility.

I think so.  This is where my knowledge is kind of fuzzy.  I don't 
understand ofwboot as well as I'd like to yet.

>5) Configure the right boot command into Open Firmware.  (May require a set
>loadbase command in nvram on XCOFF systems.  Definitely requires knowledge
>of the quirks of the boot command on the specific version of OF on the
>machine.)

Again, same answer as above.

>6) Proceed with a "normal" *BSD-based installation.
>
Well, assuming you did what you wanted to in Step #3 above you should 
already have a running system, at least you would on a 68k Mac. ;-)

>If the above is all true then what you (Bob N) mean by needing more tools
>is that we need more work on the sysinst-based tools to make more of the
>above automatic.  True?
>
Yes.  I think the easiest approach here is sysinst using the code that's 
in the mac68k version.  It handles the disk partitioning and the inital 
loading of all the tarballs.  It needs to be build into an Installation 
Kernel, but that is already being done with the current version of 
sysinst/macppc.  All we'd need to do is:

  1) Short term, comment out the writing of the boot code to the disk 
since this will clobber the Apple Disk Partition Map as Bill Studenmund 
has pointed out.

  2) Long term, make the boot write code smart enough to do what's in 
your Step #4 and possibly Step #5 above.

>Related question for the list:  The version of Drive Setup in MacOS 9 is
>reputed to allow formatting of UFS partitions, as well as two flavors of
>Linux partitions.  Can this substitute for Mkfs?
>
No, this probably won't work.  In addition to putting a proper entry into 
the Apple Disk Partition Map, there are some special flags that need to 
be put into the AU/X reserved area.  Most disk formatters nowdays don't 
do this (Drive Setup may not) or they write the wrong flags.  This is one 
of the things that Mkfs does when a partition is converted to or 
formatted for NetBSD.

>
>Since man sysinst doesn't exist, just where is sysinst documented?  I was
>trying to find out how it did something on port-i386 and just gave up and
>found it by looking directly for the feature instead.
>
Hmmmm, good question.  I learned it mainly looking at the code after 
seeing it run during an i386 installation.  Coming from the mac68k port I 
was impressed and anxious to see the day when we could do this on the 
mac68k port (and later the macppc port).

>>>Signed, Confused ;-)
>>
>>Did that help, or am I the confused one?
>
>Yes it helped, but I'm still confused as noted above. :-\

Well as you can see I'm still confused in some areas, but I hope I 
cleared up the questions in the area that I think I understand.  ;-)

-bob