Subject: Re: Mode32
To: Michael R. Zucca <mrz5149@acm.org>
From: Miles Nordin <carton@Ivy.NET>
List: port-mac68k
Date: 11/14/1999 02:59:39
On Sat, 13 Nov 1999, Michael R. Zucca wrote:

> 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,...

Remember, if you switch to 32-bit mode without using Mode32, ROM routines
are no longer your friend.  Thus, your second-stage bootloader would
almost be an entire NetBSD kernel--it would have to include drivers for
bus ASIC's, a complete SCSI stack, raster console, Direct ADB...so much
stuff that you may as well just declare yourself ``booted'' by that point.

For what my own small opinion is worth, i don't mind booting via MacOS.
Given the path it sounds like Apple has taken, the MacOS is really part of
the firmware.

Firmware things:
 o Need to be done only once when the machine boots, and then never again.
 o Are highly hardware- and machine-model-specific.
 o Are obscure difficult hacks developed by the manufacturer and included
   with their machine to save you the agony of figuring them out.
 o Are typically poorly-documented, because it's assumed (all too
   often, wrongly) that you won't ever need to do them yourself.

There is code in MacOS that fits this description.  And, if you consider
as some have mentioned that, on pre-OF Mac's, Apple doesn't ever release
firmware upgrades but rather patches the ROM with MacOS code, the line
between firmware and MacOS becomes even blurrier.  A Mac that hasn't
booted MacOS yet is, in effect, running an outdated ROM revision.

For another example the microcode that runs on the Power Management CPU in
PowerBooks is linked into MacOS, not the ROM.  When you remove the clock
battery, the power manager loses its code and must be loaded, primed,
bootstrapped--all by the MacOS, not the so-called firmware.

Apple is such a closed shop that MacOS really is part of the firmware on
these old machines.  I've got my fingers crossed that their new PCI boxes
represent a complete reconsideration of this somewhat sloppy and obnoxious
style, but that won't help mac68k.

I'd much rather go through the mess of booting MacOS than have odd
inexplicable problems show up that eventually get traced back to an
unfixed ROM bug caused by not booting MacOS.  And i'd rather what little
developer time mac68k warrants be spent on fixing real bugs than
notBootingMacOS-related problems.

Even if some feel it's worth writing first- and second-stage loaders, i
don't see how it's worth the long-term fiasco.  There has to be something
more attention-worthy, like ELF or sound or slotman or IDE.  We fall into
talking about these things because there's so much to say without actually
writing any code.  I find it really demoralizing, yet here i am talking
about it anyway.  so much for opinions, eh?

-- 
Miles Nordin / v:1-888-857-2723 fax:+1 530 579-8680
555 Bryant Street PMB 182 / Palo Alto, CA 94301-1700 / US