DiskMAG Volume 1 Number 2 (Nov 1988) : UTILITIES / safeboot.doc

 SafeBoot V2.0    ©1988 Mark Lanoux
 UnderSea World Software 03-Oct-88

Boring stuff:
    This program is NOT public domain, nor Shareware.  The author (me!)
retains all rights.  SafeBoot is Copyrighted, therefore it may not be
sold by anyone without my permission.  This program may be distributed
freely as long as all the files in the archive accompany it.  

Brief history of SafeBoot:
   V1.0     CLI based only
   V1.1     Through in some basic Workbench support...
   V2.0     Trashed the old interface, added the Arp file requester
      ...who knows what the future holds...

Requirements:
   This version of SafeBoot requires the file arp.library (V33+) in your
LIBS: directory.  ARP (AmigaDos Replacement Project) is a wonderful
product, I highly recommend it to all users! It can be found on all of the
major nationwide bulletin board systems, and on many local BBS's also.
(thanx for the great file requester, Cheath!)
   Also, any version of Kickstart over 1.2 (1.3, where are yoooooouu??)
will do fine.

Synopsis:
   The virus problem is well known in the Amiga community.  These virus
are brought into the system from the boot sectors of a bootable disk, and
usually spread like wildfire unless detected.  The numerous virus checkers
out there in PD land do the trick, but one problem is if the virus infects
the boot sectors of commercial disks, which occasionaly have special code
imbedded there which is needed to start the program, that disk will be
rendered useless.  This program was written to solve that problem.

   SafeBoot will allow the user to save custom boot sectors of all your
commercial disks and save them for such an emergency.  If a virus somehow
manages to trash the boot sectors of a commercial disk, just run SafeBoot
and it will restore the boot sectors, therefore saving your disk! (and hard
earned money!).

INSTRUCTIONS:
   SafeBoot is runnable from Workbench and the CLI.  If you run it from
Workbench, an icon for the saved boot block data file will be created.
The file BootIcon is needed if you wish icons for the files you save is
wanted.  BootIcon is actually a .info file, and it must be in the same
directory as SafeBoot is at the time when you run it.  If you run the
program from Workbench and BootIcon is not there, no icon will be created.
Of course, you could design your own icon image and name it BootIcon!
(..but I personally love the ones supplied...PT)

   When the program starts, a small window comes up and you are presented
with eight gadgets.  These gadgets are all thats needed to run the
program.  Here is a layout of the gadgets:

                           Save    Restore   >  ?
                         DF0: DF1: DF2: DF3: >  ?
                         Volume Name  Custom Name

   Save         Sets the program into save mode whereby the user may save
                the boot block data from a bootable disk.  When clicked on,
                Save will be printed next to the > .

   Restore      Acts like save, but this will allow the user to restore a
                boot block to a bootable disk.  Restore will be printed
                next to the > .

   DF0: DF1:    These gadgets select which drive the bootable disk whose
   DF2: DF3:    boot block is to be saved/restored is placed.  The drive
                selected will be printed next to the > .

   Volume Name  Hitting this gadget will affect SafeBoot depending on which
                mode (Save or Restore) you are in.  If in Save mode, the
                file that will be saved will be given the name of the
                disk volume whose data is to be saved.  The data file will
                be saved in the directory that SafeBoot was started from.
                In Restore mode, SafeBoot will look for the date file with
                the disk volume name whose boot block is to be restored.
                This file is searched for in the directory SafeBoot was
                started from.

   Custom Name  If you click on this gadget, the Arp file requester will
                be displayed.  This is the famous Charlie Heath file
                requester.  It's operation is very intuitive.  To change
                devices, click the right mouse button.  If you do not
                explicitly type in a filename for the data file, SafeBoot
                will use the same approach as if you had hit the Volume
                Name gadget in that the volume name of the target disk
                will be used.

      When you have selected the mode of operation, the drive where
   the bootable disk is located, and the filename, the actual work begins.
   If all is ok, the filename that is created/accessed will be printed
   in the Workbench Screen's title bar.  If there is an error, a small
   error message will be printed in SafeBoot's window, and no work will be
   done.

      There is no required order of operation, but a sample run may be
   as follows.  For a save, first click on the Save gadget.  Next, select
   the disk drive gadget where the bootable disk is placed.  Finally,
   decide on whether you want to use a custom name or the disk volume name.
   To restore a boot block, just select the Restore gadget and follow the
   same pattern as above.

      A note on restoring boot blocks.  SafeBoot saves as part of the
   data file a header, this header contains the volume name of the disk
   it was saved from.  If you attempt to restore a boot block data file
   to the disk that is was not originally from, SafeBoot puts a requester
   warning you.  You may then proceed to restore, or abort.  If you give
   a boot block data file a less than descript filename, you should go to
   the CLI and do a TYPE <datafile> OPT H for a hex dump of the file.
   You will see on the first line  'BootBlock for:' and on the second line
   will appear the volume name this boot block file is for.  But, for the
   easiest way to check the volume name for a particular file, just check
   that file's comment.  You can do this in the CLI by listing the file or
   by getting a directory where the file is.  The comment line will show
   'BootBlock for:' and the volume name will be printed here.  If you run
   from Workbench, just click on the icon for the data file, and select
   the 'Info' menu selection from the Project menu.

      At the time of saving, a checksum is calculated and saved as part of
   the header.  When a restore is attempted, the checksum is recalculated
   and compared to the checksum in the saved header.  If they do not match
   for some reason, a requester is displayed warning the user, and a choice
   is given on whether to proceed or abort is given.

   This program was written in Benchmark Modula-2.  I would like to thank
   the following people, who in one way or the other, helped me to finish
   this program:
    Patrick Goudeau who gave me programming tips, help, suggestions.
    Paul Trauth who drew the great icons, thanx Paul!
    John Palmer who gave me the idea and who has helped test this program.

   If you wish to thank me, gripe, complain, give money, etc, I can be
   reached at the following address:

   Mark Lanoux
   4447 Markham Avenue
   Jefferson, LA 70121 USA

 The source is available from me, just send me a blank disk and it will
 be promptly returned.
 This program can be found on our board, UnderSea World BBS (504)-341-5323.
 It is also in the New Orleans Commodore Klub (NOCK) library on it's
 anti-virus disk, appropriatly name the in-NOCK-ulation disk.