home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 1 / FishNMoreVol1.bin / more / misc_utils / safereboot / safereboot.doc < prev    next >
Text File  |  1990-09-14  |  7KB  |  154 lines

  1.  
  2.       »»»»»»»»»»»»»»»»»»»»»»»»  SafeReboot  «««««««««««««««««««««««
  3.  
  4.                             Copyright © 1990
  5.                            All Rights Reserved
  6.  
  7.                            by  Marty Flickinger
  8.  
  9.                            Rev 1.0   19-Jul-90
  10.  
  11.  
  12. How many Amiga users have lost data because of failing to wait for the
  13. floppy LED to go off before rebooting or shutting off their machine?  This
  14. mistake is dreadfully easy to make when using a hard drive, even for the
  15. experienced Amiga owner.
  16.  
  17. As the Amiga pops up in more and more average households and in an ever-
  18. increasing number of vertical markets, think how casual (non-technical) the
  19. average Amiga user is becoming.  With this in mind, it's astonishing that
  20. Commodore has yet to incorporate a safer way for the user to shutdown or
  21. reboot his/her computer.  Even the lowly Macintosh takes care of this!
  22.  
  23. Until the operating system incorporates such a feature, I suggest using
  24. this simple system wedge to protect the integrity of your disks.
  25.  
  26.  
  27. What is the problem?
  28. ~~~~~~~~~~~~~~~~~~~~
  29. The reason that your disks can become corrupted by rebooting or shutting
  30. off your Amiga at the wrong time is that at the apparent completion of some
  31. disk activities the operating system still has data that needs to be saved.
  32. This isn't obvious because the floppy or hard drive LED will go off and the
  33. action will seem to have completed, yet a few seconds later the drive may be
  34. accessed again.  When the system is rebooted or shut off before one of these
  35. delayed accesses--voila, lost data, the file is trashed.  The automatic disk
  36. validator can sometimes clean up this mess, but occasionally it won't.  In
  37. which case, all the data on the disk or partition runs the risk of going up
  38. in smoke.
  39.  
  40.  
  41. Why does this problem exist?
  42. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  43. Believe it or not, there is a very good reason for the operating system to
  44. behave this way.  The Amiga's filing systems (especially FastFileSystem)
  45. give you much faster disk accesses by using a RAM buffering technique.
  46. There is no way to use such a scheme efficiently without the side-effect
  47. of a delayed final-write.  Rather than explaining the reasons in detail,
  48. just accept this as a fact.
  49.  
  50.  
  51. The solution
  52. ~~~~~~~~~~~~
  53. This subject has been of great personal interest to me since developing the
  54. line of Xetec hard drives (FastTrak, FastCard, etc.).  Rather than trying
  55. to defeat the RAM buffering, cause immediate I/O flushes, or use any other
  56. speed-degrading technique, I chose to address the problem this way: if a
  57. piece of software could be written that, when the user tried to reboot
  58. (using the Ctrl-Amiga-Amiga sequence), would instruct the system to quickly
  59. complete all disk operations as well as get all unwritten data out of RAM
  60. and onto disk BEFORE THE SYSTEM WAS ALLOWED TO REBOOT, the problem would be
  61. half-solved.  And as long as you always remembered to reboot just before
  62. shutting off the power, we have a total solution.
  63.  
  64. Unfortunately, without hardware modifications, there is no way to intercept
  65. the Ctrl-Amiga-Amiga sequence and do our thing.  The next best thing was to
  66. define a new reboot sequence very similar (SHIFT-Amiga-Amiga).  Now this
  67. sequence CAN be intercepted, we can "flush" the input/output systems, and
  68. then we reboot the system.  This process all takes place so quickly that it
  69. feels just like a normal reboot, even if data is written out first.
  70.  
  71.  
  72. About "SafeReboot"
  73. ~~~~~~~~~~~~~~~~~~
  74. The "SafeReboot" program, when run, will install a small wedge into the
  75. system that watches for the 3-key sequence of left-shift and the two Amiga
  76. keys on either side of the space bar.  This is a totally legal, system-
  77. friendly interrupt that allows all normal keyboard operations to function as
  78. before.  The actual flushing of data by "SafeReboot" is also a totally legal
  79. function that sends a standard "flush" command to all partitions that are
  80. mounted in the system.  Last, the system is rebooted with, you guessed it,
  81. legal reboot code.  (In fact it's the only code that Commodore endorses.) 
  82.  
  83. Once it has installed itself, "SafeReboot" is virtually dormant until the
  84. reboot key-sequence is pressed.  It therefore has little or no impact on
  85. the system throughput.  It's been verified to work properly on Amiga 500's,
  86. 1000's, and 2000's as well as the new 2.0 operating system.  Please let me
  87. know of any hardware or software compatibility problems that might arise.
  88.  
  89.  
  90. Using the "SafeReboot" utility
  91. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  92. To install the wedge into your system, do one of the following:
  93.  
  94.    1) Double-click on the SafeReboot icon (included)
  95.       (A window will appear during installation, and then will disappear) 
  96.  
  97.    2) Type this from a CLI or shell:   SafeReboot   
  98.       (As long as the wedge stays installed, this will not finish executing)
  99.  
  100.    3) Type this from a CLI or shell:   run SafeReboot
  101.       (This will return and the wedge will stay active)
  102.  
  103.    4) Put this in your startup sequence somewhere: run SafeReboot
  104.  
  105. If you like "SafeReboot" and think it's for you, use method 4 above so that
  106. it's automatically protecting you every time you turn your system on.
  107.  
  108. If a reboot is ever requested, the message "Flushing..." will appear and
  109. then the system will QUICKLY be rebooted.  In fact, unless you're looking
  110. for it, you'll not have time to read this message.
  111.  
  112. Should you ever want to remove the "SafeReboot" wedge from the system, just
  113. double-click the icon again if you started it from Workbench (method 1), use
  114. CTRL-C if you executed it (method 2), or use BREAK <cli#> if you used RUN
  115. (method 3 or 4).
  116.  
  117.  
  118. NOTE: to prevent shutting off the machine too early, get in the habit of
  119.       always doing a reboot (SHIFT-Amiga-Amiga) then when the machine starts
  120.       to reboot (screen turns white) you can safely shut the system off.
  121.  
  122.  
  123.  
  124. Who can use the program?
  125. ~~~~~~~~~~~~~~~~~~~~~~~~
  126. Anybody and everybody!  Distribute it freely.  I'd like to see enough people
  127. using this so that Commodore will take note and incorporate a similar
  128. solution into the operating system!  I simply ask that this file be included
  129. intact with each copy of the program.  Come on, gimme credit!  ;^,
  130.  
  131. "SafeReboot" is copyrighted but isn't SHAREWARE.  I'll call it DONATIONWARE.
  132. If you like it you can use it without paying a nickel.  However, I would
  133. love to keep providing useful utilities to further the Amiga, and your
  134. donation will surely encourage that.  For donations of $10 or more you can
  135. request a copy of "UTIL-1", a disk of other utilities/hacks/source code.
  136.  
  137.  
  138. Legal Floobydust
  139. ~~~~~~~~~~~~~~~~
  140. This program comes "as is," no warranty is expressed or implied.  I assume
  141. no liability for loss of data or productivity if this program should fail
  142. to operate correctly.  For permission to distribute this program with any
  143. commercial product, please contact me.  So there.
  144.  
  145.  
  146.  
  147. Marty Flickinger
  148. 2130 E. Crawford #210
  149. Salina, KS 67401
  150.  
  151. Xetec BBS: (913) 827-1974     Flickinger
  152. Compuserve:                   73317,3470
  153.  
  154.