Atari ST series Technical Reference Manual page 57

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

XBIOS Device and System Functions
Atari format calls for nine sectors per track. The Atari drives
may reliably read and write ten sectors per track, however,
and many users prefer format programs that use this value
to expand each floppy disk's storage from 360K (720K double
sided) to 400K (800K double sided).
The tracknum variable is used to specify the track number
to be formatted. The normal Atari format uses track 0-79,
though it's technically possible to use track 80 and sometimes
even track 81. The sidenum variable is used for the side of the
disk to format. Single-sided drives only use side 0, while
double-sided drives use both 0 and 1.
The next parameter, intrlev, is a sector interleave format.
In the old TOS ROMs, this is set to 1, but the new TOS for­
mat routines use a - 1 to indicate sector skewing, as ex­
plained above. The magic parameter must be set to the num­
ber $87654321 for the format to work. Finally, initial is a 16-
bit value to which all of the data bytes in a sector are initially
set. Atari advises against the use of $0000 and recommends
an initial value of $E5E5. In any case, the high nibble of each
byte in this parameter must not equal $F.
On return from Flopfmt(), the status parameter holds a
status code. If there were no errors in formatting the track,
its value will be 0. Any other code represents an error num­
ber, which indicates that the format operation failed. If the
format fails due to sectors that could not be verified, a list of
the bad sectors is returned in the buffer. This list consists of
a string of 16-bit numbers, each representing a sector number
(tracks start with sector 1) and terminated with a 0. This list
is not necessarily in consecutive sequence. When a format
operation fails, the format program may try to format the
track again. If the format still fails after a couple of retries,
the format program should note the bad sectors, and mark
them as used in the File Allocation Table so the file system
will not try to use these sectors. The exception to this is the
first two tracks, which are used for the File Allocation Table
and directory sectors. If any of the sectors in these tracks are
bad, the media is unusable and formatting should be termi­
nated.
Next, fill the sectors in the first two tracks with zeros.
This initializes the File Allocation Table and directory. To
write one or more sectors to a disk track, use the Flopwr()
function:
49

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents