Jump to content

PDDREF:Generic IOCtl Commands

From EDM2
Revision as of 12:51, 23 August 2018 by Ak120 (talk | contribs)
Physical Device Driver Reference
  1. Introduction
  2. Physical Device Driver Overview
  3. Physical Device Driver Architecture and Structure
  4. OS/2 Physical Device Driver Operations
  5. OS/2 Physical Device Driver Design Issues
  6. Character Device Monitors
  7. Installation of External Loadable Device Drivers
  8. Physical Device Driver Strategy Commands
  9. Device Helper (DevHlp) Services
  10. Resource Management
  11. Linking Resource Manager Services
  12. Generic IOCtl Commands
Appendixes
OS/2 Version Compatibility Considerations
Running OS/2 Version 1.3 16-Bit PDDs on OS/2
Using Advanced Bios
Notices
Glossary

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.

The category and function fields are as follows. Each code is contained in a byte:

 Category        Code
0xxx xxxx        OS/2-defined
1xxx xxxx        User-defined
_xxx xxxx        Code. 
   Function        Code
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.

Notice that 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.

Generic IOCtl Example

The DosDevIOCtl function sends the request to the physical device driver request packet. The physical device driver receives the request packet, and looks for the Command Code (Command 16 is the generic IOCtl command) to identify the request. Notice that each device driver can define the structure of the Data Packet and the Parameter Packet, but all device drivers use the same request header.

The 16-bit calling sequence for DosDevIOCtl is shown below:

EXTRN   DosDevIOCtl:Far

PUSH@   OTHER  Data        ; Data Packet address
PUSH@   OTHER  ParmList    ; Parameter Packet address
PUSH    WORD   Function    ; Function code
PUSH    WORD   Category    ; Category code
PUSH    WORD   DevHandle   ; User's device driver file handle

CALL    DosDevIOCtl

The 32-bit calling sequence for DosDevIOCtl is shown below:

PUSH@   DWORD  DataLengthInOut   ; Data Length Address
PUSH    DWORD  DataLengthMAX     ; Max size of Data Packet
PUSH@   OTHER  Data              ; Data Packet Address
PUSH@   DWORD  ParmLengthInOut   ; Parm Length Address
PUSH    DWORD  ParmLengthMax     ; Max size of Parm List
PUSH@   OTHER  ParmList          ; Parameter Packet Address
PUSH    DWORD  Function          ; Function Code
PUSH    DWORD  Category          ; Category Code
PUSH    DWORD  DevHandle         ; User's device driver file handle

Call DOSDevIOCtl

DosDevIOCtl2 performs the same function as DosDevIOCtl, and also provides Length fields for the Data and Parameter List buffers. These Length fields should be passed to the Device Helper service VerifyAccess when the physical device driver is determining whether it has access to the application's Data and Parameter List buffers. The Length fields also tell physical network device drivers the amount of data residing in these buffers for the transfer to other network nodes.

The 16-bit calling sequence for DosDevIOCtl2 is shown below:

EXTRN   DosDevIOCtl2:Far

PUSH@   OTHER  Data        ; Data Packet address
PUSH    WORD   DataLength  ; Data Packet length
PUSH@   OTHER  ParmList    ; Parameter Packet address
PUSH    WORD   ParmLength  ; Parameter Packet length
PUSH    WORD   Function    ; Function code
PUSH    WORD   Category    ; Category code
PUSH    WORD   DevHandle   ; User's device driver file handle

CALL    DosDevIOCtl2

Generic IOCtl Function Table

The list of categories and functions for the generic IOCtl requests are as follows:

