Table of Contents. Preface... xi

Similar documents
- Knowledge of basic computer architecture and organization, ECE 445

LINUX DEVICE DRIVERS Weekend Workshop

Kernel Internals. Course Duration: 5 days. Pre-Requisites : Course Objective: Course Outline

Embedded Engineering

Real Time. Real Time & Embedded Linux Solutions. Linux Kernel Device Drivers משך הקורס 40 שעות לימוד ותרגול בשיטת OJT

Contents. Foreword...xxi Preface...xxiii Acknowledgments...xxix About the Author...xxx

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Embedded Linux kernel and driver development training 5-day session

I/O Systems. Amir H. Payberah. Amirkabir University of Technology (Tehran Polytechnic)

CIS 21 Final Study Guide. Final covers ch. 1-20, except for 17. Need to know:

The control of I/O devices is a major concern for OS designers

Chapter 13: I/O Systems. Operating System Concepts 9 th Edition

Module 12: I/O Systems

Linux Kernel Architecture

Chapter 13: I/O Systems

Operating System: Chap13 I/O Systems. National Tsing-Hua University 2016, Fall Semester

Chapter 13: I/O Systems

Module 12: I/O Systems

Chapter 13: I/O Systems

I/O and Device Drivers

操作系统概念 13. I/O Systems

Chapter 12: I/O Systems

Chapter 13: I/O Systems

Chapter 12: I/O Systems. Operating System Concepts Essentials 8 th Edition

Chapter 13: I/O Systems

Linux Driver and Embedded Developer

Input/Output Systems

I/O AND DEVICE HANDLING Operating Systems Design Euiseong Seo

Input-Output (I/O) Input - Output. I/O Devices. I/O Devices. I/O Devices. I/O Devices. operating system must control all I/O devices.

Last class: Today: Course administration OS definition, some history. Background on Computer Architecture

Chapter 13: I/O Systems

Lecture 15: I/O Devices & Drivers

Silberschatz and Galvin Chapter 12

Real-Time Performance of Linux. OS Latency

Chapter 8: I/O functions & socket options

I/O Management Software. Chapter 5

Integrated Approach. Operating Systems COMPUTER SYSTEMS. LEAHY, Jr. Georgia Institute of Technology. Umakishore RAMACHANDRAN. William D.

Chapter 13: I/O Systems

Chapter 13: I/O Systems. Chapter 13: I/O Systems. Objectives. I/O Hardware. A Typical PC Bus Structure. Device I/O Port Locations on PCs (partial)

Device-Functionality Progression

Chapter 12: I/O Systems. I/O Hardware

Common Computer-System and OS Structures

DRIVER MODEL ULB Darmstadt

Kernel Module Programming

Operating System Design Issues. I/O Management

CS330: Operating System and Lab. (Spring 2006) I/O Systems

I/O Systems. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Programming with POSIX Threads

20-EECE-4029 Operating Systems Fall, 2015 John Franco

CS 134. Operating Systems. April 8, 2013 Lecture 20. Input/Output. Instructor: Neil Rhodes. Monday, April 7, 14

Introduction PCI Interface Booting PCI driver registration Other buses. Linux Device Drivers PCI Drivers

Operating Systems 2010/2011

Computer Systems A Programmer s Perspective 1 (Beta Draft)

CS5460/6460: Operating Systems. Lecture 24: Device drivers. Anton Burtsev April, 2014

C02: Interrupts and I/O

Embedded System Curriculum

Input / Output. Kevin Webb Swarthmore College April 12, 2018

I/O Management Software. Chapter 5

Storage Systems. NPTEL Course Jan K. Gopinath Indian Institute of Science

Noorul Islam College Of Engineering, Kumaracoil MCA Degree Model Examination (October 2007) 5 th Semester MC1642 UNIX Internals 2 mark Questions

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS

Introduction to Operating Systems. Chapter Chapter

ABOUT THE AUTHOR AND THE TECHNICAL REVIEWER. Who Is This Book For?...xxiii Prerequisites...xxiv Contents at a Glance...xxiv Welcome Aboard!...

