Presentation is loading. Please wait.

Presentation is loading. Please wait.

MS DOS Device Drivers Sources of Information Device driver basics Structure and internal routines Sources of Information Device driver basics Structure.

Similar presentations


Presentation on theme: "MS DOS Device Drivers Sources of Information Device driver basics Structure and internal routines Sources of Information Device driver basics Structure."— Presentation transcript:

1 MS DOS Device Drivers Sources of Information Device driver basics Structure and internal routines Sources of Information Device driver basics Structure and internal routines

2 Sources of information John Angermeyer and Kevin Jaeger, MS-DOS Developers Guide, Howard W. Sams, Indianapolis, 1986 Ray Duncan, Advanced MS-DOS, Microsoft Press, Redmond, Washington, 1986 Robert Lai, Writing MS-DOS Device Drivers, Addison- Wesley, Reading, Massachusetts, 1992 John Angermeyer and Kevin Jaeger, MS-DOS Developers Guide, Howard W. Sams, Indianapolis, 1986 Ray Duncan, Advanced MS-DOS, Microsoft Press, Redmond, Washington, 1986 Robert Lai, Writing MS-DOS Device Drivers, Addison- Wesley, Reading, Massachusetts, 1992

3 Device driver basics Operating System modules that control hw Isolate higher levels from hw specifics Standard interface with OS Installable at boot time as a chain (CONFIG.SYS) Not necessary to modify the OS Similar to Unix/Xenix/Linux device drivers Two types: Block and Character Operating System modules that control hw Isolate higher levels from hw specifics Standard interface with OS Installable at boot time as a chain (CONFIG.SYS) Not necessary to modify the OS Similar to Unix/Xenix/Linux device drivers Two types: Block and Character

4 General Structure Device Header Driver Data Storage Strategy Routine Interrupt Entry Command Handlers Interrupt Service Routine Initialization Code and Driver Data Buffers

5 Device Header 18-byte block at beginning of every device driver 00H Link to next driver, offset 02H Link to next driver, segment 04H Device attribute word 06H Strategy entry point, offset 08H Interrupt entry point, offset 0AH Logical name (8 bytes) if character device. Number of units (1 byte) if block device (other 7 bytes reserved)

6 Strategy Routine Called by MS-DOS when driver is first loaded Called by MS-DOS whenever I/O request is issued to device Request call includes a pointer to a request header; driver saves pointer and returns to MS-DOS Request header includes command code and other information Called by MS-DOS when driver is first loaded Called by MS-DOS whenever I/O request is issued to device Request call includes a pointer to a request header; driver saves pointer and returns to MS-DOS Request header includes command code and other information

7 Interrupt Routine Called after the strategy routine Implements the device driver proper Performs the actual I/O operations Collection of subroutines to implement various functions (read, write, …) Centralized entry routine saves registers and sets up driver ops Centralized exit routine restores registers and sets status and error codes Called after the strategy routine Implements the device driver proper Performs the actual I/O operations Collection of subroutines to implement various functions (read, write, …) Centralized entry routine saves registers and sets up driver ops Centralized exit routine restores registers and sets status and error codes

8 Sample Command Codes 00H:Driver Initialization 01H:Media Check 04H:Read 08H:Write 0DH:Open 0EH:Close 00H:Driver Initialization 01H:Media Check 04H:Read 08H:Write 0DH:Open 0EH:Close


Download ppt "MS DOS Device Drivers Sources of Information Device driver basics Structure and internal routines Sources of Information Device driver basics Structure."

Similar presentations


Ads by Google