Category  ³Function  ³Description
    01h   ³          ³Serial Device Control
          ³   14h    ³Reserved                                ³
          ³   34h    ³Reserved                                ³
          ³   41h    ³Set Bit Rate                            ³
          ³   42h    ³Set Line Characteristics (stop, parity, data bits)
          ³   43h    ³Extended Set Bit Rate                   ³
          ³   44h    ³Transmit Byte Immediate                 ³
          ³   45h    ³Set Break OFF                           ³
          ³   46h    ³Set Modem Control Signals               ³
          ³   47h    ³Behave As If XOFF Received (stop transmit)
          ³   48h    ³Behave As If XON Received (start transmit)
          ³   49h    ³Reserved                                ³
          ³   4Bh    ³Set Break ON                            ³
          ³   53h    ³Set Device Control Block (DCB) Parameters
          ³   54h    ³Set Enhanced Mode Parameters            ³
          ³   61h    ³Query Current Bit Rate                  ³
          ³   62h    ³Query Line Characteristics              ³
          ³   63h    ³Extended Query Bit Rate                 ³
          ³   64h    ³Query COM Status                        ³
          ³   65h    ³Query Transmit Data Status              ³
          ³   66h    ³Query Modem Control Output Signals      ³
          ³   67h    ³Query Current Modem Input Signals       ³
          ³   68h    ³Query Number of Characters in Receive Queue
          ³   69h    ³Query Number of Characters in Transmit Queue
          ³   6Dh    ³Query COM Error                         ³
          ³   72h    ³Query COM Event Information             ³
          ³   73h    ³Query Device Control Block (DCB) Parameters
          ³   74h    ³Query Enhanced Mode Parameters          ³
    02h   ³          ³Reserved                                ³
    03h   ³          ³Video Control                           ³
          ³   70h    ³Allocate an LDT Selector                ³
          ³   71h    ³Deallocate an LDT Selector              ³
          ³   72h    ³Query Pointer Draw Address              ³
          ³   73h    ³Initialize Call Vector Table            ³
          ³   74h    ³ABIOS Pass-Through                      ³
          ³   75h    ³Allocate an LDT Selector with Offset    ³
          ³   76h    ³Allocate an LDT Selector with Background Validation Options
          ³   7Eh    ³Allocate Video Buffer                   ³
          ³   7Fh    ³Get Address to ROM Font                 ³
    04h   ³          ³Keyboard Control                        ³
          ³   50h    ³Set Code Page                           ³
          ³   51h    ³Set Input Mode (Default ASCII)          ³
          ³   52h    ³Set Interim Character Flags             ³
          ³   53h    ³Set Shift State                         ³
          ³   54h    ³Set Typematic Rate and Delay            ³
          ³   55h    ³Reserved                                ³
          ³   56h    ³Set Session Manager Hot Key             ³
          ³   57h    ³Set KCB                                 ³
          ³   58h    ³Set Code Page Number                    ³
          ³   59h    ³Set Read/Peek Notification              ³
          ³   5Ah    ³Alter Keyboard LEDs                     ³
          ³   5Bh    ³Reserved                                ³
          ³   5Ch    ³Set NLS and Custom Code Page            ³
          ³   5Dh    ³Create New Logical Keyboard             ³
          ³   5Eh    ³Destroy Logical Keyboard                ³
          ³   71h    ³Query Input Mode                        ³
          ³   72h    ³Query Interim Character Flags           ³
          ³   73h    ³Query Shift State                       ³
          ³   74h    ³Read Character Data Records             ³
          ³   75h    ³Peek Character Data Record              ³
          ³   76h    ³Query Session Manager Hot Key           ³
          ³   77h    ³Query Keyboard Type                     ³
          ³   78h    ³Query Code Page Number                  ³
          ³   79h    ³Translate Scan Code to ASCII            ³
          ³   7Ah    ³Query Keyboard Hardware ID              ³
          ³   7Bh    ³Query Keyboard Code Page Support Information
    05h   ³          ³Parallel Port Control                   ³
          ³   42h    ³Set Frame Control (CPL, LPI)            ³
          ³   43h    ³Reserved                                ³
          ³   44h    ³Set Infinite Retry                      ³
          ³   45h    ³Reserved                                ³
          ³   46h    ³Initialize Parallel Port                ³
          ³   47h    ³Reserved                                ³
          ³   48h    ³Activate Font                           ³
          ³   49h    ³Reserved                                ³
          ³   4Bh    ³Reserved                                ³
          ³   4Ch    ³Reserved                                ³
          ³   4Dh    ³Set Print-Job Title                     ³
          ³   4Eh    ³Set Parallel Port Write Time-Out Value  ³
          ³   4Fh    ³Reserved                                ³
          ³   50h    ³Reserved                                ³
          ³   51h    ³Reserved                                ³
          ³   52h    ³Set Parallel Port Communication Mode    ³
          ³   53h    ³Set Parallel Port Data Transfer Mode    ³
          ³   62h    ³Query Frame Control                     ³
          ³   63h    ³Reserved                                ³
          ³   64h    ³Query Infinite Retry                    ³
          ³   65h    ³Reserved                                ³
          ³   66h    ³Query Parallel Port Status              ³
          ³   67h    ³Reserved                                ³
          ³   68h    ³Reserved                                ³
          ³   69h    ³Query Active Font                       ³
          ³   6Ah    ³Verify Font                             ³
          ³   6Bh    ³Reserved                                ³
          ³   6Ch    ³Reserved                                ³
          ³   6Dh    ³Reserved                                ³
          ³   6Eh    ³Query Parallel Port Write Time-Out Value³
          ³   6Fh    ³Reserved                                ³
          ³   70h    ³Reserved                                ³
          ³   71h    ³Reserved                                ³
          ³   72h    ³Query Parallel Port Communication Mode  ³
          ³   73h    ³Query Parallel Port Data Transfer Mode  ³
          ³   74h    ³Query Parallel Port Device ID           ³
    06h   ³          ³Light Pen Control                       ³
    07h   ³          ³Mouse Control                           ³
          ³   50h    ³Reserved                                ³
          ³   51h    ³Notification of Display Mode Change     ³
          ³   52h    ³Reserved                                ³
          ³   53h    ³Reassign Current Mouse Scaling Factors  ³
          ³   54h    ³Assign New Mouse Event Mask             ³
          ³   55h    ³Reassign Mouse Threshold Values         ³
          ³   56h    ³Set Pointer Shape                       ³
          ³   57h    ³Unmark Collision Area                   ³
          ³   58h    ³Mark Collision Area                     ³
          ³   59h    ³Specify/Replace Pointer Screen Position ³
          ³   5Ah    ³Set OS/2-Mode Pointer Draw Device Driver Address
          ³   5Bh    ³Reserved                                ³
          ³   5Ch    ³Set Current Physical Mouse Device Driver Status Flags
          ³   5Dh    ³Notification of Mode Switch Completion  ³
          ³   60h    ³Query Number of Mouse Buttons Supported ³
          ³   61h    ³Query Mouse Device Motion Sensitivity   ³
          ³   62h    ³Query Current Physical Mouse Device Driver Status Flags
          ³   63h    ³Read Mouse Event Queue                  ³
          ³   64h    ³Query Current Event Queue Status        ³
          ³   65h    ³Query Current Mouse Event Mask          ³
          ³   66h    ³Query Current Mouse Scaling Factors     ³
          ³   67h    ³Query Current Pointer Screen Position   ³
          ³   68h    ³Query Current Pointer Shape             ³
          ³   69h    ³Query Mouse Threshold Values            ³
          ³   6Ah    ³Query Physical Mouse Device Driver Level/Version
          ³   6Bh    ³Query Pointing Device ID                ³
    08h   ³          ³Logical Disk Control                    ³
          ³   00h    ³Lock Drive                              ³
          ³   01h    ³Unlock Drive                            ³
          ³   02h    ³Redetermine Media (end format)          ³
          ³   03h    ³Set Logical Map                         ³
          ³   04h    ³Begin Format                            ³
          ³   20h    ³Block Removable                         ³
          ³   21h    ³Query Logical Map                       ³
          ³   22h    ³Reserved                                ³
          ³   40h    ³Removable Media Control                 ³
          ³   43h    ³Set Device Parameters                   ³
          ³   44h    ³Write/Read/Verify Track                 ³
          ³   45h    ³Format and Verify Track                 ³
          ³   5Dh    ³Diskette Control                        ³
          ³   5Eh    ³Reserved                                ³
          ³   5Fh    ³Reserved                                ³
          ³   60h    ³Query Media Sense                       ³
          ³   63h    ³Query Device Parameters                 ³
          ³   66h    ³Status                                  ³
    09h   ³          ³Physical Disk Control                   ³
          ³   00h    ³Lock Physical Drive                     ³
          ³   01h    ³Unlock Physical Drive                   ³
          ³   44h    ³Physical Write Track                    ³
          ³   63h    ³Query Physical Device Parameters        ³
          ³   64h    ³Physical Read Track                     ³
          ³   65h    ³Physical Verify Track                   ³
    0Ah   ³          ³Character Device Monitor Control        ³
          ³   40h    ³Register Monitor                        ³
    0Bh   ³          ³General Device Control                  ³
          ³   01h    ³Flush Input Buffer                      ³
          ³   02h    ³Flush Output Buffer                     ³
          ³   41h    ³System Notifications for Physical Device³
          ³          ³Drivers                                 ³
          ³   60h    ³Query Monitor Support                   ³
    0Ch   ³          ³Advanced Power Management               ³
          ³   40h    ³Send Power Event                        ³
          ³   41h    ³Set Power Event Res                     ³
          ³   42h    ³Reserved                                ³
          ³   60h    ³Query Power Status                      ³
          ³   61h    ³Query Power Event                       ³
          ³   62h    ³Query PowerInfo                         ³
   0Dh-7Fh³          ³Reserved Category Codes                 ³
    80h   ³          ³Screen Control                          ³
          ³   00h    ³Get Current Video Memory Bank           ³
          ³   01h    ³Set Current Video Memory Bank           ³
          ³   02-07Fh³Reserved                                ³
          ³   08h    ³Return Adapter Video Configuration      ³
          ³   09h    ³Return Manufacturer-Specific Adapter Data
          ³   0Ah    ³Update Adapter Video Information        ³
          ³   0Bh    ³Return Linear Address Mapped to Physical Address
          ³0Ch-07Fh  ³Reserved
    80h   ³          ³OEMHLP Controls                         ³
          ³   00h    ³Query OEM Adaptation Information        ³
          ³   01h    ³Query Machine Information               ³
          ³   02h    ³Query Display Combination Code          ³
          ³   03h    ³Return Video Fonts                      ³
          ³   04h    ³Read EISA Configuration                 ³
          ³          ³Information-Subfunction 00              ³
          ³   04h    ³Read EISA Function                      ³
          ³          ³Information-Subfunction 01              ³
          ³   05h    ³Query ROM BIOS Information              ³
          ³   06h    ³Query Miscellaneous Video Information   ³
          ³   07h    ³Query Video Adapter                     ³
          ³   08h    ³Query SVGA Information                  ³
          ³   09h    ³Query Memory Information                ³
          ³   0Ah    ³Query, Display Mode, Query, and Set     ³
          ³          ³(DMQS) Information                      ³
          ³   0Bh    ³Access PCI BIOS                         ³
          ³   0Bh    ³Query PCI BIOS - Subfunction 00h        ³
          ³   0Bh    ³Find PCI Device - Subfunction 01h       ³
          ³   0Bh    ³Find PCI Class Code - Subfunction 02h   ³
          ³   0Bh    ³Read PCI Configuration Space -          ³
          ³          ³Subfunction 03h                         ³
          ³   0Bh    ³Write PCI Configuration Space -
          ³          ³Subfunction 04h
    80h   ³          ³TESTCFG.SYS                             ³
          ³   40h    ³Obtain a Copy of BIOS/Adapter Memory    ³
          ³   41h    ³Issue an "IN" I/O Instruction           ³
          ³   42h    ³Issue an "OUT" I/O Instruction          ³
          ³   60h    ³Query Bus Architecure Function          ³
          ³   61h    ³Return All POS IDs                      ³
          ³   62h    ³Return All EISA IDs                     ³
    80h   ³          ³Resource Manager                        ³
          ³   01h    ³Get Resource Manager Node Information   ³
          ³   02h    ³Enumerate Resource Manager Nodes        ³
    80h   ³          ³CD-ROM Drive and Disc Control           ³
          ³   40h    ³Reset Drive                             ³
          ³   44h    ³Eject Disk                              ³
          ³   45h    ³Close Tray                              ³
          ³   46h    ³Lock/Unlock Door                        ³
          ³   50h    ³Seek                                    ³
          ³   60h    ³Device Status                           ³
          ³   61h    ³Identify CD-ROM Driver                  ³
          ³   63h    ³Return Sector Size                      ³
          ³   70h    ³Location of Drive Head                  ³
          ³   72h    ³Read Long                               ³
          ³   78h    ³Return Volume Size                      ³
          ³   79h    ³Get UPC                                 ³
    81h   ³          ³CD-ROM Audio Control                    ³
          ³   40h    ³Audio Channel Control                   ³
          ³   50h    ³Play Audio                              ³
          ³   51h    ³Stop Audio                              ³
          ³   52h    ³Resume Audio                            ³
          ³   60h    ³Return Audio-Channel Information        ³
          ³   61h    ³Return Audio-Disc Information           ³
          ³   62h    ³Return Audio-Track Information          ³
          ³   63h    ³Return Audio-Subchannel Q Information   ³
          ³   65h    ³Return Audio-Status Information         ³
    81h   ³          ³Touch-Device-Dependent Driver Control   ³
          ³   50h    ³Reserved                                ³
          ³   51h    ³Reserved                                ³
          ³   52h    ³Set Calibration Constants               ³
          ³   53h    ³Read Data                               ³
          ³   54h    ³Set Data Mode                           ³
          ³   55h    ³Set Click-Lock Parameters               ³
          ³   56h    ³Set Touch Thresholds                    ³
          ³   57h    ³Set Emulation XY Offset                 ³
          ³   58h    ³Set Data Report Rate                    ³
          ³   59h    ³Set Low-Pass Filter                     ³
          ³   5Ah    ³Write Memory Location                   ³
          ³   5Bh    ³Reserved                                ³
          ³   5Ch    ³Reserved                                ³
          ³   5Dh    ³Reserved                                ³
          ³   5Eh    ³Reserved                                ³
          ³   5Fh    ³Reserved                                ³
          ³   60h    ³Get Calibration Constants               ³
          ³   61h    ³Get Data Mode                           ³
          ³   62h    ³Get Click Lock Parameters               ³
          ³   63h    ³Get Touch Thresholds                    ³
          ³   64h    ³Get Emulation XY Offset                 ³
          ³   65h    ³Get Data Report Rate                    ³
          ³   66h    ³Get Low Pass Filter                     ³
          ³   67h    ³Read Memory Location                    ³
    81h   ³          ³Touch-Device-Independent Driver Control ³
          ³   50h    ³Set Coordinate System                   ³
          ³   51h    ³Reserved                                ³
          ³   52h    ³Set Selection Mechanism                 ³
          ³   53h    ³Set Event Mask                          ³
          ³   54h    ³Set Queue Size                          ³
          ³   55h    ³Set Emulation State                     ³
          ³   60h    ³Set Coordinate System                   ³
          ³   61h    ³Reserved                                ³
          ³   62h    ³Get Selection Mechanism                 ³
          ³   63h    ³Get Event Mask                          ³
          ³   64h    ³Get Queue Size                          ³
          ³   65h    ³Get Emulation State                     ³
          ³   66h    ³Get Read Event Queue                    ³

