SMPProgAdd - Generic IOCtl Commands: Difference between revisions
(3 intermediate revisions by the same user not shown) | |||
Line 36: | Line 36: | ||
|01h||Unlock Drive||[[DSK_UNLOCKDRIVE]] | |01h||Unlock Drive||[[DSK_UNLOCKDRIVE]] | ||
|- | |- | ||
|02h||Redetermine Media||DSK_REDETERMINEMEDIA | |02h||Redetermine Media||[[DSK_REDETERMINEMEDIA]] | ||
|- | |- | ||
|03h||Set Logical Map||DSK_SETLOGICALMAP | |03h||Set Logical Map||[[DSK_SETLOGICALMAP]] | ||
|- | |- | ||
|04h||Begin Format||DSK_BEGINFORMAT | |04h||Begin Format||[[DSK_BEGINFORMAT]] | ||
|- | |- | ||
|20h||Block Removable||DSK_BLOCKREMOVABLE | |20h||Block Removable||[[DSK_BLOCKREMOVABLE]] | ||
|- | |- | ||
|21h||Query Logical Map||DSK_GETLOGICALMAP | |21h||Query Logical Map||[[DSK_GETLOGICALMAP]] | ||
|- | |- | ||
|22h||Reserved|| | |22h||Reserved|| | ||
|- | |- | ||
|40h||Removable Media Control||DSK_UNLOCKEJECTMEDIA | |40h||Removable Media Control||[[DSK_UNLOCKEJECTMEDIA]] | ||
|- | |- | ||
|43h||Set Device Parameters||DSK_SETDEVICEPARAMS | |43h||Set Device Parameters||[[DSK_SETDEVICEPARAMS]] | ||
|- | |- | ||
|44h||Write Logical Track||DSK_WRITETRACK | |44h||Write Logical Track||[[DSK_WRITETRACK]] | ||
|- | |- | ||
|45h||Format and Verify Track||DSK_FORMATVERIFY | |45h||Format and Verify Track||[[DSK_FORMATVERIFY]] | ||
|- | |- | ||
|5Dh||Diskette Control||DSK_DISKETTECONTROL | |5Dh||Diskette Control||[[DSK_DISKETTECONTROL]] | ||
|- | |- | ||
|5Eh||Reserved|| | |5Eh||Reserved|| | ||
Line 62: | Line 62: | ||
|5Fh||Reserved|| | |5Fh||Reserved|| | ||
|- | |- | ||
|60h||Query Media Sense||DSK_QUERYMEDIASENSE | |60h||Query Media Sense||[[DSK_QUERYMEDIASENSE]] | ||
|- | |- | ||
|63h||Query Device Parameters||DSK_GETDEVICEPARAMS | |63h||Query Device Parameters||[[DSK_GETDEVICEPARAMS]] | ||
|- | |- | ||
|64h||Read Logical Track||DSK_READTRACK | |64h||Read Logical Track||[[DSK_READTRACK]] | ||
|- | |- | ||
|65h||Verify Logical Track||DSK_VERIFYTRACK | |65h||Verify Logical Track||[[DSK_VERIFYTRACK]] | ||
|- | |- | ||
|66h||Status||DSK_GETLOCKSTATUS | |66h||Status||[[DSK_GETLOCKSTATUS]] | ||
|} | |||
==Category 09h Physical Disk Control IOCtl Commands== | |||
Category 09h is used to access physical partitionable hard disks. The handle used for Category 09h command is returned by the DosPhysicalDisk (Function 2) API function. (See the OS/2 Control Program Programming Reference for more information). This handle is used to tell the system which physical disk is accessed by the IOCtl command. | |||
The Physical Disk Control commands relate to the entire partitionable hard disk. Direct track and sector I/O start at the beginning of the physical drive. [[PDSK_GETPHYSDEVICEPARAMS]], describes the entire physical device. | |||
The following is a summary of Category 09h IOCtl Commands: | |||
{| class="wikitable" | |||
! Function !! Description !! Name | |||
|- | |||
| 00h || Lock Physical Drive || [[PDSK_LOCKPHYSDRIVE]] | |||
|- | |||
| 01h || Unlock Physical Drive || [[PDSK_UNLOCKPHYSDRIVE]] | |||
|- | |||
| 44h || Write Physical Track || [[PDSK_WRITEPHYSTRACK]] | |||
|- | |||
| 63h || Query Physical Device Parameters || [[PDSK_GETPHYSDEVICEPARAMS]] | |||
|- | |||
| 64h || Read Physical Track || [[PDSK_READPHYSTRACK]] | |||
|- | |||
| 65h || Verify Physical Track || [[PDSK_VERIFYPHYSTRACK]] | |||
|} | |} |
Latest revision as of 04:35, 19 May 2025
Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation
Generic IOCtl Commands
OS/2 device drivers are used to access the I/O hardware. The IOCtl functions provide a method for an application, or subsystem, to send device-specific control commands to a physical device driver. These IOCtls are subfunctions that are issued through the DosDevIOCtl API function request. The DosDevIOCtl function request can be used only by OS/2 applications; the INT 21h IOCtl request can be used only by DOS applications.
Category and Function Fields
The category and function fields are as follows. Each code is contained in a byte:
Category Codes
- 0xxx xxxx: OS/2-defined
- 1xxx xxxx: User-defined
- _xxx xxxx: Code
Function Codes
- 0xxx xxxx: Return error, if unsupported
- 1xxx xxxx: Ignore, if unsupported
- x0xx xxxx: Intercepted by the OS/2 operating system
- x1xx xxxx: Passed to driver
- xx0x xxxx: Sends data and commands to device
- xx1x xxxx: Queries data and information from device
- ___x xxxx: Subfunction
Note: The send/query data bit is intended only to standardize the function set; it plays no critical role. Some functions can contain both command and query elements. Such commands are defined as sends data.
Category 08h Logical Disk Control IOCtl Commands
The following is a summary of Category 08h IOCtl Commands:
Function | Description | Name |
---|---|---|
00h | Lock Drive | DSK_LOCKDRIVE |
01h | Unlock Drive | DSK_UNLOCKDRIVE |
02h | Redetermine Media | DSK_REDETERMINEMEDIA |
03h | Set Logical Map | DSK_SETLOGICALMAP |
04h | Begin Format | DSK_BEGINFORMAT |
20h | Block Removable | DSK_BLOCKREMOVABLE |
21h | Query Logical Map | DSK_GETLOGICALMAP |
22h | Reserved | |
40h | Removable Media Control | DSK_UNLOCKEJECTMEDIA |
43h | Set Device Parameters | DSK_SETDEVICEPARAMS |
44h | Write Logical Track | DSK_WRITETRACK |
45h | Format and Verify Track | DSK_FORMATVERIFY |
5Dh | Diskette Control | DSK_DISKETTECONTROL |
5Eh | Reserved | |
5Fh | Reserved | |
60h | Query Media Sense | DSK_QUERYMEDIASENSE |
63h | Query Device Parameters | DSK_GETDEVICEPARAMS |
64h | Read Logical Track | DSK_READTRACK |
65h | Verify Logical Track | DSK_VERIFYTRACK |
66h | Status | DSK_GETLOCKSTATUS |
Category 09h Physical Disk Control IOCtl Commands
Category 09h is used to access physical partitionable hard disks. The handle used for Category 09h command is returned by the DosPhysicalDisk (Function 2) API function. (See the OS/2 Control Program Programming Reference for more information). This handle is used to tell the system which physical disk is accessed by the IOCtl command.
The Physical Disk Control commands relate to the entire partitionable hard disk. Direct track and sector I/O start at the beginning of the physical drive. PDSK_GETPHYSDEVICEPARAMS, describes the entire physical device.
The following is a summary of Category 09h IOCtl Commands:
Function | Description | Name |
---|---|---|
00h | Lock Physical Drive | PDSK_LOCKPHYSDRIVE |
01h | Unlock Physical Drive | PDSK_UNLOCKPHYSDRIVE |
44h | Write Physical Track | PDSK_WRITEPHYSTRACK |
63h | Query Physical Device Parameters | PDSK_GETPHYSDEVICEPARAMS |
64h | Read Physical Track | PDSK_READPHYSTRACK |
65h | Verify Physical Track | PDSK_VERIFYPHYSTRACK |