Atari ST series Technical Reference Manual page 30

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

This information tells you how much storage space is on
the disk and how it's allocated. GEMDOS performs a
Getbpb() operation when it first accesses a drive, or when it
accesses a drive after a media change. For more information.
on disk organization and the file system, see Chapter 6.
Perhaps the most important of the BIOS disk functions
allows you to read or write disk sectors. This function is
used mainly by the disk operating system. Since it operates
at a lower level than the filing system, you probably won't
use it unless you're writing a disk sector editor, or something
equally exotic. The macro for this function is called Rwabs
(for Read Write ABSolute), and it's called as follows:
int mode, sectors, start, drivenum;
long buffer, status;
status = Rwabs(mode, buffer, sectors, start, drivenum);
Mode is a flag that indicates whether you wish to read or
write sectors to the disk. The valid mode numbers are
Mode
Number
0
Read sectors
1
Write sectors
2
Read sectors without affecting media change status
3
Write sectors without affecting media change status
Buffer is a pointer to the memory area where the trans­
ferred data is stored. The size of this area depends on the
number of sectors to be transferred, which is stored in the
variable named sectors. Allocate 512 bytes for each sector.
Since the data transfer will proceed very slowly if the
buffer area starts at an odd address, you should ensure that
it starts at an even address by declaring the buffer variable as
an array of words (ints). The start variable is used to indicate
the starting sector from which to read or to which to write.
The drivenum parameter specifies the disk drive to use
(0 = drive A:, 1 = drive B:, and so on). When the function
call concludes, the status variable will be 0 if the operation
was successful. A negative number indicates an error has oc­
curred. See Appendix D for the list of GEMDOS error mes­
sages.
The last of the BIOS disk functions is used by the disk
operating system to determine whether a disk has been
22
CHAPTER 2
Description

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents