CONTENTS Title Page Copyright Page Preface 1 Introduction 1.1 About This Manual 1.2 DECwindows Architecture 1.3 DECwindows Device Drivers 1.3.1 Features Supported by the Device Drivers 1.4 Driver Architecture 1.4.1 Driver/Server Interface 1.4.2 Common Driver Function 1.4.3 Class/Port Input Driver Function 1.4.4 Output Driver Function 2 Common Driver/Server Interface 2.1 Driver/Server Common Buffer 2.1.1 Input Queue and Motion History Buffer 2.1.2 Input Queue Event Packet 2.1.3 Queue Processing of Input 2.2 $QIO Common Interface 2.3 $QIO Calls to DECwindows Drivers $QIO System Service 2.4 Sense-Mode Calls Get Device Information Sense Cursor Bounds Sense Keyboard Information Sense Keyboard LED Sense Motion Compression Sense Operator Window Key Sense Pointer Acceleration Sense Pseudomouse Key Sense Screen Saver Timeout 2.5 Set-Mode Calls Enable Input Initialize Motion Buffer Ring Keyboard Bell Set Attach Screen Set Cursor Bounds Set Cursor Pattern Set Cursor Position Set Keyboard Information Set Keyboard LED Set Motion Compression Set Operator Window Key Set Pointer Acceleration Set Pseudomouse Key Set Screen Saver Timeout Write X Event 3 Writing a Class Input Driver 3.1 Overview of Class Input Driver 3.2 Class Driver Program Entry 3.3 Class Input Driver Routines CLASS_DDT CLASS_GETNXT CLASS_PUTNXT Controller Initialization Routine Unit Initialization Routine 4 Writing a Port Input Driver 4.1 Overview of Port Input Driver 4.2 Port Driver Program Entry 4.3 Port Input Driver Routines PORT_ABORT PORT_RESUME PORT_SET_LINE PORT_STARTIO Controller Initialization Routine Unit Initialization Routine 5 Common Driver 5.1 Overview of the Common Driver 5.2 Common Driver Program Entry 5.3 Common Driver Routines for Class Service COMMON_POS_CURSOR COMMON_SETUP_INPUT_UCB 5.4 Common Driver Routines for Output Service COMMON_SETUP_OUTPUT_UCB COMMON_VSYNC 5.5 Common Driver Vectored Data COMMON_DDT COMMON_FLAGS 5.6 Common Driver FDT Routines for $QIO Service 5.6.1 General 5.6.2 FDT Sense-Mode Routines 5.6.3 FDT Set-Mode Routines 5.6.4 FDT Output Routines 5.6.5 FDT Input Routine 6 Output Driver 6.1 Overview of the Output Driver 6.2 Output Driver Program Entry 6.3 Output Driver Routines 6.4 Queue Processing of Output 6.5 $QIO Output Interface 6.6 $QIO Calls to the Output Driver $QIO System Service 6.7 Output $QIO Calls Create GPD Queue GPB Packet Wait A Data Structures A.1 Device Information Block (DVI) A.2 Input Buffer Control Block (INB) A.3 Input Packet (INP) A.4 Keyboard Information Block (KIB) A.5 Motion History Buffer (MHB) A.6 Unit Control Block for Input Device A.6.1 UCB/DECwindows Common Input Extension (DWI) A.6.2 UCB/DECwindows Keyboard Input Extension (DWI) A.6.3 UCB/DECwindows Pointer Input Extension (DWI) A.7 Unit Control Block for Output Device A.7.1 UCB/DECwindows Common Output Extension (UCB/DECW) A.8 Class Vector Table A.9 Common Vector Table A.10 Port Vector Table A.11 Output Vector Table B Device Driver Macros B.1 General Device Driver Macros COMMON_CTRL_INIT COMMON_UNIT_INIT $DECW_COMMON_READY $DECWGBL B.2 Input Queue and Packet Processing Macros GET_FREE_KB_PACKET GET_LAST_EVENT_PACKET PUT_INPUT_ON_QUEUE B.3 Vector Table Generation Macros $VECINI $VEC $VECEND EXAMPLES 2-1 A Cursor Bit Pattern FIGURES 1-1 DECwindows Architecture 1-2 DECwindows Driver Architecture for Busless CPUs 1-3 DECwindows Driver Architecture for Q22-Bus CPUs 2-1 Input Buffer General Structure 2-2 Motion History Buffer General Structure 2-3 Queue Event Packet Format 2-4 Input Queue and Free Queue 2-5 Input Data Block of Calling Program A-1 Device Information Block (DVI) A-2 Input Buffer Control Block (INB) A-3 Input Packet Data Structure (INP) A-4 Keyboard Information Block A-5 Motion History Buffer Data Structure A-6 Unit Control Block General Structure A-7 UCB/DECwindows Common Input Extension A-8 UCB/DECwindows Keyboard Input Extension A-9 UCB/DECwindows Pointer Input Extension A-10 Unit Control Block Output Device General Structure A-11 UCB/DECwindows Common Output Extension A-12 Class Vector Table Data Structure A-13 Common Vector Table Data Structure A-14 Port Vector Table Data Structure TABLES 1-1 Driver Software/Hardware Relationship 2-1 Argument Data for Get Device Information $QIO Call 2-2 Argument Data for Sense Cursor Bounds $QIO Call 2-3 Argument Data for Sense Keyboard Information $QIO Call 2-4 Argument Data for Sense Keyboard LED $QIO Call 2-5 Argument Data for Sense Motion Compression $QIO Call 2-6 Argument Data for Sense Operator Window Key $QIO Call 2-7 Argument Data for Sense Pointer Acceleration $QIO Call 2-8 Argument Data for Sense Pseudomouse Key $QIO Call 2-9 Argument Data for Sense Screen Saver Timeout $QIO Call 2-10 Argument Data for Enable Input $QIO Call 2-11 Argument Data for Initialize Motion Buffer $QIO Call 2-12 Argument Data for Ring Keyboard Bell $QIO Call 2-13 Argument Data for Set Attach Screen $QIO Call 2-14 Argument Data for Set Cursor Bounds $QIO Call 2-15 Argument Data for Set Cursor Pattern $QIO Call 2-16 Argument Data for Set Cursor Position $QIO Call 2-17 Argument Data for Set Keyboard Information $QIO Call 2-18 Argument Data for Set Keyboard LED $QIO Call 2-19 Argument Data for Set Motion Compression $QIO Call 2-20 Argument Data for Set Operator Window Key $QIO Call 2-21 Argument Data for Set Pointer Acceleration $QIO Call 2-22 Argument Data for Set Pseudomouse Key $QIO Call 2-23 Argument Data for Set Screen Saver $QIO Call 2-24 Argument Data for Write X Event $QIO Call 2-25 Input Data Block Fields 5-1 Common Driver Services 5-2 Common Flags Longword 5-3 Registers Loaded by the $QIO System Service 5-4 Common Driver FDTs and Function Codes 6-1 Output Vector Table Routines 6-2 Argument Data for Create GPD $QIO Call 6-3 Argument Data for Queue GPB $QIO Call 6-4 Argument Data for the Packet Wait $QIO Call A-1 Device Information Block Fields A-2 Input Buffer Control Block Fields A-3 Input Packet Fields A-4 Keyboard Information Block Fields A-5 Motion History Buffer Fields A-6 UCB/DECwindows Common Input Extension Fields A-7 UCB/DECwindows Keyboard Input Extension Fields A-8 UCB/DECwindows Pointer Input Extension Fields A-9 UCB/DECwindows Common Output Extension Fields A-10 Class Vector Table Fields A-11 Common Vector Table Fields A-12 Port Vector Table Fields A-13 Output Vector Table Fields B-1 Structure Definition Macros Called by $DECWGBL