Mastering the Linux Kernel: Core Technologies for Smart Device Development consists of five chapters, which analyze the core technologies of Linux kernel development in detail from easy to difficult. The \"Knowledge Reserve Chapter\" introduces Linux data structures, interrupt handling, kernel synchronization, and time calculation, which are the prerequisites for understanding subsequent chapters. After that, the three core modules of Linux are introduced in detail through the \"Memory Management Chapter\", \"File System Chapter\", and \"Process Management Chapter\". The last \"Sublimation Chapter\" combines many of the previous modules to show the application of Linux kernel development in hot areas such as operating systems, smart devices, drivers, communications, chips, and artificial intelligence. The key points and difficulties in the book are all presented with charts, codes, and practical cases, which helps to improve readers\' hands-on operation ability. Readers who master the Linux Kernel: Core Technologies for Smart Device Development need to be familiar with C language and have a certain understanding of the Linux kernel. Beginners read in the order of the book, while readers who are familiar with the Linux kernel can skip the first chapter and read directly from the three core modules. This book can be used as a guide for beginner and intermediate Linux readers to systematically learn Linux kernel development. It can also be used as a desk guide and advanced tool book for engineers working in embedded systems, operating systems, Linux programming, driver/kernel development, and smart device development. Preface Preface Knowledge Reserve Chapter 1 Linux Kernel-Based Operating System 1.1 Processor, Platform and Operating System 1.2 Analyzing the Operating System with Android as an Example 1.2.1 Android\'s Overall Architecture 1.2.2 The Core Function of the Linux Kernel 1.3 Kernel Overall Architecture 1.3.1 Kernel Code Directory Structure 1.3.2 Kernel\'s Core Modules and Associations 1.4 Example Analysis 1.4.1 The System Response to \"Clicking the Smartphone Touch Screen\" 1.4.2 Smartphone Sensor Games Chapter 2 Use of Data Structures 2.1 Relational Data Structures 2.1.1 One-to-One Relationship 2.1.2 One-to-Many Relationship 2.1.3 Many-to-Many Relationship 2.2 Bit Operation Data Structure 2.3 Module and Kernel Parameter Transfer 2.3.1 Embedded General Data Structure 2.3.2 General Structure\'s Private Variables 2.4 Example Analysis 2.4.1 Module Encapsulation 2.4.2 Fiery Eyes: Seeing Through Data Structures Chapter 3 Measurement and Calculation of Time 3.1 Data Structure 3.2 Clock Chip 3.3 3.5.1 Getting the time 3.5.2 Setting an alarm for the program 3.6 Example analysis 3.6.1 Implementing the long press operation of a smartphone 3.6.2 The system time is not what you think Chapter 4 Interrupts and interrupt handling 4.1 Processor recognizes interrupts 4.2 Handling interrupts 4.2.1 Interrupt handler 4.2.2 Interrupt service routine 4.2.3 Interrupt handling 4.3 Interrupt return 4.4 System call 4.5 Soft interrupt 4.5.1 Principle 4.5.2 Tasklet 4.5.3 Timer 4.6 Example analysis 4.6.1 Using interrupts to report emergencies to unmanned driving systems 4.6.2 Using watchdog to prevent drone crashes Chapter 5 Kernel synchronization 5.1 Critical section competition 5.2 Synchronization primitives 5.2.1 Per-CPU variables 5.2.2 Volatile keyword 5.2.3 Barriers 5.2.4 Atomic variables 5.2.5 Disable interrupts 5.2.6 Disable preemption 5.2.7 Spin locks 5.2.8 Read-write locks 5.2.9 Sequential locks 5.2.10 Semaphores 5.2.11 Mutex locks 5.2.12 Read-copy-new 5.3 Example analysis 5.3.1 Switching between driverless and manual driving modes 5.3.2 Report and suspend on smartphone touch screens Chapter 6 Synchronization and asynchrony of events 6.1 Asynchrony of events 6.2 Synchronization of events 6.2.1 Wait for a period of time 6.2.2 Wait for events to complete 6.3 Example analysis 6.3.1 Use work queues to poll the environment perception data of driverless cars 6.3.2 Use wait queues to wait for the chip to \"reply\" Memory management Chapter 7 Memory addressing 7.1 Memory in the eyes of the processor 7.2 Memory paging 7.2.1 Addressing: a treasure hunt for the processor 7.2.2 Memory mapping 7.3 Example analysis 7.3.1 7.3.2 MMIO Mapping Chapter 8 Physical Memory Management 8.1 Physical Memory Organization 8.2 Starting Program 8.3 Memblock Allocator 8.4 Partner System 8.4.1 Data Structure 8.4.2 Page Request and Release 8.5 Example Analysis 8.5.1 Construct a Memory Management System 8.5.2 Android ION Chapter 9 Memory Linear Space Layout 9.1 Linear Space Division 9.2 Kernel Linear Space Layout 9.2.1 Direct Mapping Area 9.2.2 Dynamic Mapping Area 9.2.3 Mapping Area 9.2.4 Fixed Mapping Area 9.3 mmap Mechanism 9.3.1 Function Prototype 9.3.2 Data Structure 9.3.3 Implementation of mmap 9.3.4 Summary of Memory Mapping 9.4 Memory Application 9.4.1 Get Physical Memory 9.4.2 Get Virtual Memory 9.5 Example Analysis 9.5.1 Map Memory Through dev 9.5.2 Several different mmap mapping methods Chapter 0 Advanced Memory Management 10.1 Processor Cache 10.1.1 TLB Cache 10.1.2 Memory Cache 10.2 Page Fault Exception 10.2.1 Handling Page Fault Exception 10.2.2 The Essence of COW 10.3 Example Analysis 10.3.1 Using the Characteristics of Cache to Optimize Deep Learning Development 10.3.2 What Does the Kernel Do for Molloc File System Chapter 1 File System 11.1 Concepts and Data Structures 11.2 Mounting the File System 11.3 Finding Files 11.4 File Operations 11.4.1 Creating and Deleting Directories 11.4.2 Opening and Closing Files 11.4.3 File Links 11.4.4 Creating Nodes 11.4.5 Deleting Files 11.5 File IO 11.5.1 fcntl Function 11.5.2 Reading and Writing Files 11.5.3 ioctl Function 11.6 Example Analysis 11.6.1 The all-encompassing proc file system11.6.2 The strange yet familiar devtmpfs file systemChapter 2 The sysfs file system12.1 Basic framework12.2 Data structure12.3 Create files12.4 File IO 12.5 Example analysis12.5.1 Use sysfs to assist driver debugging12.5.2 Smart home: Automatically adjust the brightness and color temperature of lightsChapter 3 The ext4 file system13.1 Overview13.2 Data structure13.2.1 ext4_super_block structure13.2.2 ext4_group_desc structure13.2.3 ext4_inode structure13.2.4 ext4_sb_info structure13.2.5 ext4_inode_info structure13.3 Mounting ext413.4 Directory structure13.4.1 Linear directory13.4.2 Hash tree directory13.4.3 Hard link13.5 File IO 13.5.1 Mapping 13.5.2 Segment tree 13.6 Example analysis 13.6.1 Recovering deleted files is not mysterious 13.6.2 Repairing the file system Process Management Chapter 4 Process 14.1 Overview 14.1.1 Data structure 14.1.2 Extended discussion 14.2 Process creation 14.2.1 dup_task_struct function 14.2.2 Copy creds 14.2.3 Set time 14.2.4 sched_fork function 14.2.5 Copy resources 14.2.6 Apply for pid 14.2.7 Important miscellaneous 14.3 Create a process 14.3.1 fork/vfork system call 14.3.2 Create a thread 14.3.3 Create a kernel thread 14.4 The \"Big Three\" of processes 14.5 Process exit 14.5.1 Exit method 14.5.2 Exit process 14.5.3 Using wait to wait for child processes14.6 Example analysis14.6.1 Create a service to receive drone handle control signals14.6.2 Android thread Chapter 5 Process Scheduling15.1 Data Structure15.2 The process of process scheduling15.2.1 The process is created15.2.2 Waking up the process15.2.3 Clock interrupt15.2.4 Process switching15.3 stop scheduling class15.4 Real-time scheduling class15.4.1 Priority and preemption15.4.2 task_tick_rt function15.4.3 Select the next process15.5 Fair scheduling class15.5.1 task_fork_fair function15.5.2 enqueue_task and check_preempt 15.5.3 task_tick_fair function15.5.4 Process switching15.6 Deadline scheduling class15.7 Idle scheduling class15.8 Process priority15.9 Example analysis15.9.1 17.1.1 Creating a pipe 17.1.2 Pipe operations 17.1.3 Named pipes 17.2 POSIX communication 17.2.1 POSIX semaphores 17.2.2 POSIX shared memory 17.2.3 POSIX message queues 17.3 XSI communication 17.3.1 IPC object key and id 17.3.2 XSI semaphores 17.3.3 XSI message queues 17.3.4 XSI shared memory 17.4 Example analysis 17.4.1 Multithreaded design accelerates deep learning 17.4.2 Constructing the service and client architecture of drones Chapter 8 Program execution 18.1 elf file 18.1.1 Overview 18.1.2 File format 18.2 exec function family 18.2.1 Data structure 18.2.2 System call 18.3 Example analysis 18.3.1 Make the program efficient and system-friendly 18.3.2 The secret of the main function Sublimation Chapter 9 Sorting out the operating system: I/O multiplexing 19.1 Select mechanism 19.2 Poll mechanism 19.3 Upgraded version: epoll 19.3.1 Data structure 19.3.2 Use of epoll 19.4 Example analysis 19.4.1 Event-driven program architecture 19.4.2 Improved pipeline communication Chapter 20 Sensor development for smart devices 20.1 Application of sensors in smart phones and artificial intelligence 20.2 Input subsystem 20.2.1 Data structure 20.2.2 Device and handler registration 20.2.3 Event reporting 20.2.4 evdev 20.3 Example analysis 20.3.1 Implementation of the hardware abstraction layer of smartphones 20.3.2 Sensors for driverless cars Chapter 21 Camera development for smart devices 21.1 Application of cameras in artificial intelligence 21.2 V4L2 architecture 21.2.1 Data structure 21.2.2 ioctl operations 21.3 Core ioctl operations of cameras 21.4 Example analysis 21.4.1 Android Camera architecture 21.4.2 3A control of cameras Chapter 22 Device driver development: device driver model 22.1 Drivers, devices, and buses 22.2 How probes are called 22.3 Revisiting the bus 22.4 Example analysis 22.4.1 Designing a hierarchical driver 22.4.2 Refining drivers for homogeneous devices Chapter 23 The core of the Android system: Binder communication 23.1 23.2.1 ServiceManager process management service 23.2.2 Registering and obtaining services 23.2.3 Service process 23.3 Binder driver 23.4 Example analysis 23.4.1 Using Binder to make the design clear 23.4.2 Obtaining a list of sensors through Binder Chapter 24 Chips and drivers from the kernel\'s perspective 24.1 Basic functional modules of the chip 24.1.1 Reset 24.1.2 Interrupt 24.1.3 Interface 24.2 A complete chip driver 24.2.1 Initialization 24.2.2 Normal working state of the chip 24.2.3 Suspend and resume 24.3 Example analysis 24.3.1 Acceleration sensor chip 24.3.2 Touch screen chip for smart phones Chapter 25 Linux and artificial intelligence 25.1 The current status of artificial intelligence 25.1.1 Deep learning 25.1.2 Neural network 25.2 25.2.1 Overall architecture 25.2.2 Hardware disputes 25.3 Example analysis 25.3.1 Module decomposition of driverless cars 25.3.2 Robot operating system ROS Appendix Appendix A Embedded assembly language Appendix B Linker script Appendix C Function and macro file table1 Select mechanism 19.2 Poll mechanism 19.3 Upgraded version: epoll 19.3.1 Data structure 19.3.2 Use of epoll 19.4 Example analysis 19.4.1 Event-driven program architecture 19.4.2 Improved pipeline communication Chapter 20 Sensor development for smart devices 20.1 Application of sensors in smart phones and artificial intelligence 20.2 Input subsystem 20.2.1 Data structure 20.2.2 Registration of device and handler 20.2.3 Event reporting 20.2.4 evdev 20.3 Example analysis 20.3.1 Implementation of smart phone hardware abstraction layer 20.3.2 Sensors for unmanned driving Chapter 21 Camera development for smart devices 21.1 Application of Camera in artificial intelligence 21.2 V4L2 architecture 21.2.1 Data structure 21.2.2 ioctl operation 21.3 Camera\'s core ioctl operation 21.4 Example analysis 21.4.1 Android Camera Architecture21.4.2 Camera 3A ControlChapter 22 Device Driver Development: Device Driver Model22.1 Driver, Device, and Bus22.2 How the Probe is Called22.3 Revisiting the Bus22.4 Example Analysis22.4.1 Designing a Hierarchical Driver22.4.2 Refining Drivers for Homogeneous DevicesChapter 23 The Core of the Android System: Binder Communication23.1 The Principle and Structure of Binder Communication23.2 Binder Process23.2.1 ServiceManager Process Management Service23.2.2 Registering and Obtaining Services23.2.3 Service Process23.3 Binder Driver23.4 Example Analysis23.4.1 Using Binder to Make the Design Clearer23.4.2 Obtaining a List of Sensors through BinderChapter 24 Looking at Chips and Drivers from the Kernel\'s Perspective24.1 Basic Functional Modules of Chips24.1.1 Reset24.1.2 Interrupt24.1.3 Interface24.2 A complete chip driver24.2.1 Initialization24.2.2 Normal working state of the chip24.2.3 Suspend and resume 24.3 Example analysis24.3.1 Accelerometer chip24.3.2 Touch screen chip of smart phoneChapter 25 Linux and artificial intelligence25.1 The current status of artificial intelligence25.1.1 Deep learning25.1.2 Neural network25.2 The software and hardware ecology of deep learning25.2.1 Overall architecture25.2.2 Hardware disputes25.3 Example analysis25.3.1 Module decomposition of driverless cars25.3.2 Robot operating system ROS AppendixAppendix A Embedded assembly languageAppendix B Linker scriptAppendix C Function and macro file table1 Select mechanism 19.2 Poll mechanism 19.3 Upgraded version: epoll 19.3.1 Data structure 19.3.2 Use of epoll 19.4 Example analysis 19.4.1 Event-driven program architecture 19.4.2 Improved pipeline communication Chapter 20 Sensor development for smart devices 20.1 Application of sensors in smart phones and artificial intelligence 20.2 Input subsystem 20.2.1 Data structure 20.2.2 Registration of device and handler 20.2.3 Event reporting 20.2.4 evdev 20.3 Example analysis 20.3.1 Implementation of smart phone hardware abstraction layer 20.3.2 Sensors for unmanned driving Chapter 21 Camera development for smart devices 21.1 Application of Camera in artificial intelligence 21.2 V4L2 architecture 21.2.1 Data structure 21.2.2 ioctl operation 21.3 Camera\'s core ioctl operation 21.4 Example analysis 21.4.1 Android Camera Architecture21.4.2 Camera 3A ControlChapter 22 Device Driver Development: Device Driver Model22.1 Driver, Device, and Bus22.2 How the Probe is Called22.3 Revisiting the Bus22.4 Example Analysis22.4.1 Designing a Hierarchical Driver22.4.2 Refining Drivers for Homogeneous DevicesChapter 23 The Core of the Android System: Binder Communication23.1 The Principle and Structure of Binder Communication23.2 Binder Process23.2.1 ServiceManager Process Management Service23.2.2 Registering and Obtaining Services23.2.3 Service Process23.3 Binder Driver23.4 Example Analysis23.4.1 Using Binder to Make the Design Clearer23.4.2 Obtaining a List of Sensors through BinderChapter 24 Looking at Chips and Drivers from the Kernel\'s Perspective24.1 Basic Functional Modules of Chips24.1.1 Reset24.1.2 Interrupt24.1.3 Interface24.2 A complete chip driver24.2.1 Initialization24.2.2 Normal working state of the chip24.2.3 Suspend and resume 24.3 Example analysis24.3.1 Accelerometer chip24.3.2 Touch screen chip of smart phoneChapter 25 Linux and artificial intelligence25.1 The current status of artificial intelligence25.1.1 Deep learning25.1.2 Neural network25.2 The software and hardware ecology of deep learning25.2.1 Overall architecture25.2.2 Hardware disputes25.3 Example analysis25.3.1 Module decomposition of driverless cars25.3.2 Robot operating system ROS AppendixAppendix A Embedded assembly languageAppendix B Linker scriptAppendix C Function and macro file table
You Might Like
Recommended ContentMore
Open source project More
Popular Components
Searched by Users
Just Take a LookMore
Trending Downloads
Trending ArticlesMore