home *** CD-ROM | disk | FTP | other *** search
-
- »»»»»»»»»»»»»»»»»»»»»»»» SafeReboot «««««««««««««««««««««««
-
- Copyright © 1990
- All Rights Reserved
-
- by Marty Flickinger
-
- Rev 1.1 24-Oct-90
-
-
- How many Amiga users have lost data because of failing to wait for the
- floppy LED to go off before rebooting or shutting off their machine? This
- mistake is dreadfully easy to make when using a hard drive, even for the
- experienced Amiga owner.
-
- As the Amiga pops up in more and more average households and in an ever-
- increasing number of vertical markets, think how casual (non-technical) the
- average Amiga user is becoming. With this in mind, it's astonishing that
- Commodore has yet to incorporate a safer way for the user to shutdown or
- reboot his/her computer. Even the lowly Macintosh takes care of this!
-
- Until the operating system incorporates such a feature, I suggest using
- this simple system wedge to protect the integrity of your disks.
-
-
- What is the problem?
- ~~~~~~~~~~~~~~~~~~~~
- The reason that your disks can become corrupted by rebooting or shutting
- off your Amiga at the wrong time is that at the apparent completion of some
- disk activities the operating system still has data that needs to be saved.
- This isn't obvious because the floppy or hard drive LED will go off and the
- action will seem to have completed, yet a few seconds later the drive may be
- accessed again. When the system is rebooted or shut off before one of these
- delayed accesses--voila, lost data, the file is trashed. The automatic disk
- validator can sometimes clean up this mess, but occasionally it won't. In
- which case, all the data on the disk or partition runs the risk of going up
- in smoke.
-
-
- Why does this problem exist?
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Believe it or not, there is a very good reason for the operating system to
- behave this way. The Amiga's filing systems (especially FastFileSystem)
- give you much faster disk accesses by using a RAM buffering technique.
- There is no way to use such a scheme efficiently without the side-effect
- of a delayed final-write. Rather than explaining the reasons in detail,
- just accept this as a fact.
-
-
- The solution
- ~~~~~~~~~~~~
- This subject has been of great personal interest to me since developing the
- line of Xetec hard drives (FastTrak, FastCard, etc.). Rather than trying
- to defeat the RAM buffering, cause immediate I/O flushes, or use any other
- speed-degrading technique, I chose to address the problem this way: if a
- piece of software could be written that, when the user tried to reboot
- (using the Ctrl-Amiga-Amiga sequence), would instruct the system to quickly
- complete all disk operations as well as get all unwritten data out of RAM
- and onto disk BEFORE THE SYSTEM WAS ALLOWED TO REBOOT, the problem would be
- half-solved. And as long as you always remembered to reboot just before
- shutting off the power, we have a total solution.
-
- Unfortunately, without hardware modifications, there is no way to intercept
- the Ctrl-Amiga-Amiga sequence and do our thing. The next best thing was to
- define a new reboot sequence very similar (SHIFT-Amiga-Amiga). Now this
- sequence CAN be intercepted, we can "flush" the input/output systems, and
- then we reboot the system. This process all takes place so quickly that it
- feels just like a normal reboot, even if data is written out first.
-
-
- About "SafeReboot"
- ~~~~~~~~~~~~~~~~~~
- The "SafeReboot" program, when run, will install a small wedge into the
- system that watches for the 3-key sequence of left-shift and the two Amiga
- keys on either side of the space bar. This is a totally legal, system-
- friendly interrupt that allows all normal keyboard operations to function as
- before. The actual flushing of data by "SafeReboot" is also a totally legal
- function that sends a standard "flush" command to all partitions that are
- mounted in the system. Last, the system is rebooted with, you guessed it,
- legal reboot code. (In fact it's the only code that Commodore endorses.)
-
- Once it has installed itself, "SafeReboot" is virtually dormant until the
- reboot key-sequence is pressed. It therefore has little or no impact on
- the system throughput. It's been verified to work properly on Amiga 500's,
- 1000's, and 2000's as well as the new 2.0 operating system. Please let me
- know of any hardware or software compatibility problems that might arise.
-
-
- Using the "SafeReboot" utility
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- To install the wedge into your system, do one of the following:
-
- 1) Double-click on the SafeReboot icon (included)
- (A window will appear during installation, and then will disappear)
-
- 2) Type this from a CLI or shell: SafeReboot
- (As long as the wedge stays installed, this will not finish executing)
-
- 3) Type this from a CLI or shell: run SafeReboot
- (This will return and the wedge will stay active)
-
- 4) Put this in your startup sequence somewhere: run SafeReboot
-
- If you like "SafeReboot" and think it's for you, use method 4 above so that
- it's automatically protecting you every time you turn your system on.
-
- If a reboot is ever requested, the message "Flushing..." will appear and
- then the system will QUICKLY be rebooted. In fact, unless you're looking
- for it, you'll not have time to read this message.
-
- Should you ever want to remove the "SafeReboot" wedge from the system, just
- double-click the icon again or type "SafeReboot" again.
-
- NOTE: to prevent shutting off the machine too early, get in the habit of
- always doing a reboot (SHIFT-Amiga-Amiga) then when the machine starts
- to reboot (screen turns white) you can safely shut the system off.
-
-
-
- Who can use the program?
- ~~~~~~~~~~~~~~~~~~~~~~~~
- Anybody and everybody! Distribute it freely. I'd like to see enough people
- using this so that Commodore will take note and incorporate a similar
- solution into the operating system! I simply ask that this file be included
- intact with each copy of the program. Come on, gimme credit! ;^,
-
- "SafeReboot" is copyrighted but isn't SHAREWARE. I'll call it DONATIONWARE.
- If you like it you can use it without paying a nickel. However, I would
- love to keep providing useful utilities to further the Amiga, and your
- donation will surely encourage that. For donations of $10 or more you can
- request a copy of "UTIL-1", a disk of other utilities/hacks/source code.
-
-
- Legal Floobydust
- ~~~~~~~~~~~~~~~~
- This program comes "as is," no warranty is expressed or implied. I assume
- no liability for any damages such as loss of data or productivity that may
- result if this program is misused or should fail to operate correctly.
- For permission to distribute this program with any commercial product,
- please contact me first. So there.
-
-
-
- Marty Flickinger
- 2130 E. Crawford #210
- Salina, KS 67401
-
- Xetec BBS: (913) 827-1974 M.Flickinger
- Compuserve: 73317,3470
-
-