
Diploma ThesisUniversity of Applied Sciences AugsburgDepartment of Computer ScienceInput Abstraction LayerDesign and Implementation of an Extended Inp
CHAPTER 1. AN INTRODUCTION TO LINUX INPUT 3Recent laptops offer various features like dynamic CPU frequency and adjustment of screenbrightness to save
ABBREVIATIONS 93HIDPHuman Interface Device ProtocolIPCInterprocess CommunicationL2CAPLogical Link Control and Adaptation ProtocolLCDLiquid Crystal Dis
GlossaryAdvanced Configuration and Power InterfaceThe Advanced Configuration and Power Interface (ACPI) specification is an open in-dustry standard devel
GLOSSARY 95HotplugHotplug lets you plug in new devices and use them immediately. That means that userswon’t need to learn so much system administratio
BibliographyPrint Publications[CSF04] Ben Collins-Sussman, Brian W. Fitzpatrick, C. Michael Pilato. VersionControl with Subversion. O’Reilly. June 200
BIBLIOGRAPHY 97Online Ressources[Acp04] Hewlett-Packard Corporation, Intel Corporation, Microsoft Corporation,Phoenix Technologies Ltd., Toshiba Corpo
BIBLIOGRAPHY 98[Ros04] Lawrence E. Rosen. The Academic Free License v. 2.1. Mai 2004. (Availablefrom http://www.rosenlaw.com/afl21.htm)[Sig04] Bluetoo
INDEX 99IndexAACPI . . . . . . . . . . . . . . . . . . . . . . . . 11 – 14, 52 f, 94buttons . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
INDEX 100Panasonic Hotkey Driver (ACPI) . . 14, 81Sony Programmable I/O . . . . . . . . . . . . . 14 fToshiba (ACPI) . . . . . . . . . . . . . . . . .
INDEX 101Gnome Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67GNU Autotools . . . . . . . . . . . . . . . . . . . . . . . . . . .
INDEX 102keycode . . . . . . . . . . . . . . . . . . . . . see keycodescancode . . . . . . . . . . . . . . . . . . . see scancodeSun Type 4 . . . . .
CHAPTER 1. AN INTRODUCTION TO LINUX INPUT 4Throughout the text the notation term(n ) indicates that a reference manual is available forterm. The value
INDEX 103Sourceforge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66statistical calculations. . . . . . . . . . . . . . . . . . . . .
Chapter 2Drivers and InterfacesThis chapter discusses the available input device drivers and their user space interfaces. Severalparts of the Linux ke
CHAPTER 2. DRIVERS AND INTERFACES 6Input DeviceInput DeviceInput DeviceInput DeviceDevice DriverDevice DriverDevice DriverInput CoreEvent HandlerEvent
CHAPTER 2. DRIVERS AND INTERFACES 7event to the input core, are named input event. Once an input device driver has reportedan event by calling input e
CHAPTER 2. DRIVERS AND INTERFACES 8events. The input events carry the scancodes, the event handler keyboard.c translates thescancodes to their corresp
CHAPTER 2. DRIVERS AND INTERFACES 9USB HC USB HCI USB HIDInput CoreUSB HID InputUSB DeviceUSB DeviceUSB DeviceUSB DeviceUSB Device DriverUSB Device Dr
CHAPTER 2. DRIVERS AND INTERFACES 10Bluetooth devices (“BT Devices”) are connected to a Bluetooth host controller (“BT HC”)which is attached to the sy
CHAPTER 2. DRIVERS AND INTERFACES 11To enable the event interface the Linux kernel has to be compiled with INPUT EVDEV=y orINPUT EVDEV=m. The driver e
CHAPTER 2. DRIVERS AND INTERFACES 12reading from the ACPI event interface, the bus driver generates the actual ACPI event. AnACPI event has the follow
Diploma ThesisUniversity of Applied Sciences AugsburgDepartment of Computer ScienceI affirm that the diploma thesis is my own work and has never been us
CHAPTER 2. DRIVERS AND INTERFACES 13Input Event DriversDrivers which are using the ACPI bus driver to report input events are the Asus/Medion ACPIdriv
CHAPTER 2. DRIVERS AND INTERFACES 14ACPI EventDriverACPI BusDriverPower ButtonSleep ButtonLid SwitchOther InputProc FilesystemACPI Button Driver/proc/
CHAPTER 2. DRIVERS AND INTERFACES 15set to 0x80, the value of data depends on which hotkey is pressed. E.g. the hotkey combinationFn-F4 creates the fo
Chapter 3Requirements SpecificationThe requirements specification is the basis upon which the design and architecture, as wellas the implementation of t
CHAPTER 3. REQUIREMENTS SPECIFICATION 17Driver/Interface name: Event InterfaceUser space interface: /dev/input/eventn (minor 13, major 64+n)Data type:
CHAPTER 3. REQUIREMENTS SPECIFICATION 18User space interface: /dev/i8k (minor 10, major 144)Driver/Interface name: Dell SMM DriverData type: stringPer
CHAPTER 3. REQUIREMENTS SPECIFICATION 193.2 Functional RequirementsThe functional requirements are derived from the current problems regarding user in
CHAPTER 3. REQUIREMENTS SPECIFICATION 203.3 Performance RequirementsAs mentioned in the introduction of this chapter, the Input Abstraction Layer is a
Chapter 4Design and ArchitectureThis chapter describes the Input Abstraction Layer’s design and architecture. It connects therequirements specification
CHAPTER 4. DESIGN AND ARCHITECTURE 22User Action Input DeviceHardware EventSoftware Eventa)b)c)Driver User Interface ApplicationUser Action Input Devi
Input Abstraction LayerTimo H¨onig
CHAPTER 4. DESIGN AND ARCHITECTURE 23AllowOverride and Order are options for the directive Directory with their correspondingvalues.<Directory &quo
CHAPTER 4. DESIGN AND ARCHITECTURE 24First, the configuration file is parsed and the included options are set. Secondly, thecommand line arguments are e
CHAPTER 4. DESIGN AND ARCHITECTURE 25Figure 4.3 shows the modular input interface. Incoming input events are shown as dottedarrows on the left of the
CHAPTER 4. DESIGN AND ARCHITECTURE 26the project lead. This emphasizes the will of implementing an independent IPC framework,that does not displease a
Chapter 5ImplementationThis chapter describes the implementation of the Input Abstraction Layer in detail. The actualprocess of the implementation was
CHAPTER 5. IMPLEMENTATION 28The subsequent sections of this chapter separately discuss the implementation of the threecomponents. Important attributes
CHAPTER 5. IMPLEMENTATION 29Modules use the structure IalEvent in conjunction with a wrapper function to reportabstract input events. The library libi
CHAPTER 5. IMPLEMENTATION 30the first purposed hole in the deny policy: it allows all processes to connect to the systembus. Further, the D-BUS daemon
CHAPTER 5. IMPLEMENTATION 31/* Check whether D-BUS connection is already established. */if (dbus_connection == NULL) {/* Connect to the D-BUS system m
CHAPTER 5. IMPLEMENTATION 32dbus message new signal() creates a new DBusMessage of type SIGNAL and returns a pointerto the created structure. The argu
c° 2004, 2005 Timo H¨onigAll rights reserved.Timo H¨onig, Johannes-Haag-Straße 2, D-86153 Augsburg08 07 06 05 04 6 5 4 3 2First edition: 15. December
CHAPTER 5. IMPLEMENTATION 33void event_callback(DBusConnection *connection, DBusMessage *dbus_message,void *user_data){/* Create abstract input event.
CHAPTER 5. IMPLEMENTATION 34org) which is released under the terms of the Academic Free License version 2.0. The loggingsystem is implemented by libia
CHAPTER 5. IMPLEMENTATION 35The do {...} while(0) loop is run once and encapsulates the invocation of log setup()and log output(). Without this encaps
CHAPTER 5. IMPLEMENTATION 36Data StructureBoth data structures ModuleData and ModuleOption are declared in libial mod.h. Thestructure ModuleData is sl
CHAPTER 5. IMPLEMENTATION 37ModuleOption mod_options[] = {{"disable", "false", "disable=(true|false)"},{"verbose&qu
CHAPTER 5. IMPLEMENTATION 38When an input event occurs, the module reports this event by creating an abstract inputevent IalEvent followed by a call t
CHAPTER 5. IMPLEMENTATION 39Each stage is realized by a specific component of the Input Abstraction Layer daemon.Functions for the first and fifth stage
CHAPTER 5. IMPLEMENTATION 40pass all checks performed by the module loader’s functions to be accepted as a valid InputAbstraction Layer module.mod_sca
CHAPTER 5. IMPLEMENTATION 41be subsequently invoked, since function references the module’s function mod get data().Once called, it returns the requir
CHAPTER 5. IMPLEMENTATION 42Configuration File ParserThe Input Abstraction Layer’s daemon configuration is stored in /etc/ial/iald.conf. It isformatted
ContentsContents i1 An Introduction to Linux Input 11.1 Current State of Input Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.2 Obje
CHAPTER 5. IMPLEMENTATION 43module = module_list_head;/* Iterate all modules, start at the list head. */while(module) {if(node.token == module.token)
CHAPTER 5. IMPLEMENTATION 44additional arguments, e.g. program -d 3 (program --debug 3) with 3 being the argumentfor the command line option -d (--deb
CHAPTER 5. IMPLEMENTATION 45These functions are responsible for evaluating the supplied configuration options. The InputAbstraction Layer’s most imp or
CHAPTER 5. IMPLEMENTATION 46The string mod options consists of one or more strings with the format mod option. Thefunction opt modules opts() parses t
CHAPTER 5. IMPLEMENTATION 47which is requested for creation. No additional flags are passed since the third argument isset to 0. If the D-BUS daemon is
CHAPTER 5. IMPLEMENTATION 48Event LoopThe start up of the daemon is completed by entering the main event loop. This event loopis implemented by the GL
CHAPTER 5. IMPLEMENTATION 49which should be observed. The second argument states the conditions that have to be metto trigger an event. In the example
CHAPTER 5. IMPLEMENTATION 50gap by reporting all input events of keyboards—whether there is a translation available for akey’s scancode or not. The so
CHAPTER 5. IMPLEMENTATION 51– Generate an abstract input event– Send the abstract input eventReading data from the event interface returns a structure
CHAPTER 5. IMPLEMENTATION 52Once the data structure is filled, the module sends the abstract input event by callingthe library’s function event send().
CONTENTS ii4 Design and Architecture 214.1 Event Data Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214.2 Daemon . . . .
CHAPTER 5. IMPLEMENTATION 53default the module is enabled. Further, the loading function initializes the user space interfaceof the ACPI subsystem if
CHAPTER 5. IMPLEMENTATION 54The member raw is not available for ACPI events since they have no numeric representation.Hence, the value of raw is set t
CHAPTER 5. IMPLEMENTATION 55is similar to the translation of a scancode value to its corresponding description. The valuesfor the function events rece
Chapter 6Requirements VerificationThis chapter compares the achieved goals with the requirements specification defined in Chap-ter 3. First, the verificat
CHAPTER 6. REQUIREMENTS VERIFICATION 576.2 PerformanceThe performance requirements specify that the Input Abstraction Layer should only use areasonabl
CHAPTER 6. REQUIREMENTS VERIFICATION 58Figure 6.1 gives an overview of the time needed by an input event to reach a user spaceapplication. The user ac
CHAPTER 6. REQUIREMENTS VERIFICATION 59The variable event jiffies of type unsigned long is initialized with a zero. To makethe variable accessible to
CHAPTER 6. REQUIREMENTS VERIFICATION 60open("/proc/ial_event_received", O_RDONLY);This system call causes iallatency to store the current ji
CHAPTER 6. REQUIREMENTS VERIFICATION 61The second test series was performed measuring the time intervals for ACPI buttons.Figure 6.3 shows the results
CHAPTER 6. REQUIREMENTS VERIFICATION 62limit of ttotal= 25ms is not exceeded, the measurement series’ maximum of t2under highsystem load is used:ttota
CONTENTS 1B Survey: Current State of Linux Input Devices 72B.1 Announcement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Chapter 7Open Source DevelopmentMethodologyThe Input Abstraction Layer is entirely built upon Free and Open Source Software (FOSS).On the one hand, it
CHAPTER 7. OPEN SOURCE DEVELOPMENT METHODOLOGY 647.1 LicensesAll FOSS projects are released under the terms of a FOSS license. Both the free softwarem
CHAPTER 7. OPEN SOURCE DEVELOPMENT METHODOLOGY 65This is the actual citation of Paragraph 10 of the Academic Free License. This clause shouldprevent a
CHAPTER 7. OPEN SOURCE DEVELOPMENT METHODOLOGY 66A software project always needs a decent documentation—for both end users and develop-ers. The Input
CHAPTER 7. OPEN SOURCE DEVELOPMENT METHODOLOGY 67– Freshmeat, http://www.freshmeat.net– Gnome Files, http://www.gnomefiles.org–KDE Apps,http://www.kde
Chapter 8ConclusionThe creation of the Input Abstraction Layer helps GNU/Linux to fulfill the users’ claim foran operating system that just works. Due
CHAPTER 8. CONCLUSION 69Beside the study of source code, it was essential to spot the edge conditions the resultingprogram will run in. These edge con
Appendix AUtilized Free and Open SourceSoftwareThe diploma thesis has been accomplished using free and open source software exclusively. Thischapter c
APPENDIX A. UTILIZED FREE AND OPEN SOURCE SOFTWARE 71A.3 Statistical CalculationsBoth the survey (Appendix B) and the latency measurements (Chapter 6,
Appendix BSurvey: Current State of LinuxInput DevicesThe survey “Current State of Linux Input Devices” has b een completed by 305 participants.The dur
Chapter 1An Introduction to Linux InputThe Linux kernel offers drivers for a vast number of different input devices—drivers for key-boards, mice, joysti
APPENDIX B. SURVEY: CURRENT STATE OF LINUX INPUT DEVICES 73SVN: http://svn.berlios.de/viewcvs/ial/This e-mail was sent to the following mailing lists:
APPENDIX B. SURVEY: CURRENT STATE OF LINUX INPUT DEVICES 74Question 3 (single choice, mandatory): Where do you use Linux?Field of Application0.00% 20.
APPENDIX B. SURVEY: CURRENT STATE OF LINUX INPUT DEVICES 75Question 7 (multiple choice, mandatory): Which window manager(s) do you prefer?0.00% 20.00%
APPENDIX B. SURVEY: CURRENT STATE OF LINUX INPUT DEVICES 76B.3 Desktop SystemsQuestions asked in this section are about keyboards used on desktop syst
APPENDIX B. SURVEY: CURRENT STATE OF LINUX INPUT DEVICES 77B.4 Laptop SystemsQuestions asked in this section are about built-in keyboards used on mobi
APPENDIX B. SURVEY: CURRENT STATE OF LINUX INPUT DEVICES 78B.5 Demand of FeaturesQuestions asked in this section are about features demanded by the pa
APPENDIX B. SURVEY: CURRENT STATE OF LINUX INPUT DEVICES 79Question 19 (single choice, optional): Would you like to be able to change the screenbright
Appendix CLinux Function Key Support forLaptopsChapter 2 discusses several Linux input device driver for mobile computers. The subsequentlists contain
APPENDIX C. LINUX FUNCTION KEY SUPPORT FOR LAPTOPS 81– Latitude C400, C510, C600, C610, C800, C810, C840, CPiA, CPx J750GT, D600, D800and X200C.4 Hewl
APPENDIX C. LINUX FUNCTION KEY SUPPORT FOR LAPTOPS 82C.8 Toshiba ACPI Driver– Toshiba Libretto L5W– Toshiba Portege 2000, 2010, 3440CT, 4000, 7020CT a
CHAPTER 1. AN INTRODUCTION TO LINUX INPUT 21.1 Current State of Input DevicesThe answers to the questions regarding desktop keyboards (Appendix B, §B.
Appendix DSource CodeThe printed edition the diploma thesis is supplemented by a CD-ROM. This CD-ROM containsthe source code of the Linux kernel versi
APPENDIX D. SOURCE CODE 84CD-ROM:Linux 2.6.9 (unpacked, unmodified):/linux/linux-2.6.9Linux 2.6.9 (unpacked, with IAL Latency patch):/linux/linux-2.6.9
APPENDIX D. SOURCE CODE 85If the source code is obtained using Subversion, it is required to run ./autogen.sh priorto ./configure. The last command ma
APPENDIX D. SOURCE CODE 86The kernel has to be recompiled with the configuration option INPUT IALLATENCY eitherset to y (compile static) or m (compile
Appendix ECopyrightCopyrightc° 2004, 2005 Timo H¨onigAll rights reserved.The diploma thesis is licensed under the Creative Commons Attribution License
APPENDIX E. COPYRIGHT 88E.2 Legal CodeCreative Commons – Legal Code Attribution 2.0CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PRO-VID
APPENDIX E. COPYRIGHT 892. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arisingfrom fair use, first sa
APPENDIX E. COPYRIGHT 90b. If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or anyDerivative Works or Col
APPENDIX E. COPYRIGHT 91by the parties to this agreement, such provision shall be reformed to the minimum extent necessaryto make such provision valid
AbbreviationsACPIAdvanced Configuration and Power InterfaceAFLAcademic Free LicenseAGPLAffero General Public LicenseCLICommand Line InterfaceCRTCathode
Kommentare zu diesen Handbüchern