[comp.sys.mac.programmer] System Startup

brad@gobi.jpl.nasa.gov (Brad Pickering) (04/10/91)

IM Vol V, in the Start Manager chapter, describes the information on a volume
used during system startup, but there seems to be alot of information missing
here.  I am most interested in what is needed to create a disk that will
execute some code from these boot blocks.

My questions are:
What is the 'system startup information ID'?  I have seen $4c4e (or something
like that) for regular startup disks but I was wondering if there were other
values that meant other things.

What is the format of the 'entry point of boot code'?  Is this some sort of
absolute address in memory, or on disk? Or is this address relative to some
disk address?


Any information would be appreciated.  An example would be most appreciated?

I tried something like:
$0  $4c4c
$2  $0000008a  /* address relative to start of disk of boot code */
$6  $0044
$8  $0000
$A  ''
$1A ''
$2A ''
$3a ''
$4a ''
$5a ''
$6a ''
$7a $0000
$7c $0000
$7e $00000000
$82 $00000000
$86 $00000000
$8a @1 bra.s @1

I thought this should send the machine into a loop but it just spit the disk
out and rebooted or crashed.

thank,
Brad Pickering
--
--
Brad Pickering
brad@gobi.jpl.nasa.gov
--

n138ct@tamuts.tamu.edu (Brent Burton) (04/10/91)

In article <BRAD.91Apr9152103@gobi.jpl.nasa.gov> brad@gobi.jpl.nasa.gov (Brad Pickering) writes:
>IM Vol V, in the Start Manager chapter, describes the information on a volume
>used during system startup, but there seems to be alot of information missing
>here.  I am most interested in what is needed to create a disk that will
>execute some code from these boot blocks.
>

I too, am interested in finding information about this boot process.  IM is
very vague about it - it just mentions that the machine boots.  Specifically,
I'm intereseted in the boot process of the Mac Plus if it differs from
other macs.

<<opinion on>>
I think the reason there isn't much info about the boot process is so
Apple can further protect its babies (MacOS and AUX) by not allowing alter-
nate OS's to run on the machine.  If the boot information is not released,
or at least all of the info, no other (possibly better) operating system
can run on a macintosh.
  This is just my opinion, but if it is at all true, it's a shame!  My mac
could be several times more functional than it is now (for me).
>>opinion off<<

Anyway, I'd appreciate any info - maybe somebody could write a short docu-
ment and zap it to the sumex archives.

             +----------------------+--------------------------+
             | Brent P. Burton      | n138ct@tamuts.tamu.edu   |
             | Texas A&M University | Computer Science/Physics |
             +----------------------+--------------------------+

brad@gobi.jpl.nasa.gov (Brad Pickering) (04/17/91)

I was trying to find out how to create a disk that contained what Apple
calls dispatchable boot blocks.  Inside Mac Vol V describes the fields of
the boot blocks but not enough detail is there to use the fields correctly.
Somebody (I'm sorry I've lost your name) pointed me at IM Vol IV and TN 134
(Boot Problems).  IM Vol IV has less information than Vol V but TN 134
was a little more useful: it tells you what visual clues indicate what stage
of the boot process has completed.

It turned out that the best source of information about the boot blocks format
is in the include file 'Private.a' that comes with the MPW Assembler.  I
only got something working, though, after I read the ROM code that loads
the boot blocks.

The results of what I learned are as follows:
the first field 'bbID' should be $4c4b
the second field 'bbEntry' should be a relative branch to the boot code
the third field 'bbVersion' can be either $44 or $c0

The part that threw me off the most was this third field.  The documentation
says its a word long but doesn't tell you that only the first byte matters.

Oh Well, here is the resulting code which can hang your machine at boot.

(In THINK C)

	asm {
	dc.w 0x4c4b
	bra.w @skip
	dc.w 0x4400
@skip	bra.s @skip
	}

I hope this information helps others.


--
--
Brad Pickering
brad@gobi.jpl.nasa.gov
--