Subject: Re: Native boot [was Booter 1.8]
To: John D. Smerdon <jds@smerdon.livonia.mi.us>
From: The Great Mr. Kurtz <davagatw@mars.utm.edu>
List: port-mac68k
Date: 12/17/1995 15:25:12
On Sun, 17 Dec 1995, John D. Smerdon wrote:

> Sector zero of any disk is the boot block.  I think if the boot block
> version number is setup correctly, execution will start at offset $8x in
> sector zero and can do anything that we want.  This is before the "Welcome
> To Macintosh" is displayed, and before the Finder or the System files are
> opened.  The boot block is 12 or 16 sectors long.

That's a good possibility.  The only thing is, I think it's important to 
make the disk as MacOS compatible as possible.  I'm not sure if this 
would cause problems or not.  12-16 sectors -- how large is a Macintosh 
sector?  512 bytes like Apple II's?  Without doing the math, I seriously 
doubt that would hold the booter, but it could conceivably hold some 
simple HFS reading code to bootstrap another program.  Another 
possibility is, assuming the boot disk is distributed as a disk image, 
there would be no problem with hard-referencing the starting location of 
the booter program in the bootstrap loader, without even needing any 
HFS-reading code on the disk.  This would allow us to use a modified 
booter that would be the same regardless of whether a user booted into 
the MacOS first.  Simply make the user interface section call the boot 
section with one set of parameters if under MacOS, and another with it.  
If the boot section isn't running under MacOS, it would use kernel-style 
output throughout the boot.  If it's using MacOS, it would use the 
present display code.  The only patches necessary would be to eliminate 
MacOS calls to get the system configuration info and to setup some sort 
of switch(MacOS) statement to call one printf style code to print to a 
window under MacOS or the other printf style code (copied into the booter 
from the kernel) if not under the MacOS.

The advantages to this include not having to completely rewrite the 
booter code for non-MacOS use, as well as being able to use the rest of 
the free disk space for such things as the installer, mkfs, and other 
MacOS-side utilities.

Any thoughts on this?

 /---------------------------------------------------------------------\
|David A. Gatwood             And Richard Cory, one calm summer night,  |
|davagatw@mars              Went home and put a bullet through his head.|
|dgatwood@nyx.cs.du.edu              --Edwin Arlington Robinson         |
|http://mars.utm.edu/~davagatw -or- http://nox.cs.du.edu:8001/~dgatwood |
 \---------------------------------------------------------------------/