Appendix I: Devices - AED62(DEV)
NAME
aed62 - double density floppy disk
SYNOPSIS
DCT aed62
setdct("aed62", 0170, 0170450, 0170450,
aedini, aedsio, aedint, 0);
DESCRIPTION
The Double Density disks contain 77 tracks numbered from 0 to 76. There are 16 sectors (sometimes called blocks) per track, for a total of 1232 sectors on each side of the disk. These are numbered 0 to 1231. Each sector contains 512 bytes, for a total of 630,784 bytes on each side of the floppy.
Only one side of the floppy can be accessed at a time. There is only one head per drive, and it is located on the under-side of the disk. To access the other side, the disk must be manually removed and inserted the other way up.
Each block is actually two blocks on the disk: an adddress ID block and the data block. The address ID block is used by the hardware and contains the track number, the block number and the size of the data block that follows. When an operation is to take place, the seek mechanism first locates the block by reading the address ID blocks and literally 'hunting' for the correct one. It will hunt for up to 2 seconds before reporting a failure.
Both the address ID and the data blocks are followed by a checksum word that is maintained by the hardware and is hid-den from the user. On writing, the checksum is calculated and appended to the block. On reading it is verified (both on reading the ID and data blocks) and any error is reported as a Data Check. No checking on the data block takes place on a write, and the hardware has no idea if it was written correctly. The only way to verify it is to read it.
Although there are two drives in the unit, they cannot be used simultaneously. If an operation is in progress on one, no access can be made to the other until the first operation is complete. The driver will queue requests for both drives however, and ensure that are performed in order.
The MOS driver is called aed62.obj. It operates on the fol-lowing IORB entries:
irfnc
The operation to be performed, as follows:
0 - Read
1 - Write
2 - Verify
3 - Seek
Read and Write cause data to be transferred to and from disk. Verify does a hardware read without transferring the data to memory and is used for verifying that the data can be successfully read. The checksum at the end of the block of each sector is verified by the hardware. The seek command is used to move the disk heads to a specified track.
irusr1
The drive number. Only Zero or One is accepted. This is matched against the number dialed on the drive. If the number is specified on both drives, or neither, a hardware error will be reported.
irusr2
The Sector or Block Number. Must be in the range 0 to 1231 inclusive. irusr2 specifies the block number that the transfer is to begin at for Read and Write, the be-ginning of the verified area for the Verify command, and the position of the head for the Seek command. In the latter case the head will be positioned to the track that contains the block.
iruva
This specifies the data adress, which must be even (word boundary). If an odd address is given, the low order bit is set to zero to make it even. Not required for the Seek or Verify commands.
irbr
Transfer length as a positive number of bytes. Not re-quired for the seek command, bit IS used by Verify com-mand so that the correct number of blocks may be veri-fied. The disk is only capable of transferring an even number of bytes. If an odd length is given the low ord-er bit is made zero to reduce the length to the lower even value. The length is NOT restricted to the sector size of 512 bytes. If the length is greater than 512, successive blocks are read/written until the required transfer length has been satisfied. If the length is not an ex-act multiple of 512 bytes, only the specified length will be read/written. Note that the hardware always reads and writes a complete sector, so specifying a shorter length on a read will cause the remainder of the block to be skipped. On a write, the hardware will repeat the last specified word until the sector is full.
The driver will attempt to recover from all soft errors. There is no automatic write/read verify as on mag tapes, so that data that is incorrectly written will not be detected as such until a read is attempted. For this reason, the ver-ify feature can be used (see above) to force the checking of written data. When an error is detected while performing a read, the offending block will be re-read up to 16 times and disk resets will be attempted during this time too. If all fails a hardware error indication is returned to the user. Other errors possible are Protection Error (attempt to write to a read-only disk) and User Error, which indicates that the parameters in the IORB were incorrect. Errors such as there being no disk loaded, or the drive door being open are NOT detectable by the program. The interface sees these as Seek Errors (i.e. soft errors), and thus the driver will re-try several times before returning a Hardware Error indica-tion to the user. It should be noted that error recovery can take a long time. As mentioned above, there is a 2 second delay before a seek error is reported by the hardware, for instance.