Category 01h ASYNC (RS232-C) Control IOCtl Commands

Whenever an IOCtl command calls for a NULL pointer, it is the responsibility of the application to set one up for the appropriate Parameter or Data Packet pointer before calling the physical device driver. IOCtls can be interpreted differently by future releases if the pointer is not a NULL pointer. If a NULL pointer is called for and it is not received by the device driver, it is considered an invalid Parameter or Data Packet value.

The physical device driver services each communications port (COM1, COM2, and so forth) independently. IOCtls issued to the physical device driver for a given port have no effect on any other communications ports that the physical device driver is servicing. The application cannot assume a given timing relationship between when the IOCtls are executed and when data is received or transmitted by the ASYNC hardware. Data Carrier Detect (DCD) is the same signal as Receiver Line Signal Detect (RLSD).

The following is a summary of the Category 01h IOCtl Commands:

Function  ³Description
³   14h    ³Reserved                                          ³
³   34h    ³Reserved                                          ³
³   41h    ³Set Bit Rate                                      ³
³   42h    ³Set Line Characteristics (stop, parity, data bits)³
³   43h    ³Extended Set Bit Rate                             ³
³   44h    ³Transmit Byte Immediate                           ³
³   45h    ³Set Break OFF                                     ³
³   46h    ³Set Modem Control Signals                         ³
³   47h    ³Behave as if XOFF Received (stop transmit)        ³
³   48h    ³Behave as if XON Received (start transmit)        ³
³   49h    ³Reserved                                          ³
³   4Bh    ³Set Break ON                                      ³
³   53h    ³Set Device Control Block (DCB) Parameters         ³
³   54h    ³Set Enhanced Mode Parameters                      ³
³   61h    ³Query Current Bit Rate                            ³
³   62h    ³Query Line Characteristics                        ³
³   63h    ³Extended Query Bit Rate                           ³
³   64h    ³Query COM Status                                  ³
³   65h    ³Query Transmit Data Status                        ³
³   66h    ³Query Modem Control Output Signals                ³
³   67h    ³Query Current Modem Input Signals                 ³
³   68h    ³Query Number of Characters in Receive Queue       ³
³   69h    ³Query Number of Characters in Transmit Queue      ³
³   6Dh    ³Query COM Error                                   ³
³   72h    ³Query COM Event Information                       ³
³   73h    ³Query Device Control Block (DCB) Parameters       ³
³   74h    ³Query Enhanced Mode Parameters                    ³

