DISKMANIPULATION ON THE ATARI SF DISK DRIVES PART I
by Richard Karsmakers
Published originally in ST NEWS Volume 1 Issue 2, launched on
August 9th, 1986.
On of the most fascinating things to do with computers is
communicating with external devices. These can be robots,
miniature trains, other computer systems or disk drives. To
communicate with most of these devices requires additional
hardware, and some knowledge about how to communicate with them.
Since most people have a disk drive with their ST's, one really
cannot say that it is an additional device, and the knowledge
needed is also fairly limited. So the disk drive turns out to be
one of the easiest external devices to communicate with. That's
what makes disk manipulating so interesting. With a little
experience you might even be able to manipulate text strings in a
program or data file, or even translate complete programs (what
about a custom TOS or so?). In this article I will try to explain
some of the basics of disk manipulating, to enable everyone to do
simple disk manipulations. But look out, however, because
manipulating disks can cause damage to your data!
The first thing you must know, is how diskettes are devided in
parts. On a regular formatted single sided disk, there are 80
tracks (numbered from 0 to 79 from the outside to the inside),
that are split up into 9 sectors (numbered from 1 to 9) each. The
Operating System treats two sectors as a so called cluster.
Somewhere on a disk is a space reserved for the Operating System
to use to determine which clusters are used and which clusters
aren't. The space that is reserved therefore is located on the
first track of the disk, and is called FAT, which is short for
File Allocation Table. In each entry in the FAT there are values
that determine whether a block is used, unused of damaged (bad
data medium). When it is used, it contains the value that points
to the next cluster that is used by the file, or a value that
determines the "last cluster in a file". More about specific
values later.
The other part of a diskette that is usually very important, is
the list of files included on it, called the directory. It
contains information about file location, file size, date/time on
which the file was created and file type. It is quite difficult to
manipulate the directory, because the TOS uses calculations on
bit-level instead of byte level. More about that later.
Another part of the disk that is very important to the operating
system is track 0 sector 1: the boot sector. It contains
information about cluster size, density, number of sectors per
track, number of sides per disk, etc. It might even contain a
small machine language program (boot code) to read in a program
after system RESET (this is done on the original version of
Brataccas). The boot sector is MS/DOS V2.x compatible, and it
makes the ST computer system very flexible. It is even possible to
put the directory on another place on the disk, to redefine
cluster size, redefine sector size, etc. In theory the ST disk
drive can read any boot-sector compatible 3,5" disk with between 1
and 83 tracks, that may each have between 1 and 11 sectors. Some
disk drives (like the ones of many 1040 ST's) might have alignment
problems so that tracks with number 80 to 82 cannot be read
properly. And nearly all disk drives have problems when using a
disk with more than 10 sectors per track. A very nice program to
experiment with these values is "820 KB Format" from Sputnik-
Horror soft. You can redefine even the number of directory
entries!
In the next issue of ST NEWS I will explain more about exact
values, positions, etc., and I will tell you how to produce your
first successful disk manipulations. If you think you have had
very nice/nasty experiences with disk manipulating, please contact
me as soon as possible....
Disclaimer
The text of the articles is identical to the originals like they appeared
in old ST NEWS issues. Please take into consideration that the author(s)
was (were) a lot younger and less responsible back then. So bad jokes,
bad English, youthful arrogance, insults, bravura, over-crediting and
tastelessness should be taken with at least a grain of salt. Any contact
and/or payment information, as well as deadlines/release dates of any
kind should be regarded as outdated. Due to the fact that these pages are
not actually contained in an Atari executable here, references to scroll
texts, featured demo screens and hidden articles may also be irrelevant.