Jump to content

SMPProgAdd - Generic IOCtl Commands

From EDM2
Revision as of 03:41, 19 May 2025 by Martini (talk | contribs) (Created page with "{{IBM-Reprint}} {{SMPProgAdd}} = 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 D...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Reprint Courtesy of International Business Machines Corporation, © International Business Machines Corporation

SMP Programming Addendum
  1. How to Use the SMP Programming Addendum
  2. Introduction to OS/2 Warp Server Version 4 Advanced
  3. Platform Specific Drivers (PSDs)
  4. High Memory Support
  5. Raw File System
  6. Processor Management and Performance Functions
  7. Application Considerations
  8. Device Drivers In OS/2 Warp Server for SMP
  9. New Device Helper (DevHlp) Routines
  10. Kernel Debugger
  11. The ICAT Debugger
  12. Software Trace Facility (STRACE)
  13. View and Set Program Type For Executable File (MARKEXE)
  14. Data Types
  15. Errors
  16. Generic IOCtl Commands
  17. Sample Source Code for a PSD
  18. Comments, Please!
  19. Glossary
  20. Notices

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
00h Lock Drive
01h Unlock Drive
02h Redetermine Media
03h Set Logical Map
04h Begin Format
20h Lock Removable
21h Query Logical Map
22h Reserved
40h Removable Media Control
43h Set Device Parameters
44h Write Logical Track
45h Format and Verify Track
5Dh Diskette Control
5Eh Reserved
5Fh Reserved
60h Query Media Sense
63h Query Device Parameters
64h Read Logical Track
65h Verify Logical Track
66h Status