Subject: Re: Mode32
To: None <wonko@entropy.tmok.com, port-mac68k@netbsd.org>
From: Eric Damien Berna <eric@thiel.com>
List: port-mac68k
Date: 11/12/1999 09:04:04
>Dave Schmitt drunkenly mumbled...
>>
>>  BTW, if there comes a point when NetBSD is booted natively w/o MacOS, what
>>  will happen to machines that require Mode32?
>
>for this to work, i'm guessing that Mode32 would have to be ported to NetBSD
>for non-32-bit-clean systems.

Although Apple was far sighted enough to know that the century will 
end, they weren't far sighted enough to know that the Mac OS would 
use more that 8 Megs of RAM.  The initial Mac OS used 24 bit memory 
addressing, but stored address in 32 bit words.  The extra byte was 
used for flags indicating what type of memory was at that address, (a 
pointer, a handle, the status of the memory at that handle, etc.). 
Apple told developers not to manipulate those flags directly, but use 
special routines.  Later, if the system went 32 bit, the routines 
would still work, storing the information somewhere else.

Of course Apple didn't follow it's own guidelines, and directly 
manipulated those flags.

Apple embedded a large amount of code into the ROM on older machines 
(they've gotten away from that lately).  Some of the code in ROM 
directly manipulates the extra bye of 24 bit addresses, so it breaks 
in 32 bit mode.  Connetix analyzed the code in the ROMs, patched the 
routines that break in 32 bit mode, and developed code that puts 
those computers into 32 bit mode.  That's what Mode32 does.

NetBSD, since it never used the interesting memory management of the 
MacOS, never had a problem with 32 bit addressing.  Also, it doesn't 
use the code in the ROM, so that code doesn't need to be patched 
under NetBSD.  Under our current booting method, NetBSD uses Mac OS 
to initialize the computer into an environment that NetBSD can use. 
NetBSD want's the computer to be in 32 bit mode, and the only way to 
get many older Macs into 32 bit mode is by using Mode32.

Back to the question at hand, "BTW, if there comes a point when 
NetBSD is booted natively w/o MacOS, what will happen to machines 
that require Mode32?"  All NetBSD really needed from Mode32 was the 
computer in 32 bit mode.  The developers that take on this task will 
only need to figure out that step, a relatively easy task.  They will 
not have to port any of the rest of Mode32.

Eric Damien Berna
eric@thiel.com

NetBSD 1.3.3 on a Mac Quadra 800
NetBSD-current on a Power Mac 8500