Академический Документы
Профессиональный Документы
Культура Документы
IOCTL Functions IOCTL functions are used to control I/O devices. IOCTL do not mean Transfer Of Data. Data transfer can take place through DOS or BIOS or Drivers.
Types of Devices
Devices are classified in Two Types
Split view
Character Devices They are controlled in either Binary or ASCII mode by IOCTL functions. They are named using DOS conventions. They are opened with file open function3DH.
Name
AUX CLOCK$ COM1 COM2 COM3 COM4 CON EMMXXXX0 LPT1 LPT2 LPT3 LPT4 NUL PRN XMSXXXX0
Device
The COM1 Device in most systems The real time system clock Serial communications port number 1 Serial communications port number 2 Serial communications port number 3 Serial communications port number 4 Console, the keyboard for Input and the video display for output The expanded memory manager EMM386.EXE Parallel Port Number 1 Parallel Port Number 2 Parallel Port Number 3 Parallel Port Number 4 A Nonexistent Device LPT1 in Most systems The Extended Memory Manager HIMEM.SYS
Block Devices
Block Devices transfer information block at a time They are indicated using numbers.
Device Driver
Special programs installed by CONFIG.SYS to control installable devices. Used for the newly added device It is a .COM file ( TINY model )
DEVICE DRIVER
Device Driver
Header
Strategy Procedure
Interrupt procedure
Interrupt procedure
Strategy procedure
0012H
Header
Attribute Driver linkage
HEADER Contains pointers that allow it to chain to other drivers loaded in the system. First doubleword (-1) informs that this is last driver in chain. It is followed by attribute word, which indicates type of header included for driver and type of device the driver installs.
Strategy Procedure It is called whenever device driver is loaded in to memory or whenever I/O requests are issued.
Its main purpose is to save the Request header and its address. Return Status Word Communicates information back to DOS from Device Driver.
Device Driver Commands in Request Header By DOS Command 00H 01H 02H 03H 04H 05H 06H 07H 08H 09H 0AH 0BH 0CH 0DH 0EH 0FH 10H 13H 17H 18H 19H Purpose Initialize Driver Media Check Build BPB (Block Device Parameter Block) Control Read Read Non destructive Read Input StatusInput Status Input FlushInput Flush WriteWrite Write with verifyWrite with verify Output StatusOutput Status Output FlushOutput Flush Control writeControl write Open DeviceOpen Device Close DeviceClose Device Removable MediaRemovable Media Output until BusyOutput until Busy Generic IOCTLGeneric IOCTL Get logical DeviceGet logical Device Set logical DeviceSet logical Device IOCTL QueryIOCTL Query
INTERRUPT PROCEDRE It uses request header to determine the function requested by DOS. It performs all functions for Device Driver Interrupt Procedure is different from Interrupt Handler.