PART II
THE "ULTIMATE VIRUS KILLER" MANUAL
7 - REPAIR BIOS PARAMETER BLOCK
Some mutant virus types, as well as various other reasons, can
cause the BIOS Parameter Block (or BPB) in a bootsector to be
corrupted. This means that there is no longer any information on
the disk's format available to the Operating System. Therefore it
will no longer be able to determine how many tracks and sectors a
disk has, nor several other vital parameters. Trying to display a
directory from such a disk will most likely result in a system
hang-up, bomb crash or the appearance of a disk filled with
corrupted files and filenames.
The "Ultimate Virus Killer" incorporates a semi-intelligent
routine that automatically recognises known mutant virus
versions or damaged BIOS Parameter Blocks and allows the user to
repair it again. In the case of a mutant virus being present,
that will first be removed.
PLEASE NOTE THAT YOU SHOULD READ THIS SECTION OF THE MANUAL
BEFORE YOU EVER ATTEMPT TO REPAIR A BIOS PARAMETER BLOCK!!
Repairing a BIOS Parameter Block is quite difficult; after all,
this small segment of the bootsector determines whether or not
your computer can read from or write to individual disks.
First, let's supply you with a table that specifies how the BIOS
Parameter Block is built up. OFFSET means the value that
should be added from the start of the bootsector, starting at
zero, in regular decimal notation.
-----------------------------------------------------------------
OFFSET: NAME: EXPLANATION:
-----------------------------------------------------------------
8-10 SERIAL A disk's serial number (a 24-bit
random number)
11-12 BPS Bytes per sector (see 7.1)
13 SPC Sectors per cluster (see 7.5)
14-15 RES Number of reserved sectors (1)
16 FAT Number of FATs on the disk (see 7.6)
17-18 DIR Number of directory entries (see 7.7)
19-20 SEC Total number of sectors (2)
21 MEDIA Media descriptor byte (3)
22-23 SPF Sectors per FAT entry (see 7.8)
24-25 SPT Sectors per track (see 7.3)
26-27 SIDES Number of sides (see 7.4)
28-29 HID Number of hidden sectors (4)
-----------------------------------------------------------------
(1) Reserved for the bootsector. Theoretically, this could be
bigger in case of a bootsector bigger than one disk sector.
The actual Atari Operating System, however, has not been
prepared to handle this. So it's always 1.
(2) You have to specify the tracks per side (see 7.2), which is
internally multiplied by SIDES * SPT to create this value.
(3) Seemingly unimportant thing that is apparently not supported
by the ST's Operating System and of importance only to MS-DOS
computers. Still the "Ultimate Virus Killer" uses the SIDES
amount to calculate it properly.
(4) This is a leftover of the MS-DOS Operating System with which
Atari disks are compatible. In these hidden sectors, MS-DOS
stores system files that are really of noone's business. On
the Atari it's always 0.
The BIOS Parameter Block layout
It is not necessary for you to know the above table by heart. It
was supplied here to give you some idea of what the BIOS
Parameter Block means to the Operating System. Whenever a BPB
is destroyed, these essential pieces of information are no longer
present (which, as said before, will most likely result in
various disk error messages, a system crash or a garbage disk
directory).
First of all, you should know that you should not try out this
'BPB repair' option on original game software, as current-day
software protection techniques involve the craziest disk formats
that would probably drive the "Ultimate Virus Killer" algorithms
nuts! Apart from that, attempting a 'BPB repair' on such a disk
may also lead to instant software malfunction. The only option
you should ever use in order to restore the contents of original
(game-or demo-) software disks is the main menu 'restore disks'
option.
Secondly, you should also realise that the 'BPB repair'
option just may not work correctly on disks that have been
formatted using 'larger' formats previously. This would for
example be the case with a disk that you formatted with 82 tracks
some time ago and later decided to reformat with only 80 tracks.
Some remnants of the old format still left intact (in this case
the tracks above track 80) may be found, disturbing the
algorithm.
There are two ways to get access to the 'BPB repair' option. The
first is the most obvious: Whenever a damaged BIOS Parameter
Block is detected (and this does not even need to be the
result of a mutant virus) the program asks whether you want to
attempt a BPB repair or not. The second way is a forced one. If,
for some reason or other, you know a disk doesn't have a proper
BPB even though it's valid, you can keep the [RIGHT SHIFT] key
pressed to forcedly enter the 'BPB repair' option.
You need not be worried if you inadvertently entered the 'BPB
repair' function; after you have specified all parameters you can
always cancel the whole thing at the end, leaving the current
BIOS Parameter Block unaltered.
As was stated already, repairing the BIOS Parameter is not
only a slightly complicated matter, but it may also prove to be
dangerous insofar that the specification of the wrong parameters
can make whatever is on your disk totally inaccessible. Common
symptoms of a disk with inaccessible material on it are the
aforementioned crashes, disk errors and disk directories
containing only garbage information (huge file sizes, weird file
names, invalid dates and times). Therefore you should take care
using the 'BPB repair' option. But even if you have already
attempted a BIOS Parameter Block repair with wrong parameters
there is a way to attempt it again. Even though the BPB would be
perfectly valid, you could still enter the 'BPB repair' option
forcedly using [RIGHT SHIFT], mentioned above. Make sure you keep
that key pressed during and after the floppy disk is being
accessed until the "Damaged BPB" dialog appears on your screen.
Using this forced entry method, you can fiddle around with the
parameters a bit until you strike luck.
Should you find yourself unable to fix it regardless (or if you
simply do not dare to attempt a BPB repair yourself), you can
send the disk to the address mentioned in the "FEEDBACK" chapter
of this manual. Please add an amount of money that equals the
price of an "Ultimate Virus Killer" update and twice the amount
of IRCs required. You will receive your disk(s) back after a
short time (hopefully). In case of my not being able to repair it
either, you will receive your money back (not the IRCs though).
Some important notes:
- It is important that you do not try to delete files from or
write files to disk that have a damaged or wrong BIOS Parameter
Block.
- If you send in disks with BIOS Parameter Blocks that need to be
repaired, please clearly state that you want your disk repaired
and that you don't want an update!
- Whenever you repair the BIOS Parameter Block of a disk it will
automatically be immunized, too.
- Attempting a 'BPB repair' on a disk is no cheap way of
increasing a disk's storage capacity. Specifying more sides,
more sectors per tracks or more tracks per side than are
actually present will cause whatever is on the disk to remain
(or become) inaccessible.
During the 'BPB repair' function some dialog boxes requesting
input will be put on the screen. You have to use these to
specify certain BPB values that the "Ultimate Virus Killer" uses
internally to reconstruct what was probably previously the proper
BPB. Do not worry if you do not know anything about this. This
part of the manual can be of some help, and you can also use the
built-in context-sensitive on-line help options by pressing the
[HELP] key.
7.1 HOW MANY BYTES PER SECTOR
Claus Brod, Atari mass storage media expert and author of
probably the best book in this field (called "Scheibenkleister",
unfortunately in German), claims that only 512 bytes per sector
are possible as TOS (the Operating System within your computer)
does not allow for 128, 256 or 1024 BPS on floppy disks. For
the sake of compatibility with future TOS versions as well as
for the pure sake of completion it is possible to select any of
the theoretically possible values here.
Unnecessary to say, you will almost certainly have to specify
512 bytes per sector here.
7.2 HOW MANY TRACKS PER SIDE
This can vary quite a lot, due to formatting programs available
that allow up to 90 (?!) tracks per side to be formatted
(whether or not these programs should be used and whether
these tracks are safe for data storage will not be discussed
here).
When requested to specify the number of tracks per side it will
be handy to remember if you formatted the disk in the drive using
the standard GEM DESKTOP format option or not. If you did, you
should select 80. If you did not, you should select 'Examine'
unless you are certain yourself of the amount of tracks present
on the disk (some people write the three vital disk
characteristics - tracks per disk, sectors per track and number
of sides - on the label of a disk; this may be a good idea for
you too).
The 'examine' option reads the first sector from ever
increasing track numbers and calculates the number of tracks
present on a disk by substracting 1 from the first track number
that cannot be read (which would indicate it never having been
formatted). This means that disks that have been formatted using
more tracks earlier and that were reformatted using less tracks
later will likely cause the "Ultimate Virus Killer" to find the
old amount of tracks.
7.3 HOW MANY SECTORS PER TRACK
Much like the amount of tracks per side, the amount of sectors
per track can very a lot. When a standard Atari double density
disk has been formatted using the standard GEM DESKTOP format
option, this value is 9. In other cases it can be any value
from 1 to 11. Values below 9 are almost absurd and have never
been seen. A value of 12 is possible within the "Ultimate Virus
Killer", too, despite it being theoretically impossible, to cater
for the theoretically impossible. Standard Falcon (and post-1992
TT) disks support higher amounts of sectors per track; they are
High Density (HD) disks as opposed to the regular Double Density
(DS) ones. High Density disks can write 18 (on 3.5" disks, which
is normal) or 15 sectors per track (on 5.25" disks). Extra High
Density (ED) disk drives exist, too, allowing the use of a
massive 26 sectors per track or even more, but these are quite
rare. All kinds of disk drives, including DD, HD and ED ones, are
supported by the internal 'BPB repair' algorithms.
Try to remember the right number of sectors per track yourself
(and write this information on disk labels as of now), since
otherwise the 'examine' option will perhaps find the remains of
previously formatted extra sectors per track. Normally this
should not happen, but certain 'fast format' programs neglect to
fully initialise a track and may may leave some old format
information more or less intact.
Analogous to the calculation of tracks per disk that was
explained above, the 'examine' option here reads sectors from
the first track and calculates the number of sectors per track
by substracting one from the first sector that it cannot read
due to it not being present (not formatted) in the first place.
7.4 HOW MANY SIDES
Due to one of the more ancient Atari cock-ups, the Atari
community is stuck with the phenomenon of the single-sided disk
drive (the old SF 354). Although virtually nobody has these
drives any more, occasional software titles are still being
supplied on single sided disks - or sometimes a disk may just be
formatted single-sided because it's quicker, who knows?
Anyway, even though the chances of a disk being double-sided are
bigger for certain, there is no way to be sure whether a disk has
one side or two unless you just happen to know (again, it may be
useful to write down the amount of sides on your disk labels).
In general, most older (pre-1989) original disks with software
are single-sided, and all other disks are double-sided. If you
are not sure, you can use the 'Examine' option here again,
but it has the obvious drawback mentioned several times above:
If a disk is single-sided but has been formatted double-sided
prior to the latest format, the "Ultimate Virus Killer" will
assume it's double-sided. The 'examine' option just tries to read
a sector from the second side and assumes a disk is double-sided
when this process happens without a read error occurring.
Disks that have only been used on the Falcon or a TT will almost
certainly have two sides.
7.5 HOW MANY SECTORS PER CLUSTER
The amount of sectors per cluster (a cluster is also called an
allocation unit) is always 2, except when the disk you're trying
to repair is a single-sided disk with 40 tracks (these are
created and used by rather ancient MS-DOS-type machines). It is
supposed to be impossible to use other values here, but for the
sake of future compatibility it has been included anyway.
In short, you should most likely specify 2 here, as Atari
ST/TT/Falcon floppy disks always use 2 sectors (1 Kb) for one
cluster.
7.6 HOW MANY FATS ON THE DISK
The FAT (short for File Allocation Table) is the space on disk
where the Operating System stores and gets information about
which clusters on the disk are used by files (and which are not)
and in which particular sequence clusters have to be put together
in order to load a file bigger than one cluster that is not
stored contiguously (i.e. a fragmented file).
TOS maintains two FATs on a disk - one of these is always
present as a temporary backup. It is not certain whether or not
it is possible to use disks with only one FAT - some formatting
programs seem to allow for it, but the aforementioned Claus Brod
denies it categorically.
You should most likely specify 2 here.
7.7 HOW MANY DIRECTORY ENTRIES
The directory is list on a disk where the names, lengths and
other characteristics of individual files and folders on that
disk are stored. The particular parameter discussed here pertains
to the root directory, i.e. the directory that appears first when
you display the contents ("Open...") of a floppy disk drive or
hard disk partition. The longer the directory, the less space is
left on the disk. Usually the directory takes up the entire
second track of a disk.
Most disks have 112 potential directory entries, but single-
sided disks with 40 tracks (the ones we also encountered above,
that are used by rather ancient MS-DOS systems) have only 64 of
them. Formatting programs such as "FastCopy" allow for even less
entries, but these are not usually encountered quite often and,
according to Claus Brod, can lead to obscure things going wrong.
7.8 HOW MANY SECTORS PER FAT ENTRY
The FAT table is built up of several hundreds of entries, and
it is possible to specify how many sectors ('allocation units')
are included in one entry here. There is a 100% full-proof way
to have it checked by the "Ultimate Virus Killer" itself, so you
should specify 'Examine' here unless, for some reason or other,
you are sure about selecting either '1', '2', '3' or '5' (which
is rather unlikely to say the least).
7.9 A NOTE ON DISKS WITH BUSTED BIOS PARAMETER BLOCKS
In by far most of all cases disks with damaged BIOS Parameter
Blocks are not infected by a virus, nor do they suffer from any
remaining parts of mutant viruses. It is quite usual for game
data disks (any disk belonging to a game that you don't actually
have to start up with - i.e. game disks labelled 2, 3, B, C,
whatever) to use some sort of exotic disk format, whereas many
also don't really bother about writing a BIOS Parameter Block at
all and instead use even the bootsector to store graphics or
other game data.
'Repairing' the BPB of one of these disks will most likely prove
lethal for that piece of software! In any case you should write a
bootfile prior to any attempt at repairing them, if you really
want to.