Chapter 12 IoT Projects Case Studies. Lesson-01: Introduction

Lecture 13 Input/Output (I/O) Systems (chapter 13)

I/O Handling. ECE 650 Systems Programming & Engineering Duke University, Spring Based on Operating Systems Concepts, Silberschatz Chapter 13

Computer Architecture CS 355 Busses & I/O System

CS Lab 4: Device Drivers

Module 11: I/O Systems

Answer to exercises chap 13.2

Application Programming

MICROPROCESSOR Architecture, Programming and Interfacing SUNIL MATHUR. Assistant Professor Maharaja Agrasen Institute of Technology Delhi

Universal Windows Driver Development with WDF UMDF 2.0 and KMDF for IoT, Desktop and Server

EMBEDDED TRAINING IN BANGALORE

CSE 451: Operating Systems Winter I/O System. Gary Kimura

I/O Systems. Jo, Heeseung

Computers as Components Principles of Embedded Computing System Design

The Kernel Abstraction

Understanding the Concepts and Features of Macro Programming 1

Chapter 13: I/O Systems

Programming Assignment #4 Writing a simple parallel port device driver

5.b Principles of I/O Hardware CPU-I/O communication

Input/Output Problems. External Devices. Input/Output Module. I/O Steps. I/O Module Function Computer Architecture

ELEC 377 Operating Systems. Week 1 Class 2

Outline. 1) Introduction to Linux Kernel 2) How system calls work 3) Kernel-space programming 4) Networking in kernel 2/34

MP3: VIRTUAL MEMORY PAGE FAULT MEASUREMENT

Software Development & Education Center

Methods to protect proprietary components in device drivers

