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