Overview Overview

Total Page:16

File Type:pdf, Size:1020Kb

Overview Overview Essential Linux Device Drivers by Sreekrishnan Venkateswaran Publisher: Prentice Hall Pub Date: March 27, 2008 Print ISBN-10: 0-13-239655-6 Print ISBN-13: 978-0-13-239655-4 Pages: 744 Table of Contents | Index Overview "Probably the most wide ranging and complete Linux device driver book I've read." --Alan Cox, Linux Guru and Key Kernel Developer "Very comprehensive and detailed, covering almost every single Linux device driver type." --Theodore Ts'o, First Linux Kernel Developer in North America and Chief Platform Strategist of the Linux Foundation The Most Practical Guide to Writing Linux Device Drivers Linux now offers an exceptionally robust environment for driver development: with today's kernels, what once required years of development time can be accomplished in days. In this practical, example-driven book, one of the world's most experienced Linux driver developers systematically demonstrates how to develop reliable Linux drivers for virtually any device. Essential Linux Device Drivers is for any programmer with a working knowledge of operating systems and C, including programmers who have never written drivers before. Sreekrishnan Venkateswaran focuses on the essentials, bringing together all the concepts and techniques you need, while avoiding topics that only matter in highly specialized situations. Venkateswaran begins by reviewing the Linux 2.6 kernel capabilities that are most relevant to driver developers. He introduces simple device classes; then turns to serial buses such as I2C and SPI; external buses such as PCMCIA, PCI, and USB; video, audio, block, network, and wireless device drivers; user-space drivers; and drivers for embedded Linux–one of today's fastest growing areas of Linux development. For each, Venkateswaran explains the technology, inspects relevant kernel source files, and walks through developing a complete example. • Addresses drivers discussed in no other book, including drivers for I2C, video, sound, PCMCIA, and different types of flash memory • Demystifies essential kernel services and facilities, including kernel threads and helper interfaces • Teaches polling, asynchronous notification, and I/O control • Introduces the Inter-Integrated Circuit Protocol for embedded Linux drivers • Covers multimedia device drivers using the Linux-Video subsystem and Linux-Audio framework • Shows how Linux implements support for wireless technologies such as Bluetooth, Infrared, WiFi, and cellular networking • Describes the entire driver development lifecycle, through debugging and maintenance • Includes reference appendixes covering Linux assembly, BIOS calls, and Seq files Essential Linux Device Drivers by Sreekrishnan Venkateswaran Publisher: Prentice Hall Pub Date: March 27, 2008 Print ISBN-10: 0-13-239655-6 Print ISBN-13: 978-0-13-239655-4 Pages: 744 Table of Contents | Index Copyright Prentice Hall Open Source Software Development Series Foreword Preface Acknowledgments About the Author Chapter 1. Introduction Evolution The GNU Copyleft Kernel.org Mailing Lists and Forums Linux Distributions Looking at the Sources Building the Kernel Loadable Modules Before Starting Chapter 2. A Peek Inside the Kernel Booting Up Kernel Mode and User Mode Process Context and Interrupt Context Kernel Timers Concurrency in the Kernel Process Filesystem Allocating Memory Looking at the Sources Chapter 3. Kernel Facilities Kernel Threads Helper Interfaces Looking at the Sources Chapter 4. Laying the Groundwork Introducing Devices and Drivers Interrupt Handling The Linux Device Model Memory Barriers Power Management Looking at the Sources Chapter 5. Character Drivers Char Driver Basics Device Example: System CMOS Sensing Data Availability Talking to the Parallel Port RTC Subsystem Pseudo Char Drivers Misc Drivers Character Caveats Looking at the Sources Chapter 6. Serial Drivers Layered Architecture UART Drivers TTY Drivers Line Disciplines Looking at the Sources Chapter 7. Input Drivers Input Event Drivers Input Device Drivers Debugging Looking at the Sources Chapter 8. The Inter-Integrated Circuit Protocol What's I2C/SMBus? I2C Core Bus Transactions Device Example: EEPROM Device Example: Real Time Clock I2C-dev Hardware Monitoring Using LM-Sensors The Serial Peripheral Interface Bus The 1-Wire Bus Debugging Looking at the Sources Chapter 9. PCMCIA and Compact Flash What's PCMCIA/CF? Linux-PCMCIA Subsystem Host Controller Drivers PCMCIA Core Driver Services Client Drivers Tying the Pieces Together PCMCIA Storage Serial PCMCIA Debugging Looking at the Sources Chapter 10. Peripheral Component Interconnect The PCI Family Addressing and Identification Accessing PCI Regions Direct Memory Access Device Example: Ethernet-Modem Card Debugging Looking at the Sources Chapter 11. Universal Serial Bus USB Architecture Linux-USB Subsystem Driver Data Structures Enumeration Device Example: Telemetry Card Class Drivers Gadget Drivers Debugging Looking at the Sources Chapter 12. Video Drivers Display Architecture Linux-Video Subsystem Display Parameters The Frame Buffer API Frame Buffer Drivers Console Drivers Debugging Looking at the Sources Chapter 13. Audio Drivers Audio Architecture Linux-Sound Subsystem Device Example: MP3 Player Debugging Looking at the Sources Chapter 14. Block Drivers Storage Technologies Linux Block I/O Layer I/O Schedulers Block Driver Data Structures and Methods Device Example: Simple Storage Controller Advanced Topics Debugging Looking at the Sources Chapter 15. Network Interface Cards Driver Data Structures Talking with Protocol Layers Buffer Management and Concurrency Control Device Example: Ethernet NIC ISA Network Drivers Asynchronous Transfer Mode Network Throughput Looking at the Sources Chapter 16. Linux Without Wires Bluetooth Infrared WiFi Cellular Networking Current Trends Chapter 17. Memory Technology Devices What's Flash Memory? Linux-MTD Subsystem Map Drivers NOR Chip Drivers NAND Chip Drivers User Modules MTD-Utils Configuring MTD eXecute In Place The Firmware Hub Debugging Looking at the Sources Chapter 18. Embedding Linux Challenges Component Selection Tool Chains Embedded Bootloaders Memory Layout Kernel Porting Embedded Drivers The Root Filesystem Test Infrastructure Debugging Chapter 19. Drivers in User Space Process Scheduling and Response Times Accessing I/O Regions Accessing Memory Regions User Mode SCSI User Mode USB User Mode I2C UIO Looking at the Sources Chapter 20. More Devices and Drivers ECC Reporting Frequency Scaling Embedded Controllers ACPI ISA and MCA FireWire Intelligent Input/Output Amateur Radio Voice over IP High-Speed Interconnects Chapter 21. Debugging Device Drivers Kernel Debuggers Kernel Probes Kexec and Kdump Profiling Tracing Linux Test Project User Mode Linux Diagnostic Tools Kernel Hacking Config Options Test Equipment Chapter 22. Maintenance and Delivery Coding Style Change Markers Version Control Consistent Checksums Build Scripts Portable Code Chapter 23. Shutting Down Checklist What Next? Appendix A. Linux Assembly Debugging Appendix B. Linux and the BIOS Real Mode Calls Protected Mode Calls BIOS and Legacy Drivers Appendix C. Seq Files The Seq File Advantage Updating the NVRAM Driver Looking at the Sources Index Copyright Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The author and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales (800) 382-3419 [email protected] For sales outside the United States please contact: International Sales [email protected] Visit us on the Web: www.informit.com/ph Library of Congress Cataloging-in-Publication Data: Venkateswaran, Sreekrishnan, 1972- Essential Linux device drivers / Sreekrishnan Venkateswaran.-- 1st ed. p. cm. ISBN 0-13-239655-6 (hardback : alk. paper) 1. Linux device drivers (Computer programs) I. Title. QA76.76.D49V35 2008 005.4'32--dc22 2008000249 Copyright © 2008 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to: Pearson Education, Inc Rights and Contracts Department 501 Boylston Street, Suite 900 Boston, MA 02116 Fax (617) 671 3447 This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). ISBN-13: 978-0-132-39655-4 Text printed in the United States on recycled paper at RR Donnelly in Crawfordsville, IN. First printing March
Recommended publications
  • FAI.Me a Build Service for Installation Images and Cloud Images
    FAI.me A Build Service for Installation Images and Cloud Images Thomas Lange, Debian Developer and sysadmin at the University of Cologne [email protected] MiniDebConf Hamburg 2018 1/19 finger Mrfai@localhost ◮ whoami ◮ Sysadmin for more than two and a half decades ◮ Debian developer since 2000 ◮ Diploma in computer science, University of Bonn, Germany ◮ SunOS 4.1.1 on SPARC hardware, then Solaris Jumpstart ◮ Started FAI in 1999 for my first cluster (16× Dual PII 400 MHz) ◮ Several talks and tutorials: Linux Kongress, Linuxtag, DebConf, SANE, LCA, FOSDEM, CeBit, OSDC, UKUUG, FrOSCon, Chemnitzer Linuxtag ◮ FAI trainings 2/19 Motivation ◮ Debian installer is not that easy for beginners ◮ Also FAI is not for beginners ◮ How to make FAI usable for beginners? 3/19 The idea ◮ An installer should cover the most usual installations ◮ Ignore the special cases ◮ Do only ask the really important questions ◮ Ask everything at the beginning ◮ Create a customized installation media ◮ Boot this installation media and get yourself a coffee ◮ Ready! 4/19 FAI ◮ FAI = Fully Automatic Installation ◮ FAI is a tool for experienced sysadmins ◮ You have to adjust the config files to your local needs ◮ How to make FAI usable for beginners? FAI.me 5/19 FAI.me 6/19 FAI.me ◮ Easy creation of the installation media (CD/USB stick) ◮ Customizations are easy to do (clicks on a web page) ◮ Lanuage, user name and pw, root pw ◮ Select one of the common desktops ◮ Additional packages ◮ Distributions: stable, stable+backports, testing 7/19 Some more advanced features ◮ A couple of different partitioning variants ◮ SSH key for root login ◮ Use your github account (ssh pub key) for the root login ◮ Add one public available repository 8/19 FAI.me for the cloud ◮ Cloud Images ◮ Get your customized cloud image by just a few clicks ◮ Disk size ◮ Disk image format (raw.xz, raw.zst, qcow2, vmdk,...) ◮ Hostname 9/19 FAI.me more ideas ◮ Make web page dynamic: easy mode Thanks Juri! ◮ Images for non-amd64 archs ◮ Other distributions (e.g.
    [Show full text]
  • Ubuntu Kung Fu
    Prepared exclusively for Alison Tyler Download at Boykma.Com What readers are saying about Ubuntu Kung Fu Ubuntu Kung Fu is excellent. The tips are fun and the hope of discov- ering hidden gems makes it a worthwhile task. John Southern Former editor of Linux Magazine I enjoyed Ubuntu Kung Fu and learned some new things. I would rec- ommend this book—nice tips and a lot of fun to be had. Carthik Sharma Creator of the Ubuntu Blog (http://ubuntu.wordpress.com) Wow! There are some great tips here! I have used Ubuntu since April 2005, starting with version 5.04. I found much in this book to inspire me and to teach me, and it answered lingering questions I didn’t know I had. The book is a good resource that I will gladly recommend to both newcomers and veteran users. Matthew Helmke Administrator, Ubuntu Forums Ubuntu Kung Fu is a fantastic compendium of useful, uncommon Ubuntu knowledge. Eric Hewitt Consultant, LiveLogic, LLC Prepared exclusively for Alison Tyler Download at Boykma.Com Ubuntu Kung Fu Tips, Tricks, Hints, and Hacks Keir Thomas The Pragmatic Bookshelf Raleigh, North Carolina Dallas, Texas Prepared exclusively for Alison Tyler Download at Boykma.Com Many of the designations used by manufacturers and sellers to distinguish their prod- ucts are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC.
    [Show full text]
  • Open Source Projects As Incubators of Innovation
    RESEARCH CONTRIBUTIONS TO ORGANIZATIONAL SOCIOLOGY AND INNOVATION STUDIES / STUTTGARTER BEITRÄGE ZUR ORGANISATIONS- UND INNOVATIONSSOZIOLOGIE SOI Discussion Paper 2017-03 Open Source Projects as Incubators of Innovation From Niche Phenomenon to Integral Part of the Software Industry Jan-Felix Schrape Institute for Social Sciences Organizational Sociology and Innovation Studies Jan-Felix Schrape Open Source Projects as Incubators of Innovation. From Niche Phenomenon to Integral Part of the Software Industry. SOI Discussion Paper 2017-03 University of Stuttgart Institute for Social Sciences Department of Organizational Sociology and Innovation Studies Seidenstr. 36 D-70174 Stuttgart Editor Prof. Dr. Ulrich Dolata Tel.: +49 711 / 685-81001 [email protected] Managing Editor Dr. Jan-Felix Schrape Tel.: +49 711 / 685-81004 [email protected] Research Contributions to Organizational Sociology and Innovation Studies Discussion Paper 2017-03 (May 2017) ISSN 2191-4990 © 2017 by the author(s) Jan-Felix Schrape is senior researcher at the Department of Organizational Sociology and Innovation Studies, University of Stuttgart (Germany). [email protected] Additional downloads from the Department of Organizational Sociology and Innovation Studies at the Institute for Social Sciences (University of Stuttgart) are filed under: http://www.uni-stuttgart.de/soz/oi/publikationen/ Abstract Over the last 20 years, open source development has become an integral part of the software industry and a key component of the innovation strategies of all major IT providers. Against this backdrop, this paper seeks to develop a systematic overview of open source communities and their socio-economic contexts. I begin with a recon- struction of the genesis of open source software projects and their changing relation- ships to established IT companies.
    [Show full text]
  • SUSE BU Presentation Template 2014
    TUT7317 A Practical Deep Dive for Running High-End, Enterprise Applications on SUSE Linux Holger Zecha Senior Architect REALTECH AG [email protected] Table of Content • About REALTECH • About this session • Design principles • Different layers which need to be considered 2 Table of Content • About REALTECH • About this session • Design principles • Different layers which need to be considered 3 About REALTECH 1/2 REALTECH Software REALTECH Consulting . Business Service Management . SAP Mobile . Service Operations Management . Cloud Computing . Configuration Management and CMDB . SAP HANA . IT Infrastructure Management . SAP Solution Manager . Change Management for SAP . IT Technology . Virtualization . IT Infrastructure 4 About REALTECH 2/2 5 Our Customers Manufacturing IT services Healthcare Media Utilities Consumer Automotive Logistics products Finance Retail REALTECH Consulting GmbH 6 Table of Content • About REALTECH • About this session • Design principles • Different layers which need to be considered 7 The Inspiration for this Session • Several performance workshops at customers • Performance escalations at customer who migrated from UNIX (AIX, Solaris, HP-UX) to Linux • Presenting the experiences made at these customers in this session • Preventing the audience from performance degradation caused from: – Significant design mistakes – Wrong architecture assumptions – Having no architecture at all 8 Performance Optimization The False Estimation Upgrading server with CPUs that are 12.5% faster does not improve application
    [Show full text]
  • Communicating Between the Kernel and User-Space in Linux Using Netlink Sockets
    SOFTWARE—PRACTICE AND EXPERIENCE Softw. Pract. Exper. 2010; 00:1–7 Prepared using speauth.cls [Version: 2002/09/23 v2.2] Communicating between the kernel and user-space in Linux using Netlink sockets Pablo Neira Ayuso∗,∗1, Rafael M. Gasca1 and Laurent Lefevre2 1 QUIVIR Research Group, Departament of Computer Languages and Systems, University of Seville, Spain. 2 RESO/LIP team, INRIA, University of Lyon, France. SUMMARY When developing Linux kernel features, it is a good practise to expose the necessary details to user-space to enable extensibility. This allows the development of new features and sophisticated configurations from user-space. Commonly, software developers have to face the task of looking for a good way to communicate between kernel and user-space in Linux. This tutorial introduces you to Netlink sockets, a flexible and extensible messaging system that provides communication between kernel and user-space. In this tutorial, we provide fundamental guidelines for practitioners who wish to develop Netlink-based interfaces. key words: kernel interfaces, netlink, linux 1. INTRODUCTION Portable open-source operating systems like Linux [1] provide a good environment to develop applications for the real-world since they can be used in very different platforms: from very small embedded devices, like smartphones and PDAs, to standalone computers and large scale clusters. Moreover, the availability of the source code also allows its study and modification, this renders Linux useful for both the industry and the academia. The core of Linux, like many modern operating systems, follows a monolithic † design for performance reasons. The main bricks that compose the operating system are implemented ∗Correspondence to: Pablo Neira Ayuso, ETS Ingenieria Informatica, Department of Computer Languages and Systems.
    [Show full text]
  • Linux Kernel and Driver Development Training Slides
    Linux Kernel and Driver Development Training Linux Kernel and Driver Development Training © Copyright 2004-2021, Bootlin. Creative Commons BY-SA 3.0 license. Latest update: October 9, 2021. Document updates and sources: https://bootlin.com/doc/training/linux-kernel Corrections, suggestions, contributions and translations are welcome! embedded Linux and kernel engineering Send them to [email protected] - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 1/470 Rights to copy © Copyright 2004-2021, Bootlin License: Creative Commons Attribution - Share Alike 3.0 https://creativecommons.org/licenses/by-sa/3.0/legalcode You are free: I to copy, distribute, display, and perform the work I to make derivative works I to make commercial use of the work Under the following conditions: I Attribution. You must give the original author credit. I Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one. I For any reuse or distribution, you must make clear to others the license terms of this work. I Any of these conditions can be waived if you get permission from the copyright holder. Your fair use and other rights are in no way affected by the above. Document sources: https://github.com/bootlin/training-materials/ - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 2/470 Hyperlinks in the document There are many hyperlinks in the document I Regular hyperlinks: https://kernel.org/ I Kernel documentation links: dev-tools/kasan I Links to kernel source files and directories: drivers/input/ include/linux/fb.h I Links to the declarations, definitions and instances of kernel symbols (functions, types, data, structures): platform_get_irq() GFP_KERNEL struct file_operations - Kernel, drivers and embedded Linux - Development, consulting, training and support - https://bootlin.com 3/470 Company at a glance I Engineering company created in 2004, named ”Free Electrons” until Feb.
    [Show full text]
  • On the Performance Variation in Modern Storage Stacks
    On the Performance Variation in Modern Storage Stacks Zhen Cao1, Vasily Tarasov2, Hari Prasath Raman1, Dean Hildebrand2, and Erez Zadok1 1Stony Brook University and 2IBM Research—Almaden Appears in the proceedings of the 15th USENIX Conference on File and Storage Technologies (FAST’17) Abstract tions on different machines have to compete for heavily shared resources, such as network switches [9]. Ensuring stable performance for storage stacks is im- In this paper we focus on characterizing and analyz- portant, especially with the growth in popularity of ing performance variations arising from benchmarking hosted services where customers expect QoS guaran- a typical modern storage stack that consists of a file tees. The same requirement arises from benchmarking system, a block layer, and storage hardware. Storage settings as well. One would expect that repeated, care- stacks have been proven to be a critical contributor to fully controlled experiments might yield nearly identi- performance variation [18, 33, 40]. Furthermore, among cal performance results—but we found otherwise. We all system components, the storage stack is the corner- therefore undertook a study to characterize the amount stone of data-intensive applications, which become in- of variability in benchmarking modern storage stacks. In creasingly more important in the big data era [8, 21]. this paper we report on the techniques used and the re- Although our main focus here is reporting and analyz- sults of this study. We conducted many experiments us- ing the variations in benchmarking processes, we believe ing several popular workloads, file systems, and storage that our observations pave the way for understanding sta- devices—and varied many parameters across the entire bility issues in production systems.
    [Show full text]
  • Software Wars, Business Strategies and IP Litigation
    Software Wars, Business Strategies and IP Litigation Immediately after Oracle America filed a patent infringement suit against Google Inc. in August 2010 the trade press labelled this a “software war.” Their interest was a trial featuring Oracle’s “star” counsel David Boies. In mid-January often cited Florian Mueller of NoSoftwarePatents, wrote “Google is patently too weak to protect Android—Google’s cell phone software.”1 (On April 4 Lead bidder Google offered $900 million for Nortel’s 6,000 patents and applications. A decision is expected in June}. By the end of March he had counted 39 patent infringement suits against Google.2 Whether Oracle wins Oracle v Google or not, Oracle and IBM may become losers. It is important that Oracle not alienate the software development community or its customers as it attempts to monetise the assets from the Sun Microsystems—now Oracle America— acquisition. The Oracle v. Google complaint was carefully targeted at Google’s Android software, avoiding the appearance of monetising the Java language and platform itself. The Android software was developed as open source in conjunction with the Open Handset Alliance. Android's mobile operating system is based on a modified version of the Linux kernel, subject to Linux patents. Google published all of the computer code under an Apache Software Foundation License.3 This license is royalty-free and places no restrictions on derivative products or commercial use. Based on IDC market share estimates by the fourth quarter of 2010, Android phones had 39% of the market. An Oracle asset gained through the acquisition of Sun was the OpenOffice open-source software—one of the only remaining substantial “competitors” to Microsoft’s document processing applications.
    [Show full text]
  • Vytvoření Softwareově Definovaného Úložiště Pro Potřeby Ukládání a Sdílení Dat V Rámci Instituce a Jeho Zálohování Do Datových Úložišť Cesnet
    Slezská univerzita v Opavě Centrum informačních technologií Vysoká škola báňská – Technická univerzita Ostrava Fakulta elektrotechniky a informatiky Technická zpráva k projektu 529R1/2014 Vytvoření softwareově definovaného úložiště pro potřeby ukládání a sdílení dat v rámci instituce a jeho zálohování do datových úložišť Cesnet Řešitel: Ing. Jiří Sléžka Spoluřešitelé: Mgr. Jan Nosek, Ing. Pavel Nevlud, Ing. Marek Dvorský, Ph.D., Ing. Jiří Vychodil, Ing. Lukáš Kapičák Leden 2016 Obsah 1 Popis projektu...................................................................................................................................1 2 Cíle projektu.....................................................................................................................................1 3 Volba HW a SW komponent.............................................................................................................1 3.1 Hardware...................................................................................................................................1 3.2 GlusterFS..................................................................................................................................2 3.2.1 Replicated GlusterFS Volume...........................................................................................2 3.2.2 Distributed GlusterFS Volume..........................................................................................3 3.2.3 Striped Glusterfs Volume..................................................................................................3
    [Show full text]
  • Developing and Benchmarking Native Linux Applications on Android
    Developing and Benchmarking Native Linux Applications on Android Leonid Batyuk, Aubrey-Derrick Schmidt, Hans-Gunther Schmidt, Ahmet Camtepe, and Sahin Albayrak Technische Universit¨at Berlin, 10587 Berlin, Germany {aubrey.schmidt,leonid.batyuk,hans-gunther.schmidt,ahmet.camtepe, sahin.albayrak}@dai-labor.de http://www.dai-labor.de Abstract. Smartphones get increasingly popular where more and more smartphone platforms emerge. Special attention was gained by the open source platform Android which was presented by the Open Handset Al- liance (OHA) hosting members like Google, Motorola, and HTC. An- droid uses a Linux kernel and a stripped-down userland with a custom Java VM set on top. The resulting system joins the advantages of both environments, while third-parties are intended to develop only Java ap- plications at the moment. In this work, we present the benefit of using native applications in Android. Android includes a fully functional Linux, and using it for heavy computational tasks when developing applications can bring in substantional performance increase. We present how to develop native applications and software components, as well as how to let Linux appli- cations and components communicate with Java programs. Additionally, we present performance measurements of native and Java applications executing identical tasks. The results show that native C applications can be up to 30 times as fast as an identical algorithm running in Dalvik VM. Java applications can become a speed-up of up to 10 times if utilizing JNI. Keywords: software, performance, smartphones, android, C, Java. 1 Introduction With the growing customer interest in smartphones the number of available platforms increases steadily.
    [Show full text]
  • 60 External USB Hard Drive KNOW-HOW 60
    KNOW-HOW Ask Klaus! ASK KLAUS! during unmounting, and lost data results I edit an existing script that already on a frequent basis when I disconnect comes with Fedora 7 (as used by the the device. desktop), to resolve the problem? Or is The drive heads are not stopped ei- this behavior compiled in? Klaus Knopper is the creator of ther, and a strange whirring chirp sound I believe the “eject” feature used by Knoppix and co-founder of the occurs when unplugging the drive while Gnome is only meant for flash memory the platters are still spinning. drives such as USB keys, where there is LinuxTag expo. He currently I searched Google and found a shell no concept of flushing the data in RAM script to properly unmount the drive, to the magnetic storage medium and works as a teacher, program- and it uses a tool called sdparm to sync stopping the heads, and hence it is a mer, and consultant. If you have and stop the drive heads before physi- rather simple solution for unmounting cally disconnecting the USB hard drive. I that is not suitable for external portable a configuration problem, or if did not have sdparm installed by default hard drives. from my Fedora 7 distribution (obtained Thanks in advance for considering this you just want to learn more through a Linux Magazine DVD) and Linux hardware challenge. about how Linux works, send had to search and install the tool myself using the package manager. (Zenity mes- The quite long script you sent your questions to: sage boxes also had to be installed for can be reduced to (more or less) this script.) this skeleton: klaus@linux-magazine.
    [Show full text]
  • Buffered FUSE: Optimising the Android IO Stack for User-Level Filesystem
    Int. J. Embedded Systems, Vol. 6, Nos. 2/3, 2014 95 Buffered FUSE: optimising the Android IO stack for user-level filesystem Sooman Jeong and Youjip Won* Hanyang University, #507-2, Annex of Engineering Center, 17 Haengdang-dong, Sungdong-gu, Seoul, 133-791, South Korea E-mail: [email protected] E-mail: [email protected] *Corresponding author Abstract: In this work, we optimise the Android IO stack for user-level filesystem. Android imposes user-level filesystem over native filesystem partition to provide flexibility in managing the internal storage space and to maintain host compatibility. The overhead of user-level filesystem is prohibitively large and the native storage bandwidth is significantly under-utilised. We overhauled the FUSE layer in the Android platform and propose buffered FUSE (bFUSE) to address the overhead of user-level filesystem. The key technical ingredients of buffered FUSE are: 1) extended FUSE IO size; 2) internal user-level write buffer; 3) independent management thread which performs time-driven FUSE buffer synchronisation. With buffered FUSE, we examined the performances of five different filesystems and three disk scheduling algorithms in a combinatorial manner. With bFUSE on XFS filesystem using the deadline scheduling, we achieved the IO performance improvements of 470% and 419% in Android ICS and JB, respectively, over the existing smartphone device. Keywords: Android; storage; user-level filesystem; FUSE; write buffer; embedded systems. Reference to this paper should be made as follows: Jeong, S. and Won, Y. (2014) ‘Buffered FUSE: optimising the Android IO stack for user-level filesystem’, Int. J. Embedded Systems, Vol. 6, Nos.
    [Show full text]