CPSC/ECE 3220 Fall 2017 Exam Give the definition (note: not the roles) for an operating system as stated in the textbook. (2 pts.

Operating Systems. Steven Hand. Michaelmas / Lent Term 2008/ lectures for CST IA. Handout 4. Operating Systems

Efficient Android Threading

3.1 Introduction. Computers perform operations concurrently

Computer-System Architecture

Computer-System Architecture. Common Functions of Interrupts. Computer-System Operation. Interrupt Handling. Chapter 2: Computer-System Structures

EMBEDDED SYSTEMS: Jonathan W. Valvano INTRODUCTION TO THE MSP432 MICROCONTROLLER. Volume 1 First Edition June 2015

COT 4600 Operating Systems Fall Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM

Introduction to I/O. 1-Slide Overview to File Management

Last 2 Classes: Introduction to Operating Systems & C++ tutorial. Today: OS and Computer Architecture

Operating Systems (CS1022) Input/Output. Yagiz Özbek Evren

-Device. -Physical or virtual thing that does something -Software + hardware to operate a device (Controller runs port, Bus, device)

Transcription:

,ldr3toc.fm.4587 Page v Thursday, January 20, 2005 9:30 AM Table of Contents Preface................................................................. xi 1. An Introduction to Device Drivers..................................... 1 The Role of the Device Driver 2 Splitting the Kernel 4 Classes of Devices and Modules 5 Security Issues 8 Version Numbering 10 License Terms 11 Joining the Kernel Development Community 12 Overview of the Book 12 2. Building and Running Modules...................................... 15 Setting Up Your Test System 15 The Hello World Module 16 Kernel Modules Versus Applications 18 Compiling and Loading 22 The Kernel Symbol Table 28 Preliminaries 30 Initialization and Shutdown 31 Module Parameters 35 Doing It in User Space 37 Quick Reference 39 3. Char Drivers....................................................... 42 The Design of scull 42 Major and Minor Numbers 43 Some Important Data Structures 49 v

,ldr3toc.fm.4587 Page vi Thursday, January 20, 2005 9:30 AM Char Device Registration 55 open and release 58 scull s Memory Usage 60 read and write 63 Playing with the New Devices 70 Quick Reference 70 4. Debugging Techniques............................................. 73 Debugging Support in the Kernel 73 Debugging by Printing 75 Debugging by Querying 82 Debugging by Watching 91 Debugging System Faults 93 Debuggers and Related Tools 99 5. Concurrency and Race Conditions................................... 106 Pitfalls in scull 107 Concurrency and Its Management 107 Semaphores and Mutexes 109 Completions 114 Spinlocks 116 Locking Traps 121 Alternatives to Locking 123 Quick Reference 130 6. Advanced Char Driver Operations................................... 135 ioctl 135 Blocking I/O 147 poll and select 163 Asynchronous Notification 169 Seeking a Device 171 Access Control on a Device File 173 Quick Reference 179 7. Time, Delays, and Deferred Work................................... 183 Measuring Time Lapses 183 Knowing the Current Time 188 Delaying Execution 190 Kernel Timers 196 Tasklets 202 vi Table of Contents

,ldr3toc.fm.4587 Page vii Thursday, January 20, 2005 9:30 AM Workqueues 205 Quick Reference 208 8. Allocating Memory............................................... 213 The Real Story of kmalloc 213 Lookaside Caches 217 get_free_page and Friends 221 vmalloc and Friends 224 Per-CPU Variables 228 Obtaining Large Buffers 230 Quick Reference 231 9. Communicating with Hardware.................................... 235 I/O Ports and I/O Memory 235 Using I/O Ports 239 An I/O Port Example 245 Using I/O Memory 248 Quick Reference 255 10. Interrupt Handling............................................... 258 Preparing the Parallel Port 259 Installing an Interrupt Handler 259 Implementing a Handler 269 Top and Bottom Halves 275 Interrupt Sharing 278 Interrupt-Driven I/O 281 Quick Reference 286 11. Data Types in the Kernel........................................... 288 Use of Standard C Types 288 Assigning an Explicit Size to Data Items 290 Interface-Specific Types 291 Other Portability Issues 292 Linked Lists 295 Quick Reference 299 12. PCI Drivers....................................................... 302 The PCI Interface 302 A Look Back: ISA 319 PC/104 and PC/104+ 322 Table of Contents vii

,ldr3toc.fm.4587 Page viii Thursday, January 20, 2005 9:30 AM Other PC Buses 322 SBus 323 NuBus 324 External Buses 325 Quick Reference 325 13. USB Drivers...................................................... 327 USB Device Basics 328 USB and Sysfs 333 USB Urbs 335 Writing a USB Driver 346 USB Transfers Without Urbs 356 Quick Reference 360 14. The Linux Device Model........................................... 362 Kobjects, Ksets, and Subsystems 364 Low-Level Sysfs Operations 371 Hotplug Event Generation 375 Buses, Devices, and Drivers 377 Classes 387 Putting It All Together 391 Hotplug 397 Dealing with Firmware 405 Quick Reference 407 15. Memory Mapping and DMA........................................ 412 Memory Management in Linux 412 The mmap Device Operation 422 Performing Direct I/O 435 Direct Memory Access 440 Quick Reference 459 16. Block Drivers..................................................... 464 Registration 465 The Block Device Operations 471 Request Processing 474 Some Other Details 491 Quick Reference 494 viii Table of Contents

,ldr3toc.fm.4587 Page ix Thursday, January 20, 2005 9:30 AM 17. Network Drivers.................................................. 497 How snull Is Designed 498 Connecting to the Kernel 502 The net_device Structure in Detail 506 Opening and Closing 515 Packet Transmission 516 Packet Reception 521 The Interrupt Handler 523 Receive Interrupt Mitigation 525 Changes in Link State 528 The Socket Buffers 528 MAC Address Resolution 532 Custom ioctl Commands 535 Statistical Information 536 Multicast 537 A Few Other Details 540 Quick Reference 542 18. TTY Drivers....................................................... 546 A Small TTY Driver 548 tty_driver Function Pointers 553 TTY Line Settings 560 ioctls 564 proc and sysfs Handling of TTY Devices 566 The tty_driver Structure in Detail 567 The tty_operations Structure in Detail 569 The tty_struct Structure in Detail 571 Quick Reference 573 Bibliography........................................................... 575 Index................................................................. 579 Table of Contents ix

,ldr3toc.fm.4587 Page x Thursday, January 20, 2005 9:30 AM