Click here to skip to this page's main content.

New Feature: You can now embed Open Library books on your website!   Learn More
Last edited by Grayskull Master
November 15, 2015 | History

Writing OS/2 Warp Device Drivers in C 1 edition

Writing OS/2 Warp Device Drivers in C
Steven J. Mastrianni

Read eBook


Download Options


Buy this book

Add an ISBN in order to
link to booksellers


Alack! There's no description for this book yet. Can you help?
There is only 1 edition record, so we'll show it here...  •  Add edition?

Writing OS/2 Warp Device Drivers in C

Published 1997 by Van Nostrand Reinhold .

Table of Contents

Writing OS/2 Warp Device Drivers in C.......................................................................1
Third Edition................................................................................................................1
Chapter 1 - The Evolution of PC Device Drivers ..........................................................33
Storage Devices................................................................................................34
Interface Adapter Cards....................................................................................35
The First Operating System For Personal Computers ........................................36
The First Bus....................................................................................................38
Chapter 2 - Understanding Device Drivers....................................................................41
Device Drivers Today.......................................................................................44
Device Drivers - A Summary ............................................................................46
Chapter 3 - The PC Hardware Architecture..................................................................49
The System Bus................................................................................................49
The IBM PC - Beginnings.................................................................................50
IBM PC XT......................................................................................................51
IBM PC AT......................................................................................................52
The AT Bus......................................................................................................53
The IBM PS/2 and Micro Channel....................................................................54
Enhanced Industry Standard Architecture (EISA) .............................................56
Bus Wars..........................................................................................................57
Real Mode........................................................................................................57
Protect Mode ...................................................................................................58
Using Addresses and Pointers ...........................................................................61
The Ring Architecture ......................................................................................61
Chapter 4 - An Overview of the OS/2 Operating System ..............................................65
Roots ...............................................................................................................66
Processes and Threads......................................................................................69
OS/2 1.0 - OS/2 Arrives ...................................................................................71
OS/2 1.1 - Presentation Manager Arrives..........................................................71
10
OS/2 1.2 - A Better File System........................................................................71
OS/2 1.3 – IBM’s First Solo Effort...................................................................73
OS/2 2.0- What OS/2 Was Really Meant to Be .................................................73
The OS/2 Application Programming Interface...................................................75
Chapter 5 - The Anatomy of an OS/2 Device Driver.....................................................77
Application-to-Driver Interface.........................................................................77
DOS Device Drivers and OS/2 Device Drivers..................................................78
Designing an OS/2 Device Driver .....................................................................79
Tools Necessary For Driver Development.........................................................79
The Basics of Driver Design .............................................................................80
Request Packets ...............................................................................................81
OS/2 Device Driver Architecture ......................................................................82
Device Driver Modes........................................................................................83
The Device Header ...........................................................................................85
Capabilities Bit Strip.........................................................................................87
Providing a Low-Level Interface.......................................................................88
The Strategy Section ........................................................................................94
Initialization......................................................................................................96
A Common Strategy.........................................................................................98
Interrupt Section...............................................................................................99
The Timer Handler ...........................................................................................105
Context Hooks .................................................................................................106
Chapter 6 - Device Driver Strategy Commands ............................................................109
Summary of Device Driver Commands .............................................................112
0h / Init.............................................................................................................115
1H/ Media Check..............................................................................................120
2H / Build BPB ................................................................................................122
4H, 8H, 9H / Read or Write..............................................................................125
5H / Nondestructive Read No Wait...................................................................127
6H, AH / Input or Output Status.......................................................................128
7H, BH / Input Flush or Output Flush...............................................................129
DH,EH / Open or Close....................................................................................130
FH / Removable Media .....................................................................................131
1OH / Generic IOCtl ........................................................................................132
11
11H / Reset Media............................................................................................134
12H, 13H / Get/Set Logical Drive.....................................................................134
14H / Deinstall..................................................................................................136
16H / Partitionable Fixed Disks.........................................................................137
17H / Get Fixed Disk/Logical Unit Map............................................................138
1CH / Shutdown...............................................................................................139
1DH/ Get Driver Capabilities............................................................................140
1FH / CMDInitComplete ..................................................................................141
Chapter 7 - A Simple OS/2 Physical Device Driver.......................................................143
Device Driver Specifications.............................................................................143
Application Program Design .............................................................................144
Device Driver Operation...................................................................................144
INIT.................................................................................................................145
OPEN...............................................................................................................146
CLOSE ............................................................................................................147
IOCtls ..............................................................................................................148
CASE 0x01 ......................................................................................................149
CASE 0x02 ......................................................................................................150
CASE 0x03 ......................................................................................................152
READ and WRITE...........................................................................................153
Timer Handler ..................................................................................................154
Chapter 8 - The Micro Channel Bus .............................................................................157
Micro Channel Adapter Cards...........................................................................157
Micro Channel Adapter ID ...............................................................................158
Accessing the POS Register During Debug.......................................................164
Micro Channel Interrupts..................................................................................164
Chapter 9 - OS/2 Warp Virtual Device Drivers.............................................................167
The Virtual DOS Machine ................................................................................168
VDD Architecture ............................................................................................170
VDD Initialization ............................................................................................171
DOS Settings....................................................................................................173
DOS Settings Registration ................................................................................174
The Virtual COM Device Driver.......................................................................175
The Virtual Timer Device Driver ......................................................................177
The Virtual Disk Device Driver ........................................................................179
The Virtual Keyboard Device Driver.................................................................181
The Virtual Mouse Device Driver .....................................................................182
The Virtual Line Printer Device Driver .............................................................183
The Virtual Video Device Driver ......................................................................183
Virtual DevHlp Services By Category...............................................................185
DOS Session Interrupts ....................................................................................198
Sample Virtual Device Driver ...........................................................................203
Establishing a VDD-PDD Link .........................................................................212
Chapter 10 - Memory-Mapped Adapters and IOPL ......................................................215
High and Low Memory Maps ...........................................................................215
Application Program Access To Adapter Memory ............................................216
Access to Adapter Memory In the Interrupt Handler.........................................218
Input/Output Privilege Level (IOPL).................................................................219
The IOPL Segment...........................................................................................220
IOPL From 32-bit Applications.........................................................................223
Chapter 11 - Direct Memory Access (DMA) ................................................................225
The DMA Controller ........................................................................................225
Using DMA......................................................................................................230
DMA and Micro Channel..................................................................................234
Chapter 12 - Extended Device Driver Interface ............................................................237
Device Driver Capabilities ................................................................................237
Request Lists and Request Control ...................................................................241
Request Format ................................................................................................243
Read/Write/Write Verify Request .....................................................................248
Read Prefetch Request......................................................................................249
Request Control Functions................................................................................250
SetFSDInfo ......................................................................................................251
ChgPriority.......................................................................................................252
SetRestPos .......................................................................................................252
GetBoundary ....................................................................................................252
Chapter 13 - Debugging OS/2 Device Drivers ..............................................................255
KDB Keywords................................................................................................257
KDB Operators ................................................................................................259
KDB Command Reference................................................................................261
Internal Commands...........................................................................................264
External Commands..........................................................................................283
Chapter 14 - OS/2 Display Drivers ...............................................................................295
Device Context.................................................................................................297
Data Types .......................................................................................................298
Instance Data....................................................................................................299
Program Stack..................................................................................................299
DLL Functions .................................................................................................299
Presentation Driver Design Considerations .......................................................300
Presentation Driver Errors ................................................................................301
Presentation Driver Error Codes.......................................................................302
Additional Presentation Driver Functions..........................................................303
Chapter 15 - OS/2 Printer Drivers ................................................................................305
Chapter 16 - Working With Pointers ............................................................................307
C Set/2 and C Set++.........................................................................................307
Virtual Addresses .............................................................................................310
Pointers In A VDM ..........................................................................................311
Chapter 17 - PCMCIA Device Drivers .........................................................................313
The PCMCIA Software Trilogy........................................................................314
OS/2 Warp PCMCIA Initialization....................................................................315
Client Device Driver Architecture .....................................................................317
OS/2 Warp Restrictions ....................................................................................319
Card Services Functions ...................................................................................319
Calling Card Services........................................................................................322
Callbacks..........................................................................................................323
Chapter 18 - OS/2 File System Device Drivers .............................................................327
File System Overview .......................................................................................327
Eas, SEAs, FEAs, and GEAs............................................................................329
FSD Interfaces..................................................................................................331
FSD Exported Functions ..................................................................................331
The Bootable IFS .............................................................................................331
The Mini File System........................................................................................331
Mini File System Exported Functions................................................................331
HPFS ...............................................................................................................331
A Sample File System Driver ............................................................................332
Chapter 19 - The OS/2 SCSI Device Driver Architecture .............................................333
The OS/2 DMD................................................................................................334
ASPI ................................................................................................................335
ADD Driver Design..........................................................................................340
IORBs..............................................................................................................341
Filters ...............................................................................................................342
Chapter 20 - CDROMs and Optical Disks ....................................................................343
The CDROM Device Manager..........................................................................343
The CDROM ADD ..........................................................................................343
Non-SCSI CDROMs ........................................................................................343
CDROM Filters ................................................................................................344
Chapter 21 - Keyboard And Mouse Drivers..................................................................345
Keyboard Device Driver Architecture ...............................................................345
Mouse Device Driver Architecture....................................................................345
Chapter 22 - OS/2 Warp SMP Drivers .........................................................................347
OS/2 SMP Architecture....................................................................................347
The OS/2 SMP Scheduler.................................................................................350
Interrupts..........................................................................................................351
Platform Specific Drivers..................................................................................352
Platform Specific Driver Architecture ...............................................................352
PSD Contexts (Modes).....................................................................................354
Terms...............................................................................................................357
PSD Function Glossary.....................................................................................357
PSD Helpers.....................................................................................................369
PSD APIs.........................................................................................................374
Device Drivers For OS/2 SMP..........................................................................376
OS/2 SMP DevHlps..........................................................................................377
OS/2 SMP Applications....................................................................................377
Avoiding Device Driver Deadlocks ...................................................................399
The Single Processor Utility Program ...............................................................402
Chapter 23 - Plug and Play...........................................................................................403
ISA PnP Hardware ...........................................................................................405
PnP BIOS.........................................................................................................412
ISA PnP Isolation .............................................................................................412
Resource Data ..................................................................................................417
PnP Configuration ............................................................................................422
SCAM..............................................................................................................423
Chapter 24 - Tips and Techniques ................................................................................425
Appendix A - Device Helper Reference ........................................................................431
Device Helper Functions...................................................................................431
DevHlp Services and Device Contexts ..............................................................435
Device Helper Categories .................................................................................439
DevHlp Routines ..............................................................................................444
Appendix B - Reference Publications............................................................................561
Appendix C - Listings...................................................................................................563
Device Header, One Device ..............................................................................563
Device Header, Two Devices............................................................................563
C Startup Routine, One Device.........................................................................564
C Startup Routine, Four Devices ......................................................................566
Standard OS/2 Device Driver Include File.........................................................567
Skeleton Strategy Section.................................................................................579
Sample IOCtl Call, 16-Bit.................................................................................580
Sample IOCtl Call, 32-Bit.................................................................................580
Sample Interrupt Handler..................................................................................581
Sample Timer Handler ......................................................................................583
Simple OS/2 Parallel Physical Device Driver .....................................................584
C Startup Routine for Parallel Device Driver ....................................................590
Parallel Device Driver Include File....................................................................591
Parallel Device Driver Make File.......................................................................591
Parallel Device Driver DEF File ........................................................................591
Sample OS/2 Serial Device Driver ....................................................................592
Serial Device Driver Make File .........................................................................604
Serial Device Driver DEF File...........................................................................604
Sample C Callable DevHlp Interface .................................................................605
C Callable Debugger Breakpoint.......................................................................606
Data Transfer Routine ......................................................................................607
Sample DMA Routines.....................................................................................609
Obtaining POS Register Contents .....................................................................617
ABIOS Specific Include File .............................................................................618
IOPL Routine For 16-Bit and 32-Bit Applications ............................................619
IOPL Routine Make File...................................................................................620
IOPL Routine DEF File ....................................................................................620
IOPL Test Program, 16-Bit ..............................................................................620
IOPL Test Program Make File, 16-Bit ..............................................................621
IOPL Test Program DEF File, 16-Bit................................................................621
IOPL Test Program, 32-Bit ..............................................................................621
IOPL Test Program Make File, 32-Bit ..............................................................622
IOPL Test Program DEF File, 32-Bit................................................................622
Device Driver For Memory-Mapped Adapters ..................................................622
Memory-Mapped Device Driver DEF File ........................................................631
Memory-Mapped Device Driver Make File .......................................................631
Memory-Mapped Device Driver Header File.....................................................631
Memory-Mapped Device Driver Test Program - 16-Bit ....................................633
Memory-Mapped Test Program Header File - 16-Bit ........................................634
Memory-Mapped Test Program Def File - 16-Bit..............................................634
Memory-Mapped Test Program Make File - 16-Bit ..........................................634
Memory-Mapped Test Program - 32-Bit, 16-Bit Pointers .................................635
Memory-Mapped Test Program DEF File - 32-Bit............................................636
Memory-Mapped Test Program Make File - 32-Bit ..........................................636
Memory-Mapped Test Program - 32-Bit, 32-Bit Pointers .................................636
Memory-Mapped Test Program DEF File - 32-Bit............................................638
Memory-Mapped Test Program Make File - 32-Bit ..........................................638
Macros .............................................................................................................638
Appendix D - OEMHLP AND TESTCFG....................................................................657
TESTCFG........................................................................................................689
17
Appendix E - The OS/2 Resource Manager ..................................................................695
Making Your Device Driver Resource Manager Aware ....................................720
The RMVIEW Utility .......................................................................................722
RESERVE.SYS ...............................................................................................725
Index............................................................................................................................727
Library Order Form......................................................................................................729

ID Numbers

Open Library
OL25849465M
Internet Archive
WritingOS2WarpDeviceDriversInC

History Created November 15, 2015 · 1 revision Download catalog record: RDF / JSON

November 15, 2015 Created by Grayskull Master Added new book.