Category 03h Video Control IOCtl Commands

The following is a summary of the Category 03h Video Control IOCtl Commands:

Function  Description
³   70h    ³Allocate an LDT Selector                          ³
³   71h    ³Deallocate an LDT Selector                        ³
³   72h    ³Query Pointer Draw Address                        ³
³   73h    ³Initialize Call Vector Table                      ³
³   74h    ³ABIOS Pass-Through                                ³
³   75h    ³Allocate an LDT Selector with Offset              ³
³   76h    ³Allocate an LDT Selector with Background          ³
³          ³Validation Options                                ³
³   7Eh    ³Allocate Video Buffer                             ³
³   7Fh    ³Get Address to ROM Font                           ³

Category 04h Keyboard Control IOCtl Commands

The following is a summary of the Category 04h IOCtl Commands:

Function  Description

³   50h    ³Set Code Page                                     ³
³   51h    ³Set Input Mode (Default ASCII)                    ³
³   52h    ³Set Interim Character Flags                       ³
³   53h    ³Set Shift State                                   ³
³   54h    ³Set Typematic Rate and Delay                      ³
³   55h    ³Reserved                                          ³
³   56h    ³Set Session Manager Hot Key                       ³
³   57h    ³Set KCB                                           ³
³   58h    ³Set Code Page Number                              ³
³   59h    ³Set Read/Peek Notification                        ³
³   5Ah    ³Alter Keyboard LEDs                               ³
³   5Bh    ³Reserved                                          ³
³   5Ch    ³Set NLS and Custom Code Page                      ³
³   5Dh    ³Create a New Logical Keyboard                     ³
³   5Eh    ³Destroy a Logical Keyboard                        ³
³   71h    ³Query Input Mode                                  ³
³   72h    ³Query Interim Character Flags                     ³
³   73h    ³Query Shift State                                 ³
³   74h    ³Read Character Data Records                       ³
³   75h    ³Peek Character Data Record                        ³
³   76h    ³Query Session Manager Hot Key                     ³
³   77h    ³Query Keyboard Type                               ³
³   78h    ³Query Code Page Number                            ³
³   79h    ³Translate Scan Code to ASCII                      ³
³   7Ah    ³Query Keyboard Hardware ID                        ³
³   7Bh    ³Query Keyboard Code Page Support Information      ³

