home *** CD-ROM | disk | FTP | other *** search
/ Carousel Volume 2 #1 / carousel.iso / mactosh / fkey / restart.sit / fkey.docs next >
Text File  |  1987-05-15  |  2KB  |  46 lines

  1.    These are trivial FKEYs which perform the same function 
  2. as ShutDown and Restart from the Finder. The reason for them is so you don't
  3. have to return to the Finder before rebooting your Mac safely. It
  4. relies on the new Shutdown manager which was implemented in the Mac II
  5. and is retrofitted in earlier Macs via system patches in System 4.1.
  6.  
  7.    According to Inside Mac Volume 5 they both will send goodbye kisses
  8. to all open DAs. I tried this with MockWrite and indeed this worked fine for
  9. the Restart Fkey. With Shutdown, I found that with an open MockWrite, it
  10. did get the goodbye kiss and then Shutdown with occurred with the resulting
  11. dialog but when I hit the Restart button on the dialog (this is on a MacPlus)
  12. I got a system bomb ID 20. Pressing restart on that bomb box resulted
  13. in a hung system. I run with a few nonstandard inits so this may not happen
  14. to you. The Restart FKEY suffered no such problems.
  15.  
  16. THIS FKEY REQUIRES SYSTEM 4.1 OR LATER TO WORK!!!!! USING EARLIER SYSTEMS
  17. WILL GENERATE A BOMB BOX WITH ID12. 
  18.  
  19. This is of course FREE and distribution is unlimited. The source code 
  20. is trivial...Apple did all the hard work in the _Shutdown trap.
  21.  
  22. Here is the source to generate the Restart Fkey. The Shutdown Fkey is merely
  23. the same code with the MOVE.W #sdRestart,-(SP) changed to 
  24. MOVE.W #sdPowerOff,-(SP). 
  25.  
  26. ---------------- beginning of source ----------
  27.  
  28. sdPowerOff         EQU  1
  29. sdRestart         EQU  2
  30. .TRAP        _ShutDown    $A895
  31.  
  32.  
  33.  
  34.     MOVE.W    #sdRestart,-(SP)    ; push selector on stack
  35.     _ShutDown            ; call shutdown trap
  36. ;    RTS                ; not really necessary but here it is
  37.  
  38. --------------- end of source
  39.  
  40. David Gelphman                  BITNET address: DAVEG@SLACVM
  41. Bin #88 SLAC                    ARPANET address:  DAVEG@SLACVM.BITNET
  42. Stanford, Calif. 94305          UUCP address: ...psuvax1!daveg%slacvm.bitnet
  43. 415-854-3300 x2538              GEnie:    D.Gelphman
  44. usual disclaimer #432 applies: my employer apologizes for the fact
  45. that I have access to this net.
  46.