8272 COMMANDS

Tge 8272 can execute 15 different commands. Eoach of these commands is sent to the data register in the controller as a serieas of bytes. Consult an 8272 data sheet to find the formats for these commands if you need them. After a command has been sent to the 8272, it carries out the command, and returns the results to status registers in the 8272, an/or to the data register in the 8272. To give you an overview of the commands you get to send to an 8272, we list then here with a shot description of each.

SPECIFY Initialize head load time, head step time, DMA/non-DMA
SENSE DRIVE STATUS Return drive status information
SENSE INTERRUPT STATUS Poll th 8272 interrupt signal
SEEK Position read/write head over specified track
RECALIBRATE Position head over track 0
FORMAT TRACK Write ID field, gaps, and addresses marks on track
READ DATA Load head, read spcified amount of data from sector
READ DELETED DATA Read data from sectors marked as deleted
WRITE DATA Load head, write data to specified sector
WRITE DELETED DATA Write deleted data address mark in sector
READ TRACK Load head, read all sectors on track
READ ID Return first ID field found on track
SCAN EQUAL Compare sector of data bytes read from disk with data bytes sent from CPU or DMA controller until struiings match. Set bit in status register if match
SCAN HIGH OR EQUAL Set flag if data string from disk sector greater then or equal to dat string from CPU or DMA controller
SCAN LOW OR EQUAL Set flag if data string from disk sector is less than or equal to data string from CPU or DMA controller

Working out a series of commands for a disk controller such as the 8272 on a bit-by-bit basis is quite tedious and time-consuming. Fortunately, you usually don't have to do this, because in most systems, you can use higher level procedures to read from an write to a disk. In the next section we show you some of the software used to interface to disk drives.


DISK DIRECTORY STRUCTURE

The directory on the disk contains a 32-byte entry for each file. Let's take a quick look at the use of these bytes to gen an overviewof the information stored for each file.

Byte number (dec) description
0-7 Filename
8-10 Filename extension
11

File attribute
01h - read only
02h - hidden file
04h - system file
08h - volume label in first 11 bytes, not filename
10h - file is a subdirectory of files in lower level of hierarchical file tree
20h - file has been writted to an closed

12-21 Reservd
22-23 Time the file was created or last updated
24-25 Date the file was created or last updated
26-27 Starting cluster number - DOS allocates space for files in clustes of one or more adjacent sectors in size
28-31 Size of the file in bytes

DOS uses the first file allocation table or FAT to keep track of which clusters on a disk are currently being used for each file, and which clustes are stull available.