Category 05h Parallel Port Control IOCtl Commands

The following is a summary of Category 05h IOCtl Commands:

³Function  ³Description                                       ³
³   42h    ³Set Frame Control (CPL, LPI)                      ³
³   43h    ³Reserved                                          ³
³   44h    ³Set Infinite Retry                                ³
³   45h    ³Reserved                                          ³
³   46h    ³Initialize Parallel Port                          ³
³   47h    ³Reserved                                          ³
³   48h    ³Activate Font                                     ³
³   49h    ³Reserved                                          ³
³   4Bh    ³Reserved                                          ³
³   4Ch    ³Reserved                                          ³
³   4Dh    ³Set Print-Job Title                               ³
³   4Eh    ³Set Parallel Port Write Timeout Value             ³
³   4Fh    ³Reserved                                          ³
³   50h    ³Reserved                                          ³
³   51h    ³Reserved                                          ³
³   52h    ³Set Parallel Port Communication Mode              ³
³   53h    ³Set Parallel Port Data Transfer Mode              ³
³   62h    ³Query Frame Control                               ³
³   63h    ³Reserved                                          ³
³   64h    ³Query Infinite Retry                              ³
³   65h    ³Reserved                                          ³
³   66h    ³Query Parallel Port Status                        ³
³   67h    ³Reserved                                          ³
³   68h    ³Reserved                                          ³
³   69h    ³Query Active Font                                 ³
³   6Ah    ³Verify Font                                       ³
³   6Bh    ³Reserved                                          ³
³   6Ch    ³Reserved                                          ³
³   6Dh    ³Reserved                                          ³
³   6Eh    ³Query Parallel Port Write Timeout Value           ³
³   6Fh    ³Reserved                                          ³
³   70h    ³Reserved                                          ³
³   71h    ³Reserved                                          ³
³   72h    ³Query Parallel Port Communication Mode            ³
³   73h    ³Query Parallel Port Data Transfer Mode            ³
³   74h    ³Query Parallel Port Device ID                     ³

