Linux Kernel Programming Part 2 – Char Device Drivers and Kernel Synchronization: Create user-kernel interfaces, work with peripheral I/O, and handle hardware interrupts

0
(0)

Linux Kernel Programming Part 2 – Char Device Drivers and Kernel Synchronization: Create user-kernel interfaces, work with peripheral I/O, and handle hardware interrupts
 

  • Author:Kaiwan N Billimoria
  • Length: 452 pages
  • Edition: 1
  • Publisher: Packt Publishing
  • Publication Date: 2021-03-19
  • ISBN-10: 180107951X
  • ISBN-13: 9781801079518
  • Download:Register/Login to Download
  • Buy Print:Buy from amazon


    Book Description

    Discover how to write high-quality character driver code, interface with userspace, work with chip memory, and gain an in-depth understanding of working with hardware interrupts and kernel synchronization

    Key Features:

    • Delve into hardware interrupt handling, threaded IRQs, tasklets, softirqs, and understand which to use when
    • Explore powerful techniques to perform user-kernel interfacing, peripheral I/O and use kernel mechanisms
    • Work with key kernel synchronization primitives to solve kernel concurrency issues

    Book Description:

    Linux Kernel Programming Part 2 – Char Device Drivers and Kernel Synchronization is an ideal companion guide to the Linux Kernel Programming book. This book provides a comprehensive introduction for those new to Linux device driver development and will have you up and running with writing misc class character device driver code (on the 5.4 LTS Linux kernel) in next to no time.

    You’ll begin by learning how to write a simple and complete misc class character driver before interfacing your driver with user-mode processes via procfs, sysfs, debugfs, netlink sockets, and ioctl. You’ll then find out how to work with hardware I/O memory. The book covers working with hardware interrupts in depth and helps you understand interrupt request (IRQ) allocation, threaded IRQ handlers, tasklets, and softirqs. You’ll also explore the practical usage of useful kernel mechanisms, setting up delays, timers, kernel threads, and workqueues. Finally, you’ll discover how to deal with the complexity of kernel synchronization with locking technologies (mutexes, spinlocks, and atomic/refcount operators), including more advanced topics such as cache effects, a primer on lock-free techniques, deadlock avoidance (with lockdep), and kernel lock debugging techniques.

    By the end of this Linux kernel book, you’ll have learned the fundamentals of writing Linux character device driver code for real-world projects and products.

    What You Will Learn:

    • Get to grips with the basics of the modern Linux Device Model (LDM)
    • Write a simple yet complete misc class character device driver
    • Perform user-kernel interfacing using popular methods
    • Understand and handle hardware interrupts confidently
    • Perform I/O on peripheral hardware chip memory
    • Explore kernel APIs to work with delays, timers, kthreads, and workqueues
    • Understand kernel concurrency issues
    • Work with key kernel synchronization primitives and discover how to detect and avoid deadlock

    Who this book is for:

    An understanding of the topics covered in the Linux Kernel Programming book is highly recommended to make the most of this book. This book is for Linux programmers beginning to find their way with device driver development. Linux device driver developers looking to overcome frequent and common kernel/driver development issues, as well as perform common driver tasks such as user-kernel interfaces, performing peripheral I/O, handling hardware interrupts, and dealing with concurrency will benefit from this book. A basic understanding of Linux kernel internals (and common APIs), kernel module development, and C programming is required.

    中文:

    书名:Linux内核编程第2部分:字符设备驱动程序和内核同步:创建用户内核接口、处理外围I/O和处理硬件中断

    了解如何编写高质量的字符驱动程序代码、与用户空间交互、使用芯片内存,并深入了解如何使用硬件中断和内核同步

    主要特点:

    • 深入研究硬件中断处理、线程化IRQ、微线程、软件,并了解在以下情况下使用哪些
    • 探索强大的技术来执行用户-内核接口、外围I/O和使用内核机制
    • 使用关键的内核同步原语来解决内核并发问题

    书名:

    Linux内核编程第2部分:CHAR设备驱动程序和内核同步是Linux内核编程书籍的理想配套指南。这本书为那些新接触Linux设备驱动程序开发的人提供了一个全面的介绍,并将使您立即开始编写Misc类字符设备驱动程序代码(在5.4LTS Linux内核上)。

    您将首先学习如何编写一个简单而完整的misc类字符驱动程序,然后再通过procf、sysf、调试文件系统、NetLink套接字和ioctl将您的驱动程序与用户模式进程接口。然后,您将了解如何使用硬件I/O内存。本书深入介绍了如何处理硬件中断,并帮助您了解中断请求(IRQ)分配、线程化IRQ处理程序、微线程和软中断。您还将探索有用的内核机制的实际用法,设置延迟、计时器、内核线程和工作队列。最后,您将了解如何使用锁定技术(互斥体、自旋锁和原子/引用计数操作符)处理内核同步的复杂性,包括更高级的主题,如缓存效果、无锁技术入门读物、避免死锁(使用lockdep)和内核锁调试技术。

    在这本Linux内核书的最后,您将学习为现实世界的项目和产品编写Linux字符设备驱动程序代码的基础知识。

    您将了解到的内容:

    • 掌握现代Linux设备模型(LDM)的基础知识
    • 编写一个简单而完整的杂类字符设备驱动程序
    • 使用流行的方法执行用户-内核接口
    • 自信地理解和处理硬件中断
    • 在外围硬件芯片内存上执行I/O
    • 探索内核API以处理延迟、计时器、k线程和工作队列
    • 了解内核并发问题
    • 使用密钥内核同步原语并了解如何检测和避免死锁

    这本书的读者是:

    为了更好地理解这本书,强烈建议您理解Linux内核编程一书中所涵盖的主题。这本书是为开始寻找设备驱动程序开发方法的Linux程序员编写的。希望克服频繁且常见的内核/驱动程序开发问题并执行常见驱动程序任务(如用户内核接口、执行外围I/O、处理硬件中断和处理并发)的Linux设备驱动程序开发人员将从本书中受益。需要对Linux内核内部(和常见API)、内核模块开发和C编程有基本的了解。

  • 下载电子版:下载地址
  • 购买纸质版:亚马逊商城

    点击星号评分!

    平均分 0 / 5. 投票数: 0

    还没有投票!请为他投一票。

  • 推荐阅读

    评论 抢沙发

    评论前必须登录!

     

    登录

    找回密码

    注册