The Linux Kernel Hackers' Guide Has Changed Quite a Bit Since Its Original Conception Four Years Ago

Total Page:16

File Type:pdf, Size:1020Kb

The Linux Kernel Hackers' Guide Has Changed Quite a Bit Since Its Original Conception Four Years Ago The HyperNews Linux KHG Discussion Pages Linux Kernel Hackers' Guide Due to the fact that nearly every post to this site recently has been either by rude cracker- wannabes asking how to break into other people's systems or a request for basic technical support, posting to the KHG has been disabled, probably permanently. For now, you can read old posts, but you cannot send replies. In any case, there are now far better resources available. Go get the real thing! Alessandro Rubini wrote Linux Device Drivers, which is what the KHG could have been (maybe) but isn't. If you have a question and can't find the answer here, go get a copy of Linux Device Drivers and read it--chances are that when you are done, you will not need to ask a question here. Run, don't walk to get a copy of this book. The Linux Kernel Go read The Linux Kernel if you want an introduction to the Linux kernel that is better than the KHG. It is a great complement to Linux Device Drivers. Read it. Table of Contents Tour of the Linux Kernel This is a somewhat incomplete tour of the Linux Kernel, based on Linux 1.0.9 and the 1.1.x development series. Most of it is still relevant. Device Drivers The most common Linux kernel programming task is writing a new device driver. The great majority of the code in the kernel is new device drivers; between 1.2.13 and 2.0 the size of the source code more than doubled, and most of that was from adding device drivers. Filesystems Adding a filesystem to Linux doesn't have to involve magic... Linux Memory Management A few outdated documents, and one completely new one by David Miller on the Linux cache flush architecture. How System Calls Work on Linux/i86 Although this was written while Linux 0.99.2 was current, it still applies. A few filenames may need updating. find is your friend--just respond with the changes and they will be added. Other Sources of Information The KHG is just one collection of information about the Linux kernel. There are others! Membership and Subscription At the bottom of the page, you will notice two hyperlinks (among several others): Subscribe and Members. Using the KHG to its fullest involves these two hyperlinks, even though you are not required to be a member to read these pages and post responses. Membership HyperNews membership is site-wide. That is, you only need to sign up and become a member once for the entire KHG. It doesn't take much to be a member. Each member is identified by a unique name, which can either be a nickname or an email address. We suggest using your email address; that way it will be unique and easy to remember. On the other hand, you may want to choose a nickname if you expect to be changing your email address at any time. We also want your real name, email address, and home page (if you have one). You can give us your phone and address if you want. You will be asked to choose a password. You can change any of these items at any time by clicking on the Membership hyperlink again. Subscription Subscribing to a page puts you on a mailing list to be sent notification of any new responses to the page to which you are subscribed. You subscribe separately to each page in which you are interested by clicking the Subscription link on the page to which you want to subscribe. You are also subscribed, by default, to pages that you write. When you subscribe to a page, you subscribe to that page and all of its responses. Contributing Please respond to these pages if you have something to add. Think of posting a response rather like posting to an email list, except that an editor might occasionally come along to clean things up and/or put them in the main documents' bodies. So if you would post it to an email list in a similar discussion, it is probably appropriate to post here. In order to make reading these pages a pleasure for everyone, any incomprehensible, unrelated, outdated, abusive, or other completely unnecessary post may be removed by an administrator. So if you have a message that would be inappropriate on a mailing list, it's probably also inappropriate here. The administrators have the final say on what's appropriate. We don't expect this to become an issue... About the new KHG The Linux Kernel Hackers' Guide has changed quite a bit since its original conception four years ago. I struggled along with the help of many other hackers to produce a document that lived primarily on paper, and was intended to document the kernel in much the same way that a program's user guide is intended to document the program for users. It was less successful than most user guides, for a number of reasons: ● I was working on it part time, and was otherwise busy. ● The Linux kernel is a moving target. ● I am not personally capable of documenting the entire Linux kernel. ● I became far too concerned with making the typesetting pretty, getting bogged down in details and making the document typographically noisy at the same time. I floundered around, trying to be helpful, and made at least one right decision: most of the people who needed to read the old KHG needed to write device drivers, and the most fully-developed part of the KHG was the device driver section. There is a clear need for further development of the KHG, and it's clear that my making it a monolithic document stood in the way of progress. The KHG is now a series of more or less independent web pages, with places for readers to leave comments and corrections that can be incorporated in the document at the maintainer's leisure--and are available to readers before they are incorporated. The KHG is now completely web-based. There will be no official paper version. You need kernel source code nearby to read the KHG anyway, and I want to shift the emphasis from officially documenting the Linux kernel to being a learning resource about the Linux kernel--one that may well be useful to other people who want to document one part or another of the Linux kernel more fully, as well as to people who just want to hack the kernel. Enjoy! Copyright (C) 1996,1997 Michael K. Johnson, [email protected] Messages 349. Loading shared objects - How? by Wesley Terpstra 342. How can I see the current kernel configuration? by Melwin 1. My mouse no work in X windows by alfonso santana 340. The crash(1M) command in Linux? by Dmitry 338. Where can I gen detailed info on VM86 by Sebastien Plante 335. How to print floating point numbers from the kernel? by [email protected] 333. PS/2 Mouse Operating in Remote Mode by Andrei Racz 331. basic module by [email protected] 329. How to check if the user is local? by [email protected] 328. Ldt & Privileges by Ganesh 326. skb queues by Rahul Singh 323. Page locking (for DMA) and process termination? by Espen Skoglund 322. SMP code by [email protected] 319. Porting GC: Difficulties with pthreads by Talin 314. Linux for "Besta - 88"? by Dmitry 1. MVME147 Linux by Edward Tulupnikov 313. /proc/locks by Marco Morandini 310. syscall by [email protected] 308. How to run a bigger kernel ? by Kyung D. Ryu 300. Linux Terminal Device Driver by Nils Appeldoorn 1. Terminal DD by Doug McNash 297. DMA to user allocated buffer ? by Chris Read 1. allocator-example in A.Rubini's book by Thomas Sefzick 293. Patching problems by Maryam 1. Untitled by [email protected] 290. Ethernet Collision by jerome bonnet 1. Ethernet collisions by Juha Laine 289. Segmentation in Linux by Andrew Sampson 288. How can the kernel copy directly data from one process to another process? by Jürgen Zeller 1. Use the /Proc file system by [email protected] 286. Remapping Memory Buffer using vmalloc/vma_nopage by Brian W. Taylor 1. Fixed.... strncpy to blame by Brian W. Taylor 283. Does memory area assigned by "vmalloc()" get swapped to disk? by Saurabh Desai 1. Lock the pages in memory by [email protected] -> How about assigning a fixed size array...does it get swapped too? by saurabh desai 282. Creative Lab's DVD Encore by Brandon 274. TCP sliding window by Olivier 273. Packets and default route versus direct route by Steve Resnick 269. IPv6 description - QoS Implementation - 2 IP Queues by wehrle 2. See the kernel IPv4 implementation documentation by Juha Laine 268. writing to user file directly from kernel space, How can it be done? by Johan 267. how can i increase the number of processes running? by ElmerFudd 261. How do I change the amount of time a process is allowed before it is pre-empted? by [email protected] 260. Network device stops after a while by Andrew Ordin 1. Untitled by Andrew 259. Does MMAP work with Redhat 4.2? by Guy 1. Yes, it works just fine. by Michael K. Johnson 3. What about mprotect? by Sengan Baring-Gould 2. It Works! Thanks! by Guy 256. multitasking by Dennis J Perkins 1. Answer by David Welch -> multitasking by Dennis J Perkins -> answer by David Welch 247.
Recommended publications
  • Multimedia Modem Plus User's Guide
    MULTIMEDIA MODEM PLUS USER'S GUIDE FOR USAGE TO UPGRADE IBM MULTIMEDIA MODEM (MOD 715 P/N - 13H6715) FIRST EDITION (DECEMBER 1995) (C) COPYRIGHT INTERNATIONAL BUSINESS MACHINES CORPORATION 1995. ALL RIGHTS RESERVED. Note to U.S. Government Users -- Documentation related to restricted rights -- Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp. Page 1 of 47 Table of Contents ABOUT THIS BOOK................................................................................................................................................. 4 INTRODUCTION....................................................................................................................................................... 4 MWAVE SOFTWARE FEATURES........................................................................................................................ 5 BEFORE YOU BEGIN ............................................................................................................................................ 5 RELEASE INFORMATION .................................................................................................................................... 5 MINIMUM SYSTEM REQUIREMENTS ............................................................................................................... 6 PREPARING FOR SOFTWARE INSTALLATION .............................................................................................. 7 INSTALLING THE SOFTWARE...........................................................................................................................
    [Show full text]
  • Blackberry QNX Multimedia Suite
    PRODUCT BRIEF QNX Multimedia Suite The QNX Multimedia Suite is a comprehensive collection of media technology that has evolved over the years to keep pace with the latest media requirements of current-day embedded systems. Proven in tens of millions of automotive infotainment head units, the suite enables media-rich, high-quality playback, encoding and streaming of audio and video content. The multimedia suite comprises a modular, highly-scalable architecture that enables building high value, customized solutions that range from simple media players to networked systems in the car. The suite is optimized to leverage system-on-chip (SoC) video acceleration, in addition to supporting OpenMAX AL, an industry open standard API for application-level access to a device’s audio, video and imaging capabilities. Overview Consumer’s demand for multimedia has fueled an anywhere- o QNX SDK for Smartphone Connectivity (with support for Apple anytime paradigm, making multimedia ubiquitous in embedded CarPlay and Android Auto) systems. More and more embedded applications have require- o Qt distributions for QNX SDP 7 ments for audio, video and communication processing capabilities. For example, an infotainment system’s media player enables o QNX CAR Platform for Infotainment playback of content, stored either on-board or accessed from an • Support for a variety of external media stores external drive, mobile device or streamed over IP via a browser. Increasingly, these systems also have streaming requirements for Features at a Glance distributing content across a network, for instance from a head Multimedia Playback unit to the digital instrument cluster or rear seat entertainment units. Multimedia is also becoming pervasive in other markets, • Software-based audio CODECs such as medical, industrial, and whitegoods where user interfaces • Hardware accelerated video CODECs are increasingly providing users with a rich media experience.
    [Show full text]
  • Blackberry Playbook OS 2.0 Performs. Best in Class Communications
    BlackBerry PlayBook OS 2.0 Performs. Best in class communications. Powerful productivity. Performance powerhouse. What’s new and exciting about PlayBook™ OS 2.0 A proven performance powerhouse PlayBook OS 2.0 builds on proven performance through powerful hardware and intuitive, easy to use gestures. BlackBerry® PlayBook™ packs a blazing fast dual core processor, two HD 1080p video cameras, and 1 GB of RAM for a high performance experience that is up to the task – whatever it may be. The best of BlackBerry® comes built-in The BlackBerry PlayBook now gives you the BlackBerry communications experience you love, built for a tablet. PlayBook OS 2.0 introduces built-in email that lets you create, edit and format messages, and built-in contacts app and social calendar that connect to your social networks to give you a complete profile ™ of your contacts, including recent status updates. So, seize the BlackBerry App World moment and share it with the power of BlackBerry. The BlackBerry PlayBook has all your favorite apps and thousands more. Games like Angry Birds and Cut The Rope, BlackBerry® Bridge™ Technology social networking sites like Facebook, and even your favorite books from Kobo - the apps you want are here for you to New BlackBerry® Bridge™ features let your BlackBerry® smartphone discover in the BlackBerry AppWorld™ storefront. act as a keyboard and mouse for your BlackBerry PlayBook, giving you wireless remote control of your tablet. Perfect for pausing a movie when your BlackBerry PlayBook is connected to your TV with An outstanding web experience an HDMI connection. Plus, if you’re editing a document or browsing BlackBerry PlayBook puts the power of the real Internet at your a webpage on your BlackBerry smartphone and want to see it on a fingertips with a blazing fast Webkit engine supporting HTML5 larger display, BlackBerry Bridge lets you switch screens to view on and Adobe® Flash® 11.1.
    [Show full text]
  • QNX Neutrino® Realtime Operating System
    PRODUCT BRIEF QNX Neutrino® Realtime Operating System QNX Neutrino® is a full-featured and robust operating system designed to enable the next-generation of products for automotive, medical and industrial embedded systems. Microkernel design and modular architecture enable customers to create highly optimized and reliable systems with low total cost of ownership. With QNX Neutrino®, embedded systems designers can create compelling, safe and secure devices built on a highly reliable operating system software foundation that helps guard against system malfunctions, malware and cyber security breaches. For over 35 years, thousands of companies have deployed and The QNX Neutrino microkernel memory-protected architecture trusted QNX realtime technology to ensure the best combination provides a foundation to build safety-critical systems. QNX of performance, security and reliability in the world’s most Neutrino® is 100% API compatible with QNX pre-certified mission-critical systems. software products that address compliance with safety certifica- tions in automotive (ISO 26262), industrial safety (IEC 61508) and Built-in mission critical reliability medical devices (IEC 62304). Time-tested and field-proven, the QNX Neutrino® is built on a true microkernel architecture. Under this system, every driver, Maximize software investments application, protocol stack, and filesystem runs outside the kernel QNX Neutrino® provides a common software platform that can be in the safety of memory-protected user space. Virtually any deployed for safety certified and non-certified projects across a component can fail and be automatically restarted without broad range of hardware platforms. Organizations can reduce aecting other components or the kernel. No other commercial duplication, costs and risks associated with the deployment of RTOS provides such a high level of fault containment and recovery.
    [Show full text]
  • Automotive Foundational Software Solutions for the Modern Vehicle Overview
    www.qnx.com AUTOMOTIVE FOUNDATIONAL SOFTWARE SOLUTIONS FOR THE MODERN VEHICLE OVERVIEW Dear colleagues in the automotive industry, We are in the midst of a pivotal moment in the evolution of the car. Connected and autonomous cars will have a place in history alongside the birth of industrialized production of automobiles, hybrid and electric vehicles, and the globalization of the market. The industry has stretched the boundaries of technology to create ideas and innovations previously only imaginable in sci-fi movies. However, building such cars is not without its challenges. AUTOMOTIVE SOFTWARE IS COMPLEX A modern vehicle has over 100 million lines of code and autonomous vehicles will contain the most complex software ever deployed by automakers. In addition to the size of software, the software supply chain made up of multiple tiers of software suppliers is unlikely to have common established coding and security standards. This adds a layer of uncertainty in the development of a vehicle. With increased reliance on software to control critical driving functions, software needs to adhere to two primary tenets, Safety and Security. SAFETY Modern vehicles require safety certification to ISO 26262 for systems such as ADAS and digital instrument clusters. Some of these critical systems require software that is pre-certified up to ISO 26262 ASIL D, the highest safety integrity level. SECURITY BlackBerry believes that there can be no safety without security. Hackers accessing a car through a non-critical ECU system can tamper or take over a safety-critical system, such as the steering, brakes or engine systems. As the software in a car grows so does the attack surface, which makes it more vulnerable to cyberattacks.
    [Show full text]
  • QNX Software Systems Military, Security, and Defense
    QNX Software Systems Military, security, and defense Reliable, certified, secure, and mission-critical RTOS technology. Solution highlights Common Criteria certification § Common Criteria EAL 4+ certified QNX® OS for Security The QNX Neutrino OS for Security is for customers requiring § Inherently secure design with high availability framework, adaptive Common Criteria ISO/IEC 15408 certification. Certified to EAL 4+, partitioning technology, and predictable and deterministic this is the first full-featured RTOS certified under the Common behavior Criteria standard. The QNX Neutrino OS for Security also benefits from the operating system’s inherent reliability and failure- § Non-stop operation with microkernel architecture and full proof design. memory protection § Standards-based design for security and easy interoperability Military-grade security and reliability of networked applications In mission-critical government and military systems where Advanced graphics for 3D visualization, mapping, ruggedized § information is vital and lives can be at stake, downtime is not an and multi-headed visual display systems, and multi-language option. The need for a highly reliable, secure, and fast operating support system is crucial. § Rich ecosystem of technology partners providing solutions for vehicle busses, databases, navigation, connectivity, graphics, Thanks to the true microkernel architecture of the QNX Neutrino® and speech processing RTOS, full memory protection is built in. Any component can fail § Comprehensive middleware offering that includes multimedia and be dynamically restarted without corrupting the microkernel management, rich HMIs with Adobe Flash Lite, and acoustic or other components. If a failure does occur, a QNX-based echo cancellation system has the capability for self-healing through critical process monitoring and customizable recovery mechanisms.
    [Show full text]
  • Linux Kernal II 9.1 Architecture
    Page 1 of 7 Linux Kernal II 9.1 Architecture: The Linux kernel is a Unix-like operating system kernel used by a variety of operating systems based on it, which are usually in the form of Linux distributions. The Linux kernel is a prominent example of free and open source software. Programming language The Linux kernel is written in the version of the C programming language supported by GCC (which has introduced a number of extensions and changes to standard C), together with a number of short sections of code written in the assembly language (in GCC's "AT&T-style" syntax) of the target architecture. Because of the extensions to C it supports, GCC was for a long time the only compiler capable of correctly building the Linux kernel. Compiler compatibility GCC is the default compiler for the Linux kernel source. In 2004, Intel claimed to have modified the kernel so that its C compiler also was capable of compiling it. There was another such reported success in 2009 with a modified 2.6.22 version of the kernel. Since 2010, effort has been underway to build the Linux kernel with Clang, an alternative compiler for the C language; as of 12 April 2014, the official kernel could almost be compiled by Clang. The project dedicated to this effort is named LLVMLinxu after the LLVM compiler infrastructure upon which Clang is built. LLVMLinux does not aim to fork either the Linux kernel or the LLVM, therefore it is a meta-project composed of patches that are eventually submitted to the upstream projects.
    [Show full text]
  • Security & Work Remotely on Any Device – Employees Everywhere Management for Any Device Personal Or Corporate Owned ORDER
    Opening Remarks Mark Wilson CMO John McClurg CISO Agenda 11:00 am Opening Remarks 11:50 am Protecting Things Mark Wilson & John Wall John McClurg 12:10 pm Technology Platform 11:10 am Protecting & Managing Eric Cornelius Endpoints Nigel Thompson 12:30 pm Go-To-Market David Castignola 11:30 am Protecting People 12:45 pm Closing Remarks Ramon J. Pinero John Chen & David Wiseman #BlackBerrySecure © 2020© 2018 BlackBerry. BlackBerry. All All Rights Rights Reserved. Reserved. 3 Business Continuity during a Global Pandemic I can’t communicate with Workers can’t go to the Phishing attacks are my remote employees office increasing New threat surfaces with Volume of threats mobile & IoT CHAOS Complexity – number of The human factor vendors & solutions We don’t have enough I need to keep my Our VPNs are overloaded laptops to send to users business running Crisis communication for all Unified Endpoint Security & Work remotely on any device – employees everywhere Management for any device personal or corporate owned ORDER Intelligent Security that reduces Future proof platform that will Secure network access on a friction and improves user support the next generation of BYOL without needing a VPN experience endpoints Business Continuity During Global Pandemic Business Continuity Business Endpoint Security Working From Continuity & Management Home Business Continuity CIO | CISO End User Manager During Global Pandemic Business Continuity Plan Crisis Communications System Execute WFH Continuity Plan Notify Employees at the Office Reach 1000’s Workers
    [Show full text]
  • Sound-HOWTO.Pdf
    The Linux Sound HOWTO Jeff Tranter [email protected] v1.22, 16 July 2001 Revision History Revision 1.22 2001−07−16 Revised by: jjt Relicensed under the GFDL. Revision 1.21 2001−05−11 Revised by: jjt This document describes sound support for Linux. It lists the supported sound hardware, describes how to configure the kernel drivers, and answers frequently asked questions. The intent is to bring new users up to speed more quickly and reduce the amount of traffic in the Usenet news groups and mailing lists. The Linux Sound HOWTO Table of Contents 1. Introduction.....................................................................................................................................................1 1.1. Acknowledgments.............................................................................................................................1 1.2. New versions of this document.........................................................................................................1 1.3. Feedback...........................................................................................................................................2 1.4. Distribution Policy............................................................................................................................2 2. Sound Card Technology.................................................................................................................................3 3. Supported Hardware......................................................................................................................................4
    [Show full text]
  • A Comparison of Two Distributed Systems
    A comparison of two distributed systems Finny Varghese Topics Design Philosophies Application environment Processor allocation Design Consequences Kernal Architecture Communication Mechanism File system Process Management 1 Amoeba vs. Sprite 2 philosophical grounds Distributed computing model vs. Unix-style applications Workstation-centered model vs. combination of terminal with a shared processor pool Amoeba vs. Sprite Amoeba Sprite user level IPC RPC model – Kernal use mechanism Caches files only on Client-level caching servers Centralized server – to Process migration model allocate processors 2 Amoeba System Sprite System 3 Design Philosophies 1. How to design a distributed file system with secondary storage shared? 2. How to allow collection of processors to be exploited by individual users Application Environment Amoeba Sprite Process or file = obj Eases – transition from Capability time-sharing to networked Port – hides the server workstations from objects Uniform communication Caching file data – on model workstations Easier - writing distributed application Little or no IPC Orca – programming language 4 Processor Allocation Pure “workstation” – execute tasks on one machine Pure “processor pool” – equal access to all processors Amoeba – closer to processor pool Sprite – closer to workstation model Processor Allocation - Amoeba “pool processor” – network interface and RAM Unlike pure – processors allocation outside pool processors for system services Terminals – only display server 3 reasons for this choice 1. Assumption that processor & memory price decrease 2. Assumption that the cost of adding new processor would be less than adding workstation 3. Entire distributed system – as a time sharing system 5 Processor Allocation - Sprite Priority, processing power of a workstation Unlike pure workstations – uses processing power of idle hosts Dedicated file servers – not for applications 3 reasons for this choice 1.
    [Show full text]
  • Linux Hardware Compatibility HOWTO
    Linux Hardware Compatibility HOWTO Steven Pritchard Southern Illinois Linux Users Group [email protected] 3.1.5 Copyright © 2001−2002 by Steven Pritchard Copyright © 1997−1999 by Patrick Reijnen 2002−03−28 This document attempts to list most of the hardware known to be either supported or unsupported under Linux. Linux Hardware Compatibility HOWTO Table of Contents 1. Introduction.....................................................................................................................................................1 1.1. Notes on binary−only drivers...........................................................................................................1 1.2. Notes on commercial drivers............................................................................................................1 1.3. System architectures.........................................................................................................................1 1.4. Related sources of information.........................................................................................................2 1.5. Known problems with this document...............................................................................................2 1.6. New versions of this document.........................................................................................................2 1.7. Feedback and corrections..................................................................................................................3 1.8. Acknowledgments.............................................................................................................................3
    [Show full text]
  • Simulation and Comparison of Various Scheduling Algorithm for Improving the Interrupt Latency of Real –Time Kernal
    Journal of Computer Science and Applications. ISSN 2231-1270 Volume 6, Number 2 (2014), pp. 115-123 © International Research Publication House http://www.irphouse.com Simulation And Comparison of Various Scheduling Algorithm For Improving The Interrupt Latency of Real –Time Kernal 1.Lavanya Dhanesh 2.Dr.P.Murugesan 1.Research Scholar, Sathyabama University, Chennai, India. 2.Professor, S.A. Engineering College, Chennai, India. Email:1. [email protected] Abstract The main objective of the research is to improve the performance of the Real- time Interrupt Latency using Pre-emptive task Scheduling Algorithm. Interrupt Latency provides an important metric in increasing the performance of the Real Time Kernal So far the research has been investigated with respect to real-time latency reduction to improve the task switching as well the performance of the CPU. Based on the literature survey, the pre-emptive task scheduling plays an vital role in increasing the performance of the interrupt latency. A general disadvantage of the non-preemptive discipline is that it introduces additional blocking time in higher priority tasks, so reducing schedulability . If the interrupt latency is increased the task switching delay shall be increasing with respect to each task. Hence most of the research work has been focussed to reduce interrupt latency by many methods. The key area identified is, we cannot control the hardware interrupt delay but we can improve the Interrupt service as quick as possible by reducing the no of preemptions. Based on this idea, so many researches has been involved to optimize the pre-emptive scheduling scheme to reduce the real-time interrupt latency.
    [Show full text]