home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HyperLib 1997 Winter - Disc 1
/
HYPERLIB-1997-Winter-CD1.ISO.7z
/
HYPERLIB-1997-Winter-CD1.ISO
/
オンラインウェア
/
UTIL
/
ForcePRAM.sit
/
README
< prev
next >
Wrap
Text File
|
1994-04-11
|
9KB
|
238 lines
Force Parameter Ram INIT
In many environments, especially public access labs, it's critical
for easy maintenance to be able to automatically reset settings
controlled by the Macs' parameter ram (PRAM), instead of manually
via the Chooser and various control panels. Here at the University
of Maryland, we use Sonic Systems' TDM (the Diskless Mac) Ethernet
boot prom extensively, which depends on certain PRAM settings to
be able to boot. Despite removing various control panels, users
still frequently manage to mess up these settings by actions like
booting from a floppy without an Ethernet driver, and zapping the PRAM.
This extensible INIT allows us to automatically reset these settings
without any need for lab attendant training. It should be useful not
only to other labs using Sonic's diskless boot mechanism (which we
recommend heartily, though as codevelopers we're hardly disinterested
parties), but also to any site that needs to maintain certain PRAM
settings automatically. It consists of a driver resource (the INIT 128
resource) and various extension resources (FoRc 128 and up).
The extension resources reconfigure various cells in the
Macintosh motherboard's "Parameter RAM" (or PRAM).
A mechanism is provided to allow extension resources to
request that the workstation be rebooted after PRAM has
been changed.
We use this INIT in two different places. We put a copy
of it into the boot image on our BootP server. If the
PRAM is not misconfigured enough to prevent the Diskless
Boot from completing, the INIT runs from the RAM Disk and
fixes the PRAM, then requests a reboot, which runs a second
diskless boot. The result is that the workstation appears
to reboot twice, but then is properly configured.
If the PRAM is so badly misconfigured that the Diskless
Boot does not complete, the workstation will typically go
to a blinking question mark (or in rare cases will be stuck
in continual TFTP booting and will never stop).
For these cases we hand out a "fixit" floppy and tell our
workstation fixit guys (who are not technically astute)
"Just reboot it with this disk, that will fix it".
Of course, this INIT is in the system on the fixup disk.
Thus it will reconfigure the PRAM and reboot. But now
the PRAM will be configured to reboot from the network
and the usual Diskless Boot will complete.
The result is that the workstation will kick out the fixit
floppy and return itself to active service.
The driver resource executes each of the extension resources
in turn. If any extension requests a reboot, the workstation
is rebooted at the end of the process. By thus queueing the
reboot requests instead of executing them immediately we make
it unnecessary to ever reboot the workstation more than once,
no matter how many of the PRAM cells need to be reset.
Each extension resource usually has an associated DATA
resource containing control information. In the simplest
case, the resource is a binary flag that determines whether
an optional capability (like 32-bit addressing) is to be
forced on or off. In other cases the DATA resource contains
complex structured information. The correlation between the
FoRc and DATA resources is via resource numbers. That is,
FoRc resource 128 uses DATA resource 128 etc.
While this package was designed to be extensable, we have
provided an initial set of 7 extension resources which we
find to be useful here at the University of Maryland.
Please feel free to remove the ones you don't consider
useful, and to develop new ones to solve whatever problems
your configuration generates.
===============
Driver
The driver (INIT 128) is fairly straightforward, it uses
Get1IndResource to find the FoRc resources to be executed
(thus the numbers need not be contiguous). It uses
GetResInfo to find the resource number of the FoRc resource
and Get1Resource to attempt to locate the associated DATA
resource.
At call to the extension:
A0 Resource handle for extension itself
A1 Resource pointer for extension itself
D0 Always passed as zero
D1 Resource handle for DATA resource, zero if none present
When the extension returns D0 (word) is tested for zero.
If D0 is zero then the extension did not request a reboot.
If D0 is nonzero, the fact is noted, and the driver will
use the _SDRestart trap to reboot the workstation after
all the FoRc resources have had a chance to run.
===============
Appletalk
The extension to control AppleTalk can turn it on or off,
and can select a specific Link Access Protocol (LAP).
At the University of Maryland we turn basic AppleTalk ON
(in case a previous user of the workstation turned it off)
and force the LAP selection to EtherTalk on a NuBus card
(in case the user booted a floppy without EtherNet).
The DATA resource is a 16 bit word consisting of two bytes.
The high-order byte selects ON/OFF and LAP while the
low-order byte specifies the slot number to start searching
for an EtherNet card. If this is 0 an on-board EtherNet
capability will be found, if this is 1 then only NuBus
EtherNet cards will be found.
DATA resource values:
00 xx AppleTalk to be turned off entirely
01 xx Localtalk
02 xx EtherTalk Phase 1
03 xx EtherTalk Phase 2
xx 00 Any Ether Interface (Internal or NuBus)
xx 01 Require NuBus Interface (for diskless on Q610)
===============
Disk Cache
The extension to control the Disk Cache forces the PRAM
byte corresponding to the "Disk Cache" item in the Memory
Control Panel. The DATA resource is a 16-bit word
containing the number of K bytes of disk cache to be
allocated. For the minimum size of 32K the value $20 or
32 should be used. We set this to 512K or $200.
===============
Map Location
The extension to control Map Location forces the PRAM
bytes controlled by the Map Control Panel.
The DATA resource is just 8 bytes to be transferred
into the PRAM. The format was documented in MacTutor
at one point. I would suggest you set one of your
machines correct manually, then use the PRAM display
program that is part of this package to display the
correct 8 bytes (PRAM locations E4 to EB) then type
those 8 bytes into the DATA resource.
===============
32-bit Addressing
The extension to control 32-bit addressing forces the
PRAM bit controlled by the 32-bit addressing buttons
in the Memory Control Panel.
The DATA resource is a 16-bit integer that is simply a
binary flag. If it is zero, 32-bit addressing is
forced off. If nonzero, it will be forced on.
===============
Network Boot Device
The extension to control Network Boot Device will find
the EtherNet card and set it to be the boot device.
For consistency it has a DATA resource that controls
if network booting will be set ON or OFF. I don't know
that setting it OFF has any usefulness. Maybe this
should be changed to be able to force a specific boot
hard disk. I dunno.
===============
Quadra Cache
The extension to control the Quadra Cache changes the
same PRAM cell as the Processor Cache control panel.
The DATA resource is a 16 bit integer that is a binary
flag. If zero, the processor cache will be disabled.
If nonzero, it will be enabled.
We have some old "legacy applications" that cannot tolerate
the Quadra cache, thus we currently force it disabled.
When we get beyond this, we hope to force it on instead.
===============
RAM Disk
The RAM Disk extension affects the PRAM cell that is set
by the RAM Disk setup stuff in the Memory Control Panel.
The DATA resource is an open-ended parameter list
consisting of two-byte pairs. The first byte of each
pair is a minimum RAM memory size, the second byte is
how much to be used for a RAM disk. When a first-byte
is found that is less than or equal to the size of RAM
on the workstation, the second byte is used to initialize
the RAM disk cell.
Here at the University of Maryland we have machines with
16 MB and 20 MB of memory. In an attempt to level the
playing field, we create a 4MB RAM disk on the 20 MB
machines, so all machines have 16 MB of main memory.
The DATA resource we use here is:
$1404
This says "if you have at least 20 MB of memory, make 4 MB
of it into a RAM disk". Here is a somewhat more complex
program:
$1C061404
It says "if you have at least 28 MB of memory, make 6 MB
of it into a RAM disk, else if you have at least 20 MB
of memory, make 4 MB into a RAM disk, else turn the RAM
disk off".
===============
The program PRAMSpy can be used to view the 256 bytes of
PRAM on your Macintosh. There is also a set of notes I
have been making on parameter RAM locations and useages.
This is pure reverse-engineering and cannot be taken as
anything like definitive. If you find out more information,
consider sending it to me so I can incorporate it into
the documentation mass.
Ben Cranston <zben@ni.umd.edu>
March 11, 1994