Category 07h Mouse Control IOCtl Commands

The following is a summary of Category 07h IOCtl Commands:

Function  ³Description
   50h    ³Reserved
   51h    ³Notification of Display Mode Change               ³
   52h    ³Reserved                                          ³
   53h    ³Reassign Current Mouse Scaling Factors            ³
   54h    ³Assign New Mouse Event Mask                       ³
   55h    ³Reassign Mouse Threshold Values                   ³
   56h    ³Set Pointer Shape                                 ³
   57h    ³Unmark Collision Area                             ³
   58h    ³Mark Collision Area                               ³
   59h    ³Specify/Replace Pointer Screen Position           ³
   5Ah    ³Set OS/2 Mode Pointer Draw Device Driver Address  ³
   5Bh    ³Reserved                                          ³
   5Ch    ³Set Current Physical Mouse Device Driver Status Flags                                             ³
   5Dh    ³Notification of Mode Switch Completion            ³
   60h    ³Query Number of Mouse Buttons Supported           ³
   61h    ³Query Mouse Device Motion Sensitivity             ³
   62h    ³Query Current Physical Mouse Device Driver Status ³
³          ³Flags                                             ³
   63h    ³Read Mouse Event Queue                            ³
   64h    ³Query Current Event Queue Status                  ³
   65h    ³Query Current Mouse Event Mask                    ³
   66h    ³Query Current Mouse Scaling Factors               ³
   67h    ³Query Current Pointer Screen Position             ³
   68h    ³Query Current Pointer Shape                       ³
   69h    ³Query Mouse Threshold Values                      ³
   6Ah    ³Query Physical Mouse Device Driver Level/Version  ³
³          ³Number                                            ³
   6Bh    ³Query Pointing Device ID

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              ³Block 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

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
   00h         Lock Physical Drive
   01h         Unlock Physical Drive
   44h         Write Physical Track
   63h         Query Physical Device Parameters
   64h         Read Physical Track
   65h         Verify Physical Track

Category 0Ah Character Device Monitor IOCtl Command

The following is the Category 0Ah IOCtl Command:

Function  Description
   40h    Register Monitor

Category 0Bh General Device Control IOCtl Commands

The following is a summary of Category 0Bh IOCtl Commands:

Function  Description
   01h    Flush Input Buffer
   02h    Flush Output Buffer
   41h    System Notifications for Physical Device Drivers
   60h    Query Monitor Support

Category 0Ch Advanced Power Management

Function  Description
40h       Send Power Event
41h       Set Power Event Resource
42h - 44h Reserved
45h       OEM APM Function
60h       Query Power Status
61h       Query Power Event
62h       Query Power Information
63h       Query Power State

Category 80h Screen Control IOCtl Commands

The following video IOCtls are defined and supported by the SCREENDD$ device driver, by way of the DosDevIOCtl call. The IOCtl category code is 80h (defined as SCREENDD_CATEGORY).

The function codes within the SCREENDD_CATEGORY are:

Function  Description
00h       Get Current Video Memory Bank
01h       Set Current Video Memory Bank
02h-07h   Reserved
08h       Return Adapter Video Configuration
09h       Return Manufacturer-Specific Adapter Data
0Ah       Update Adapter Video Memory Information
0Bh       Return Linear Address Mapped to Physical Address
0Ch-7Fh   Reserved

An example of the DosDevIOCtl calling convention for the Screen IOCtls follows:

