|
| |
TYPES OF DEVICES
There are two types of devices: Character devices and Block
devices. Their attributes are as follows:
Character devices are designed to do character I/O in a serial
manner like CON, AUX, and PRN. These devices have names like CON,
AUX, CLOCK$, and you can open channels (handles or FCBs) to do
input and output with them. Because character devices have only
one name, they can only support one device.
Block devices are the fixed disk or diskette drives on a system.
They can do random I/O in peices called blocks, which are usually
the physical sector size of the disk. These devices are not named
as character devices are, and cannot be opened directly. Instead
they are mapped by using the drive letters A,B,C etc. Block
devices can have units within them. In this way, a single block
driver can be responsible for one or more disk drives. For
example, the first block device driver can be responsible for
drives A,B,C,and D. This means it has four units defined and
therefore takes up four drive letters. The position of the driver
in the chain of all drives determines the way in which the drive
letters correspond. For example, if the device driver is the
first block driver in the device chain, and it defines four
units, then these devices are called A,B,C, and D. If the second
device driver defines three units, then those units are E,F,and
G. DOS 1.x allows 16 devices. DOS 2.x allows 63, and DOS 3.x
allows 26. It is recommended that drivers limit themselves to 26
devices for compatibility with DOS 3.x.
DOS doesn't care about the position of installed character
devices versus block devices. The installed character devices get
put into the chain ahead of resident character devices so that
you can override the system's default driver for CON etc.
Although it is sometimes beleived that installed block devices
get linked into the chain BEHIND the resident block devices, if
you look at the actual device chain, this is not true (though it
is true in the sense that installed block devices get assigned
drive letters in sequence, starting with the next letter after
the last one assigned to a resident block device). |