Subject: Re: Mode32
To: Allen Briggs <briggs@ninthwonder.com>
From: Michael R. Zucca <mrz5149@acm.org>
List: port-mac68k
Date: 11/13/1999 20:41:44
At 3:41 PM -0500 11/13/99, Allen Briggs wrote:
>I think that switching into 32-bit mode can be done fairly easily.  In
>fact, we may even be able to use the ROM to do it.  Of course, the ROM
>routines themselves may not all be 32-bit clean, but that shouldn't
>matter for us if we don't switch into 32-bit mode until after we make
>what use we need to of the ROMs.
>
>> Do Macs boot by loading a boot/IPL record (apart from the driver) from a
>> Volume or do they boot by using their HFS ROM code to read the system file?
>
>I'm not sure.  According to IM V, they can boot off of boot blocks.  I'm
>not sure that anyone's ever tried.  No version of A/UX that I ever saw
>actually tried that--they also used a MacOS tool.

The machines should boot off the boot blocks.

A booter that works for both floppys and HD's could work as follows:

1. Make a partition on a drive and mark it as HFS. The first sector of that
partition is setup to be bootable.

2. Make a first stage loader that fits into the bootblocks starting after
the bootblock info and continuing no more than two sectors (I think three
sectors is the max the ROMs will load). The first stage loader is simple
and uses a few ROM routines to load in sectors from a list into a specified
starting address. The sector list could be placed as data after the
bootloader code in a start sector + length tuple list. When the first stage
loader is done it jumps to an offset from the address it loaded the code
into.

3. The first stage loader loads in a second stage bootstrap. This is where
things get fancy! We can switch to 32 bit mode, get some hardware info to
pass to NetBSD, put the ethernet controllers and other interrupt sources in
a quiescent state, add a user interface/menu to boot different OSes, etc.
The second stage loader can be more complex and could even be made to read
file systems (we could use libstand) or even do stuff like bootp.

The beauty of such a scheme is that it works on both floppys and HD's and
it can also be done *completely from within UNIX* so long as the UNIX in
question can manipulate Macintosh partitions.

The 1st stage loader can be written in assembly while the second stage
could be written in a assembly and C code compiled for position
independance.

Probably the biggest task is making header files for the ROM routines.
Available routines are publically available.

Once we have a booter like this, and a stripped down kernel, it should be
possible to do something like the Linux Router Project and put all
necessary router software on a locked floppy. Now *THAT* would be a
particularly good use for old Macs. Many schools/businesses have old 040
Macs with ethernet in them. This would be agreat way to revitalize those
old macs for something truly useful!




____________________________________________________________________
 Michael Zucca - mrz5149@acm.org - http://www.mdc.net/~mrz5149/
 "I will choose a path that's clear. I will choose Freewill. "
  --Rush, Freewill
____________________________________________________________________