int PASCAL near videoIoctl(VOID *data,VOID *parm,USHORT function)
{
  unsigned hScreenDD;                  /* handle of SCREENDD$ dev driver */
  unsigned OpenAction;                 /* action taken to open device    */
  unsigned rc;                         /* function return code           */

  if (!(rc = DosOpen(SCREENDD_NAME, (PHFILE)&hScreenDD, (PUSHORT)&OpenAction,
     NO_SIZE, NO_ATTRIBUTES, OPEN_IF_EXISTS, NO_INHERIT+DENY_NONE+READ_WRITE,
     RESERVED_LONG)))
  {
    rc = DosDevIOCtl(data,
                     parm,
                     function,
                     SCREENDD_CATEGORY,
                     (HFILE)hScreenDD);
    DosClose(hScreenDD);
  }
  return (rc);

Category 80h OEMHLP IOCtls

The OEMHLP interface was originally designed to allow Original Equipment Manufacturers (OEMs) to modify and adapt the OS/2 operating system to run on their hardware. In the past, IBM supported the OS/2 operating system on IBM hardware only. Therefore, OEMs had to build modified versions of the OS/2 operating system. The OEMHLP interface facilitated this process.

IBM currently tests the OS/2 operating system on a wide variety of OEM hardware. It is no longer necessary for OEMs to adapt the OS/2 operating system to their machines. Now the OEMHLP interface can be used to obtain real-mode information. This information can be passed to applications and device drivers running in protect mode. Applications and physical device drivers running in protect mode cannot access BIOS through the INT interface. The OEMHLP interface allows access to BIOS information and functions that are essential to these programs.

For example, you might want to issue INT 15h calls from your device driver initialization code to determine if an Extended Industry Standard Architecture (EISA) adapter is present. The following examples show the methods to determine if a specific EISA or Micro Channel adapter is present.

Using the Query Adapter ID to Verify EISA Adapter

The following example uses the OEMHLP IOCtl interface to verify the EISA card ID:

USHORT FindMyEISACard(void)
{
  HFILE filehandle;
  USHORT action;

  EISAFunctionInfo.efi_SubFunc = OEM_GET_SLOT_INFO; /* EISA Get Slot Info */
  EISAFunctionInfo.efi_Slot    = 0;                 /* Slot 0             */

  rc = DosOpen("OEMHLP$",
               &filehandle,
               &action,
               0L,
               0,
               1,
               0x40,
               0L);
  if (rc == 0)
    {
    for(index=1;index<CFG_MAX_EISA_SLOTS;index++)   /* For each slot      */
      {
      EISAFunctionInfo.efi_Slot    = (UCHAR) index; /* Slot Number        */
      EISASlotInfo.esi_CardID  = 0;                 /* Reset Card ID value*/
      rc = DosDevIOCtl((PVOID)&EISASlotInfo,        /* Data Packet */
                       (PVOID)&EISAFunctionInfo,    /* Parm Packet */
                       (USHORT)OEMHLP_QUERYEISACONFIG,
                       (USHORT)OEMHLP_CATEGORY,
                       (HFILE)filehandle);
      /* If IOCtl successful and slot has adapter, then store away
         the adapter ID, otherwise mark as empty with a zero.
       */
      if((rc==0)&&(EISASlotInfo.esi_Error==0))
        {
        if (EISASlotInfo.esi_CardID == MYCARDID)
           DosClose(filehandle);        /* Close handle to OEMHLP$ */
           return(FOUND);
        }
      }
      DosClose(filehandle);             /* Close handle to OEMHLP$ */
    }
   return(NOTFOUND);
}
Using the DevHlp_ABIOSCall to Verify Micro Channel Adapter

The following example uses the DevHlp_ABIOSCall to verify the Micro Channel POS ID:

USHORT FindMyMicroChannelCard(void)
{
  USHORT i,rc;             /* Index and return code    */
  USHORT LID;              /* Logical ID               */

  if (GetLIDEntry(POS,0,1,&LID))
     return(NOTFOUND);

  /* Get length of RB to use for reading POS data. */

  POSLenRB.rb.RBLen = sizeof(POSLENRB);
  POSLenRB.rb.Func  = 0x01;
  POSLenRB.rb.LID   = LID;
  POSLenRB.rb.Unit  = 0;
  POSLenRB.rb.Resv1 = 0;
  POSLenRB.rb.Resv2 = 0;
  POSLenRB.Rsv1     = 0;
  POSLenRB.Rsv2     = 0;
  POSLenRB.Rsv3     = 0;
  rc = ABIOSCall( LID, &POSLenRB, 0);

  /*Is my request block big enough? */

  if ((rc==0) && (sizeof(POSRB) >= POSLenRB.RBLen))
     {
       RB.rb.RBLen = POSLenRB.RBLen;       /* request block length        */
       RB.rb.Func  = 0x0b;                 /* read stored POS data to mem */
       RB.rb.LID   = LID;                  /* Logical ID                  */
       RB.rb.Unit  = 0;
       RB.DataBuf  = (ULONG)(FARPOINTER)&POSData;

       for(i=0;i<=CFG_MAX_POS_SLOTS;i++)   /* For each slot, get POS ID   */
          {
           RB.Slot = (UCHAR)i;
           rc = ABIOSCall(LID,&RB,0);
           if((rc==0)&&(RB.rb.RetCode==0))
             if (RB.AdapterID == MYCARD)
                {
                  FreeLIDEntry(LID);
                  return(FOUND);
                }
          }
     }

  FreeLIDEntry(LID);             /* Release LID Entry */
  return(NOTFOUND);
}
OEMHLP IOCtls Summary

The following is a summary of Category 80h OEMHLP IOCtl Commands:

Function  Description
00h       Query OEM Adaptation Information
01h       Query Machine Information
02h       Query Display Combination Code
03h       Return Video Fonts
04h       Read EISA Slot Configuration Information     - Subfunction 00
04h       Read EISA Function Configuration Information - Subfunction 01
05h       Query ROM BIOS Information
06h       Query Miscellaneous Video Information
07h       Query Video Adapter
08h       Query SVGA Information
09h       Query Memory Information
0Ah       Query Display Mode, Query and Set (DMQS) Information
0Bh       Access PCI BIOS Information
0Bh       Query PCI BIOS Information - Subfunction 00h
0Bh       Find PCI Device - Subfunction 01h
0Bh       Find PCI Class Code - Subfunction 02h
0Bh       Read PCI Configuration Space - Subfunction 03h
0Bh       Write PCI Configuration Space - Subfunction 04h

Category 80h Adapter Presence-Check Services (TESTCFG.SYS)

The TESTCFG device driver provides services for automatic detection of Original Equipment Manufacturer (OEM) hardware interfaces. Functions provided by this driver are accessed entirely by opening the device name TESTCFG$ and using the following Category 80h IOCtls.

Function  Description
40H       Get Copy of BIOS/Adapter Memory
41H       Issue an "IN" I/O Instruction
42H       Issue an "OUT" I/O Instruction
60H       Get Bus Architecture Function
61H       Return All POS IDs
62H       Return All EISA IDs

Category 80h Resource Manager IOCtl Commands

RESOURCE.SYS provides two IOCtls that allow a ring 3 application to obtain a "snapshot" of the Resource Management data structures. Obtaining a snapshot of the Resource Management data structures consists of the following two steps:

1.- A data structure representing a depth-first traversal of the Resource Manager node structure is obtained.

2.- For each node traversed, the following information is provided:

  • A Resource Manager handle to access the node.
  • The depth of the node in the tree structure.

3.- A copy of each Resource Manager node can be obtained by supplying the node handle returned in Step 1.

  Function  Description
  01h       Get Resource Manager Node Data
  02h       Enumerate Resource Manager Nodes

Category 80h CD-ROM Drive and Disc IOCtl Commands

The OS/2 CD-ROM Device Manager provides an interface through generic IOCtls.

The CD-ROM device driver returns error values in the range of hex FF00 through FF14. DOS DevIOCtl return codes are described in the OS/2 Programming Reference manuals.

Function  Description
40h       Reset Drive
44h       Eject Disc
45h       Close Tray
46h       Lock/Unlock Door
50h       Seek
60h       Return Device Status
61h       Identify CD-ROM Driver
63h       Return Sector Size
70h       Report Location of Drive Head
72h       Read Long
78h       Return Volume Size
79h       Get UPC

Category 81h CD-ROM Audio IOCtl Commands

The OS/2 CD-ROM Device Manager provides an interface through generic IOCtls.

The CD-ROM device driver returns error values in the range of hex FF00 through FF14. DOSDevIOCtl return codes are described in the OS/2 Programming Reference manuals.

Function  Description
40h       Set Audio Channel Control
50h       Play Audio
51h       Stop Audio
52h       Resume Audio
60h       Return Audio-Channel Information
61h       Return Audio-Disk Information
62h       Return Audio-Track Information
63h       Return Audio-Subchannel Q Information
65h       Return Audio-Status Information

Category 81h Touch Device-Dependent Driver

All Touch device driver IOCtl commands share Category 81h commands, which are distinguished by the device name used in the device Open (PDITOU$ for the device-dependent driver, TOUCH$ for the device-independent driver).

Device-Dependent Device Driver Command Summary

The following table describes the Category 81h Touch Device-Dependent Driver IOCtl commands:

Function Description
50h       Reserved.
51h       Reserved.
52h       Set Calibration Constants
53h       Read Data
54h       Set Data Mode
55h       Set Click-Lock Parameters
56h       Set Touch Thresholds
57h       Set Emulation XY Offset
58h       Set Data Report Rate
59h       Set Low Pass Filter
5Ah       Write Memory Location
5Bh       Reserved.
5Ch       Reserved.
5Dh       Reserved.
5Eh       Reserved.
5Fh       Reserved.
60h       Get Calibration Constants
61h       Get Data Mode
62h       Get Click-Lock Parameters
63h       Get Touch Thresholds
64h       Get Emulation XY Offset
65h       Get Data Report Rate
66h       Get Low Pass Filter
67h       Read Memory Location

Category 81h Touch Device-Independent Driver

All Touch device driver IOCtl commands share Category 81h commands, which are distinguished by the device name used in the device Open (PDITOU$ for the device-dependent driver, TOUCH$ for the device-independent driver).

The following lists and describes the Category 81h Touch Device-Independent Driver:

Function Description
50h       Set Coordinate System
51h       Reserved
52h       Set Selection Mechanism
53h       Set Event Mask
54h       Set Queue Size
55h       Set Emulation State
60h       Get Coordinate System
61h       Reserved
62h       Get Selection Mechanism
63h       Get Event Mask
64h       Get Queue Size
65h       Get Emulation State
66h       Get Read Event Queue