EasyManua.ls Logo

Atari ST series - Page 29

Atari ST series
420 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
BIOS
so on up to bit 15, which corresponds to drive P (the current
version of the ST operating system only recognizes 16
drives). If the bit that corresponds to a drive is set to 1, that
drive is connected, otherwise, it is unavailable. The value reî™…
turned by Drvmap is the same one stored in the system variî™…
able
__drvbits, at memory location 1220 ($4C4). Note that if
even one floppy is connected, both bits 0 and 1 are always
set to 1. If drive A: is connected, the system will also use it
as a logical drive B:, if no physical drive B: is present.
Once you've found which drives are connected, you can
find more information about the layout of a particular disk
by reading the BIOS Parameter Block in its boot sector.
Getbpb() is the function used to find the address of the Paî™…
rameter Block and it's called like this:
int drivenum;
long blockaddr;
blockaddr = Getbpb(drivenum);
where drivenum is the number of the drive whose BIOS Paî™…
rameter Block you wish to find (0 = drive A:, 1 = drive B:,
and so on). The starting address of the BIOS Parameter Block
is returned in blockaddr. The data structure pointed to by
blockaddr consists of nine words of data. The structure eleî™…
ments are as shown in Table 2-4.
Table 2-4. Parameter Block Structure Elements
Element
Description
Number of bytes per sector (must be 512 under
current GEMDOS)
Number of sectors per cluster (must be two
under current GEMDOS)
Number of bytes per cluster (must be 1024
under current GEMDOS)
Root directory length (in sectors)
File Allocation Table (FAT) size (in sectors)
Sector number of the start of second FAT
Sector number of the first data cluster
Number of data clusters on the disk
Bit flags*
* Currently only bit 0 is used. When set, it indicates 16-bit FAT entries instead of
the usual 12-bit entries.
mber
Name
0 recsiz
1 clsiz
2 clsizb
3
rdlen
4
fsiz
5 fatrec
6
datrec
7 numcl
8 bflags
21

Related product manuals