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 >
Text File  |  1994-04-11  |  9KB  |  238 lines

  1. Force Parameter Ram INIT
  2.  
  3. In many environments, especially public access labs, it's critical
  4. for easy maintenance to be able to automatically reset settings
  5. controlled by the Macs' parameter ram (PRAM), instead of manually
  6. via the Chooser and various control panels.  Here at the University
  7. of Maryland, we use Sonic Systems' TDM (the Diskless Mac) Ethernet
  8. boot prom extensively, which depends on certain PRAM settings to
  9. be able to boot.  Despite removing various control panels, users 
  10. still frequently manage to mess up these settings by actions like
  11. booting from a floppy without an Ethernet driver, and zapping the PRAM.
  12.  
  13. This extensible INIT allows us to automatically reset these settings
  14. without any need for lab attendant training.  It should be useful not
  15. only to other labs using Sonic's diskless boot mechanism (which we
  16. recommend heartily, though as codevelopers we're hardly disinterested
  17. parties), but also to any site that needs to maintain certain PRAM
  18. settings automatically.  It consists of a driver resource (the INIT 128
  19. resource) and various extension resources (FoRc 128 and up).
  20.  
  21. The extension resources reconfigure various cells in the
  22. Macintosh motherboard's "Parameter RAM" (or PRAM).
  23. A mechanism is provided to allow extension resources to
  24. request that the workstation be rebooted after PRAM has
  25. been changed.
  26.  
  27. We use this INIT in two different places.  We put a copy
  28. of it into the boot image on our BootP server.  If the
  29. PRAM is not misconfigured enough to prevent the Diskless
  30. Boot from completing, the INIT runs from the RAM Disk and
  31. fixes the PRAM, then requests a reboot, which runs a second
  32. diskless boot.  The result is that the workstation appears
  33. to reboot twice, but then is properly configured.
  34.  
  35. If the PRAM is so badly misconfigured that the Diskless
  36. Boot does not complete, the workstation will typically go
  37. to a blinking question mark (or in rare cases will be stuck
  38. in continual TFTP booting and will never stop).
  39.  
  40. For these cases we hand out a "fixit" floppy and tell our
  41. workstation fixit guys (who are not technically astute)
  42. "Just reboot it with this disk, that will fix it".
  43. Of course, this INIT is in the system on the fixup disk.
  44. Thus it will reconfigure the PRAM and reboot.  But now
  45. the PRAM will be configured to reboot from the network
  46. and the usual Diskless Boot will complete.
  47.  
  48. The result is that the workstation will kick out the fixit
  49. floppy and return itself to active service.
  50.  
  51. The driver resource executes each of the extension resources
  52. in turn.  If any extension requests a reboot, the workstation
  53. is rebooted at the end of the process.  By thus queueing the
  54. reboot requests instead of executing them immediately we make
  55. it unnecessary to ever reboot the workstation more than once,
  56. no matter how many of the PRAM cells need to be reset.
  57.  
  58. Each extension resource usually has an associated DATA
  59. resource containing control information.  In the simplest
  60. case, the resource is a binary flag that determines whether
  61. an optional capability (like 32-bit addressing) is to be
  62. forced on or off.  In other cases the DATA resource contains
  63. complex structured information.  The correlation between the
  64. FoRc and DATA resources is via resource numbers.  That is,
  65. FoRc resource 128 uses DATA resource 128 etc.
  66.  
  67. While this package was designed to be extensable, we have
  68. provided an initial set of 7 extension resources which we
  69. find to be useful here at the University of Maryland.
  70. Please feel free to remove the ones you don't consider
  71. useful, and to develop new ones to solve whatever problems
  72. your configuration generates.
  73.  
  74. ===============
  75.  
  76. Driver
  77.  
  78. The driver (INIT 128) is fairly straightforward, it uses
  79. Get1IndResource to find the FoRc resources to be executed
  80. (thus the numbers need not be contiguous).  It uses
  81. GetResInfo to find the resource number of the FoRc resource
  82. and Get1Resource to attempt to locate the associated DATA
  83. resource.
  84.  
  85. At call to the extension:
  86.  
  87. A0 Resource handle for extension itself
  88. A1 Resource pointer for extension itself
  89. D0 Always passed as zero
  90. D1 Resource handle for DATA resource, zero if none present
  91.  
  92. When the extension returns D0 (word) is tested for zero.
  93. If D0 is zero then the extension did not request a reboot.
  94. If D0 is nonzero, the fact is noted, and the driver will
  95. use the _SDRestart trap to reboot the workstation after
  96. all the FoRc resources have had a chance to run.
  97.  
  98. ===============
  99.  
  100. Appletalk
  101.  
  102. The extension to control AppleTalk can turn it on or off,
  103. and can select a specific Link Access Protocol (LAP).
  104. At the University of Maryland we turn basic AppleTalk ON
  105. (in case a previous user of the workstation turned it off)
  106. and force the LAP selection to EtherTalk on a NuBus card
  107. (in case the user booted a floppy without EtherNet).
  108.  
  109. The DATA resource is a 16 bit word consisting of two bytes.
  110. The high-order byte selects ON/OFF and LAP while the
  111. low-order byte specifies the slot number to start searching
  112. for an EtherNet card.  If this is 0 an on-board EtherNet
  113. capability will be found, if this is 1 then only NuBus
  114. EtherNet cards will be found.
  115.  
  116. DATA resource values:
  117.  
  118. 00 xx AppleTalk to be turned off entirely
  119. 01 xx Localtalk
  120. 02 xx EtherTalk Phase 1
  121. 03 xx EtherTalk Phase 2
  122. xx 00 Any Ether Interface (Internal or NuBus)
  123. xx 01 Require NuBus Interface (for diskless on Q610)
  124.  
  125. ===============
  126.  
  127. Disk Cache
  128.  
  129. The extension to control the Disk Cache forces the PRAM
  130. byte corresponding to the "Disk Cache" item in the Memory
  131. Control Panel.  The DATA resource is a 16-bit word
  132. containing the number of K bytes of disk cache to be
  133. allocated.  For the minimum size of 32K the value $20 or
  134. 32 should be used.  We set this to 512K or $200.
  135.  
  136. ===============
  137.  
  138. Map Location
  139.  
  140. The extension to control Map Location forces the PRAM
  141. bytes controlled by the Map Control Panel.
  142.  
  143. The DATA resource is just 8 bytes to be transferred
  144. into the PRAM.  The format was documented in MacTutor
  145. at one point.  I would suggest you set one of your
  146. machines correct manually, then use the PRAM display
  147. program that is part of this package to display the
  148. correct 8 bytes (PRAM locations E4 to EB) then type
  149. those 8 bytes into the DATA resource.
  150.  
  151. ===============
  152.  
  153. 32-bit Addressing
  154.  
  155. The extension to control 32-bit addressing forces the
  156. PRAM bit controlled by the 32-bit addressing buttons
  157. in the Memory Control Panel.
  158.  
  159. The DATA resource is a 16-bit integer that is simply a
  160. binary flag.  If it is zero, 32-bit addressing is
  161. forced off.  If nonzero, it will be forced on.
  162.  
  163. ===============
  164.  
  165. Network Boot Device
  166.  
  167. The extension to control Network Boot Device will find
  168. the EtherNet card and set it to be the boot device.
  169. For consistency it has a DATA resource that controls
  170. if network booting will be set ON or OFF.  I don't know
  171. that setting it OFF has any usefulness.  Maybe this
  172. should be changed to be able to force a specific boot
  173. hard disk.  I dunno.
  174.  
  175. ===============
  176.  
  177. Quadra Cache
  178.  
  179. The extension to control the Quadra Cache changes the
  180. same PRAM cell as the Processor Cache control panel.
  181.  
  182. The DATA resource is a 16 bit integer that is a binary
  183. flag.  If zero, the processor cache will be disabled.
  184. If nonzero, it will be enabled.
  185.  
  186. We have some old "legacy applications" that cannot tolerate
  187. the Quadra cache, thus we currently force it disabled.
  188. When we get beyond this, we hope to force it on instead.
  189.  
  190. ===============
  191.  
  192. RAM Disk
  193.  
  194. The RAM Disk extension affects the PRAM cell that is set
  195. by the RAM Disk setup stuff in the Memory Control Panel.
  196.  
  197. The DATA resource is an open-ended parameter list
  198. consisting of two-byte pairs.  The first byte of each
  199. pair is a minimum RAM memory size, the second byte is
  200. how much to be used for a RAM disk.  When a first-byte
  201. is found that is less than or equal to the size of RAM
  202. on the workstation, the second byte is used to initialize
  203. the RAM disk cell.
  204.  
  205. Here at the University of Maryland we have machines with
  206. 16 MB and 20 MB of memory.  In an attempt to level the
  207. playing field, we create a 4MB RAM disk on the 20 MB
  208. machines, so all machines have 16 MB of main memory.
  209.  
  210. The DATA resource we use here is:
  211.  
  212. $1404
  213.  
  214. This says "if you have at least 20 MB of memory, make 4 MB
  215. of it into a RAM disk".  Here is a somewhat more complex
  216. program:
  217.  
  218. $1C061404
  219.  
  220. It says "if you have at least 28 MB of memory, make 6 MB
  221. of it into a RAM disk, else if you have at least 20 MB
  222. of memory, make 4 MB into a RAM disk, else turn the RAM
  223. disk off".
  224.  
  225. ===============
  226.  
  227. The program PRAMSpy can be used to view the 256 bytes of
  228. PRAM on your Macintosh.  There is also a set of notes I
  229. have been making on parameter RAM locations and useages.
  230. This is pure reverse-engineering and cannot be taken as
  231. anything like definitive.  If you find out more information,
  232. consider sending it to me so I can incorporate it into
  233. the documentation mass.
  234.  
  235. Ben Cranston <zben@ni.umd.edu>
  236.  
  237. March 11, 1994
  238.