Input Abstraction Layer
Total Page:16
File Type:pdf, Size:1020Kb
Diploma Thesis University of Applied Sciences Augsburg Department of Computer Science Input Abstraction Layer Design and Implementation of an Extended Input Interface Submitted by Timo H¨onig,Winter Semester 2004/2005 Examiner: Prof. Dr. Hubert H¨ogl Examiner: Prof. Burkhard Stork Supervisor: Dipl. Inf. (univ.) Stefan Behlert The Diploma Thesis has been created in cooperation with SUSE Linux AG, Nuremberg. Diploma Thesis University of Applied Sciences Augsburg Department of Computer Science I affirm that the diploma thesis is my own work and has never been used before, for any auditing purposes. All used sources, additional used information and citations are quoted as such. Timo H¨onig Input Abstraction Layer Timo H¨onig °c 2004, 2005 Timo H¨onig All rights reserved. Timo H¨onig,Johannes-Haag-Straße 2, D-86153 Augsburg 08 07 06 05 04 6 5 4 3 2 First edition: 15. December 2004 Second impression, with corrections: 9. January 2005 This work is licensed under the Creative Commons Attribution License. To view a copy of this license, visit http://creativecommons.org/licenses/by/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. All terms mentioned in this work that are known to be trademarks or service marks have been appropriately capitalized. The author cannot attest to the accuracy of this information. Use of a term in this work should not be regarded as affecting the validity of any trademark or service mark. Contents Contents i 1 An Introduction to Linux Input 1 1.1 Current State of Input Devices . 2 1.2 Objective . 3 1.3 Overview of the Diploma Thesis . 3 2 Drivers and Interfaces 5 2.1 Input Core . 5 2.2 Keyboard Device Drivers . 7 2.3 USB Input Device Drivers . 8 2.4 Bluetooth Input Device Drivers . 9 2.5 Event Interface . 10 2.6 Advanced Configuration and Power Interface . 11 Button Driver . 12 Input Event Drivers . 13 Subsystem Overview . 13 2.7 Other Interfaces . 14 3 Requirements Specification 16 3.1 Required Interfaces . 16 Input Event Interface . 16 ACPI Event Interface . 17 Specific Event Interfaces . 17 Output Interface . 18 3.2 Functional Requirements . 19 Unattended Input Events . 19 Elimination of Barriers . 19 Unified Data Representation . 19 Permanent Interface . 19 Independent Interface . 19 3.3 Performance Requirements . 20 3.4 Quality Attributes . 20 3.5 Security Attributes . 20 i CONTENTS ii 4 Design and Architecture 21 4.1 Event Data Flow . 21 4.2 Daemon . 22 4.3 Modular Input Interface . 24 4.4 Abstract Output Interface . 25 5 Implementation 27 5.1 Common Data Structures . 28 5.2 Library . 29 D-BUS . 29 Programming Interface . 30 Logging System . 33 5.3 Modules . 35 Data Structure . 36 Input Events . 37 5.4 Daemon . 38 Module Loader . 39 Configuration File Parser . 42 Command Line Interface . 43 D-BUS . 46 Module Invocation . 47 Event Loop . 48 5.5 Event Interface Module . 49 5.6 ACPI Module . 52 5.7 Toshiba Module . 54 6 Requirements Verification 56 6.1 Functional Achievements . 56 6.2 Performance . 57 6.3 Quality and Security . 62 7 Open Source Development Methodology 63 7.1 Licenses . 64 7.2 Tools and Services . 65 7.3 Collaborative Environment . 66 8 Conclusion 68 8.1 Achievements . 68 8.2 Future Work . 69 A Utilized Free and Open Source Software 70 A.1 Typesetting . 70 A.2 Figures . 70 A.3 Statistical Calculations . 71 A.4 Survey . 71 CONTENTS 1 B Survey: Current State of Linux Input Devices 72 B.1 Announcement . 72 B.2 General . 73 B.3 Desktop Systems . 76 B.4 Laptop Systems . 77 B.5 Demand of Features . 78 C Linux Function Key Support for Laptops 80 C.1 Acer System Management Mode Driver . 80 C.2 Asus/Medion ACPI Driver . 80 C.3 Dell System Management Mode Driver . 80 C.4 Hewlett Packard OmniBook Driver . 81 C.5 IBM ThinkPad ACPI Driver . 81 C.6 IBM ThinkPad (NVRAM) . 81 C.7 Panasonic ACPI Driver . 81 C.8 Toshiba ACPI Driver . 82 C.9 Toshiba System Management Mode Driver . 82 D Source Code 83 D.1 Linux Kernel . 83 D.2 Input Abstraction Layer . 84 D.3 Latency Kernel Driver . 85 E Copyright 87 E.1 Commons Deed . 87 E.2 Legal Code . 88 Abbreviations 92 Glossary 94 Bibliography 96 Print Publications . 96 Online Ressources . 97 Chapter 1 An Introduction to Linux Input The Linux kernel offers drivers for a vast number of different input devices—drivers for key- boards, mice, joysticks, touch screens and others. Even though, many of these input devices can not be used with the GNU/Linux operating system. This severe problem is caused by input device drivers’ varying implementations: they are not following a common standard. It is in the nature of the process how free and open source development evolves by the course of time. Most developers implement device drivers in their sole discretion, only a few are following common approaches. The increasing number of input devices are connected in many different ways which results in a numerous amount of device drivers. For example, most function keys found on mobile computers follow an entirely different approach for processing input events than regular keyboards. All keys—no matter how they are connected to the system—are in- tended to trigger input events which can be utilized. However, applications are not prepared to receive input events from all the interfaces offered by the input device drivers. The project outcome resulting from this diploma thesis solves the problem by creating an abstraction layer—the Input Abstraction Layer. The Input Abstraction Layer represents a framework unifying input events of the different input device.