Atari ST series Technical Reference Manual page 58

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

int status devnum, secnum, tracknum, sidenum, numsecs;
long buf, resvd;
status = Flopwr(buf, resvd, devnum, secnum tracknum,
sidenum, numsecs);
where buf contains the address of a buffer that contains the
data for one or more sequential sectors in a track. Resvd is a
longword reserved for future use, which is currently ignored,
but must be present. Devnum refers to the drive (0 = drive
A:, 1 = drive B:). Secnum is the sector number at which to
begin writing (ordinarily sectors are numbered 1-9). Track­
num is the number of the disk track, and sidenum the side of
the disk to write to (0 or 1). Numsecs is the number of se­
quential sectors of data to write.
An error code is returned in status. If the status is 0, the
operation was successful. Any other return represents a sys­
tem error. For information on system errors codes, see Ap­
pendix D.
The final step in formatting a disk is to create a boot sec­
tor. This is a specially formatted block of information that is
stored on the first sector on the disk (side 0, track 0, sector 1).
It gives information about the disk storage format to the file
system. You can create the block of information to be written
to the boot sector using the Protobt() routine, which has the
following syntax:
int disktype, execflag;
long buffer, serialnum;
Protobt(buffer, serialnum, disktype, execflag);
where buffer contains the address of a 512-byte memory
buffer where the boot block information will be created. Ser­
ialnum is a unique identifier code the file system uses to tell
whether disks have been changed in a particular drive. Since
each disk should have its own unique 24-bit number, pass a
random number here. If you don't want to bother to gener­
ate a random number, the system will do it for you if you
just pass a number larger than 24 bits ($1000000 or greater).
The next parameter, disktype, is a code word that specifies
the storage capacity and format of the disk. Possible values
for disktype are:
50
CHAPTER 3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents