home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Don Maslin Archive
/
maslin_archive.zip
/
AARDVARK_Tape_Backups
/
maslin_c_d_3oct95
/
ddrive
/
dw
/
dws
/
int13.doc
< prev
next >
Wrap
Text File
|
1989-09-26
|
13KB
|
376 lines
CompatiCard IV BIOS Notes -- Version 1.01 -- September 26, 1989
The following information is provided for programmers that need
to access diskettes sectors directly. This information is
provided with no technical support for use by qualified
programmers. They are similar in function to the routines
provided by the system BIOS which you should be familiar with.
Any comments or suggestions should put in writing and sent Attn:
Software Engineering. Reasonable requests for additional
functions may be incorporated into future versions.
CompatiCard IV BIOS Interrupt 13h Specifications
These functions are provided by the CompatiCard IV BIOS (either
ROM or CC4BIOS.SYS) when properly installed. The CompatiCard IV
functions are similar to the system BIOS functions provided for
floppy diskette I/O. When an interrupt 13h function is
requested, the CompatiCard IV BIOS will look at the physical
drive address specified and it will only process requests with
valid addresses. An address is valid if it was defined as a
drive using the DIP switches or when specified in the CC4DRV.SYS
line of the CONFIG.SYS file. Any interrupt 13h requests that do
not contain valid addresses will be ignored and passed to the
system BIOS for processing.
Most of the functions return an error code in the AH register
upon completion. In addition, the carry flag (CY) will be set if
the error code returned in AH is non-zero. The error codes are
defined as follows:
AH = 00h successful completion of operation
80h diskette drive was not ready
40h seek failure
20h general controller failure
10h data error (CRC) on diskette
09h attempt to DMA across 64K boundary
08h DMA overrun
04h sector not found
03h write protect error
02h address mark not found
01h bad command passed to driver
Some of the functions reference parameters that are kept in the
BIOS diskette drive parameter table. The table is pointed to by
INT 1eh (0:78h). The layout of the table is as follows:
Offset Size Description
0 byte not used
1 byte not used
2 byte Number of timer ticks to keep motor on
3 byte bytes per sector (0=128, 1=256, 2=512, &
3=1024)
4 byte number of sectors on a track (used only by
the FORMAT function)
5 byte read/write/verify gap length
6 byte not used
7 byte format gap length
8 byte format fill byte
9 byte head settle time (in milliseconds)
10 byte motor startup time (in 1/8 seconds)
If your program needs to alter any of these parameters from their
original values, you should copy the original table to a scratch
area and re-point INT 1eh to the scratch area. The alterations
should be made to your copy of the table and not the original.
Before your program terminates, you must restore INT 1eh back to
the original table.
Functions:
0 - reset disk system
This function can be called after a disk error. It is
not required because the CompatiCard IV BIOS will
automatically perform a reset when needed.
Entry:
AH = 0
DL = physical drive address (0-15)
Exit:
CY = 0 if no error
CY = 1 if error
AH = error code
1 - Get I/O error code from last operation
This function will return the status code from the last
I/O operation performed on the drive.
Entry:
AH = 1
DL = physical drive address (0-15)
Exit:
CY = 0 if no error
CY = 1 if error
AH = error code
2 - Read sectors
This function is used to read from a diskette. It can
be used to read more than 1 sector but all of the
sectors to be read must be on the same track.
Entry:
AH = 2
AL = number of sectors to read (1-n)
ES:BX = address of buffer
CH = cylinder (0-n)
CL = sector number
DH = head (0-1)
DL = physical drive address (0-15)
Exit:
CY = 0 if no error
CY = 1 if error
AH = error code
AL = number of sectors successfully read
Note: Sector size, motor on time, motor startup time,
head settle time, and gap length are obtained from the
BIOS diskette drive parameter table.
3 - Write sectors
This function is used to write to a diskette. It can
be used to write more than 1 sector but all of the
sectors to be written must be on the same track.
Entry:
AH = 3
AL = number of sectors to write (1-n)
ES:BX = address of buffer
CH = cylinder (0-n)
CL = sector number
DH = head (0-1)
DL = physical drive address (0-15)
Exit:
CY = 0 if no error
CY = 1 if error
AH = error code
AL = number of sectors successfully written
Note: Sector size, motor on time, motor startup time,
head settle time, and gap length are obtained from the
BIOS diskette drive parameter table.
4 - Verify sectors
This function is used to verify sectors from a
diskette. It can be used to verify more than 1 sector
but all of the sectors to be verified must be on the
same track.
Entry:
AH = 4
AL = number of sectors to verify (1-n)
CH = cylinder (0-n)
CL = sector number
DH = head (0-1)
DL = physical drive address (0-15)
Exit:
CY = 0 if no error
CY = 1 if error
AH = error code
AL = number of sectors successfully verified
Note: Sector size, motor on time, motor startup time,
head settle time, and gap length are obtained from the
BIOS diskette drive parameter table.
5 - Format track
This function is used to format a track on a diskette.
Entry:
AH = 5
ES:BX = ptr to buffer containing sector information
CH = cylinder (0-n)
DH = head (0-1)
DL = physical drive address (0-15)
Exit:
CY = 0 if no error
CY = 1 if error
AH = error code
Note: Sector size, format gap length, number of sectors
to format, and fill byte are obtained from the BIOS
diskette drive parameter table.
The sector information required for formatting is a
collection of four byte address fields. There should
be one address field per sector being formatted. Each
field is made up of four bytes, (C, H, R, N), where
C=track number, H=head number, R=sector number, and
N=number of bytes per sector (0=128, 1=256, 2=512, and
3=1024).
8 - Return drive parameters
This function is used to return some parameters about
the specified drive.
Entry:
AH = 8
DL = physical drive address (0-15)
Exit:
CY = 0 if no error
AX = 0
BL - bits 7 to 4 = 0
bits 3 to 0 - drive type
0 = other type
1 = 360KB
2 = 1.2MB
3 = 720KB
4 = 1.44MB
BH = 0
CL = maximum sectors per track
CH = maximum number of cylinders
DL = number of primary drives installed
DH = maximum head number
ES:DI = pointer to 11 byte diskette drive parameter
table associated with the maximum supported
media type for the drive specified
CY = 1 if error
AH = error code
9 - Set CompatiCard parameters
This function is used to set parameters for a diskette
drive. Each physical drive get its own set of
parameters which are retained unless they are changed
using function 9 or DOS is re-booted.
Entry:
AH = 9
AL = number of retries after I/O error (0-255)
CH = double step flag (0=single step and 1=double
step)
CL = density (0=SD, 1=DD, 2=HD, and 3=ED)
DL = physical drive address (0-15)
Exit:
CY = 0 if no error
CY = 1 if error
AH = error code
10 - Return CompatiCard parameters
This function is used to return the parameters which
are currently set for a drive. Since each drive gets
its own set of parameters, this function can return
different parameters according to the physical drive
address specified.
Entry:
AH = 10
DL = physical drive address (0-15)
Exit:
CY = 0 if no error
AL = number of retries after I/O error (0-255)
CL = density (0=SD, 1=DD, 2=HD, and 3=ED)
CH = double step flag (0=single step and 1=double
step)
BL = diskette drive type (0-9)
BH = step rate (in milliseconds)
ES is altered on exit
CY = 1 if error
AH = error code
11 - Return next sector ID
This function is used to return the next sector ID read
from the diskette.
Entry:
AH = 11
CH = cylinder (0-n)
CL = density (0=SD, 1=DD, 2=HD, and 3=ED)
DH = head (0-1)
DL = physical drive address (0-15)
Exit:
CY = 0 if no error
AL = sector size (0=128, 1=256, ...)
CL = sector number
CH = cylinder number
DH = side
CY = 1 if error
AH = error code
21 - Read DASD Type
This function is used to return change line
availability information.
Entry:
AH = 21
DL = physical drive address (0-15)
Exit:
CY = 0 if no error
AL = 0 drive not defined
1 no change line
2 change line is available
CY = 1 if error
AH = error code
22 - Return change line status
This function is used to return change line
status information.
Entry:
AH = 22
DL = physical drive address (0-15)
Exit:
CY = 0 if AH = 0
CY = 1 if AH not 0
AH = 0 change signal not active
6 change signal active
23 - Set DASD type for format
This function is used to set some parameters before a
format operation. This function is provided for system
BIOS compatibility. The use of function 9 is preferred
for new programs.
Entry:
AH = 23
AL = 1 360KB diskette in 360KB drive
2 360KB diskette in 1.2MB drive
3 1.2MB diskette in 1.2MB drive
4 720KB diskette in 720KB drive
DL = physical drive address (0-15)
Exit:
CY = 0 if no error
CY = 1 if error
AH = error code
24 - Set media type for format
This function is used to set some parameters before a
format operation. This function is provided for system
BIOS compatibility. The use of function 9 is preferred
for new programs.
Entry:
AH = 24
CL = number of sectors per track
CH = number of cylinders
DL = physical drive address (0-15)
Exit:
ES:DI = pointer to 11 byte diskette drive parameter
table associated with the specified media
type
CY = 0 if error code is 0
CY = 1 if error code is not 0
AH = error code