You are on page 1of 10

DOS DEVICE DRIVERS

BTCS-703
Introduction

 Device drivers are sets of procedures that are used to


communicate with the hardware on the computer.
 The task performed by device drivers is in this respect similar
to software interrupts. However, while each interrupt routine
has a different calling strategy, all device drivers have a
standard method of operation.
 This makes it possible to write programs that interface with
arbitrary devices, either monitor, printer or disk drives.
 Device drivers are not like normal programs since they
cannot be run from the DOS command line. Instead they
must be loaded in the CONFIG.SYS file at boot-up time using
a device command.
MS-DOS DEVICE DRIVERS
DOS has a number of built-in drivers to communicate with
the console (keyboard+screen), printer, disk-drives, etc. The
device drivers are given specific names.

Built-In Drivers:
Name of Device Name of Driver
Console CON:
Printer LPT1:LPT2:LPT3:
Serial Ports COM!:COM2:COM3:COM4:
Null device NUL:
Disk drive A A:
Disk drive B B:
Disk drive C C:
Usage of device drivers

 When the programmer uses DOS interrupt


calls, the relevant device drivers are
automatically used.
 File commands can access just about any
device but the more specific commands use
particular devices.
 The screen output DOS commands explicity
use the CON: device while the printer output
DOS commands probably use the PRN:
Loading device drivers

 Device drivers are loaded in memory in the


order in which they are encountered in
CONFIG.SYS.
 DOS maintains a linked list of these drivers,
with new drivers being added to the head of
the list. When a device driver is accessed, the
list is searched from the head. The latest
driver is found first and is subsequently used.
MS-DOS DEVICE DRIVERS TYPES

Block Device Drivers


Character Device Drivers
• Character Device Drivers: one character
or byte at a time for i/o data
transfer
 Single h/w unit support
 Application program accessibility-
By name
By function calls
By using default handles

• Block Device Drivers: Data transfer


fixed or variable blocks/chunks
 Controls random/non random mass storage
devices.
 Two or more h/w unit support
STRUCTURE OF MS-DOS DEVICE DRIVERS
MS – DOS Device Driver Structure
Initialization
Media Check
Build BPB
I/O Control Read and Write
Status
Read

Interrupt Write, Write/Verify


Output until Busy

Header Flash Buffers


Device open
Device Close
Check whether Removable
Generic IOCTL
Get/set Logical Device
Various MS-DOS Device Drivers

ANSI.SYS HIMEM.SYS
EGA.SYS SETVER.EXE
PRINTER.SYS DISPLAY.SYS
INTERLINK.EXE
CHKSTATE.SYS
SMARTDRV.EXE
EMM384.SYS DRIVER.SYS
RAMDRIVE.SYS POWER.EXE
DBLSPACE.SYS SMARTDRV.SYS
Usage of Device Drivers
 ANSI.SYS: Provides Screen customization (includes
coloring and extending) and keyboard functions .
 SETVER.EXE: Includes an label from CONFIG.SYS that
device drivers read while booting the system.
 SMARTDRV.SYS: establishes the disk cache
 RAMDRIVE.SYS: Allows portion of m/y as disk
 MOUSE.SYS is device driver for mouse installed in CONFIG.SYS file
 Screen output DOS commands explicitly use CON:
 Printer output DOS commands use the PRN: or
 ANSI.SYS allows DOS user to move cursor, screen optimization and color
setting etc.
Loading Device Drivers
Device Drivers are loaded in m/y in the order they appear
in COFIG.SYS
DOS maintain Linked list of these drivers .
New Driver added at the head of list.

You might also like