In-depth Linux Device Driver Kernel Mechanism

Source: Internet
Author: User
In-depth Linux Device Driver Kernel Mechanism

 

Basic Information
  • Author:Chen xuesong
  • Press: Electronic Industry Press
  • ISBN:9787121150524
  • Mounting time:
  • Published on: February 1, January 2012

Http://product.china-pub.com/198916

 

 

IntroductionThis is a professional book that describes the technology of Linux device drivers. It focuses not on writing device drivers in Linux, instead, you need to tell the readers the kernel mechanisms and principles behind these device drivers. By analyzing the Linux kernel source code, the author adds a lot of well-designed images to the readers who have read this book and then become open-minded about the features of the driver's foreground.
In-depth Linux Device Driver kernel mechanism covers almost all the kernel facilities required for writing device drivers, such as kernel module, interrupt processing, mutex and synchronization, memory allocation, delayed operations, time management, and new device driver model. In order to avoid readers getting lost in the discussion of certain technical details, this book is carried out at a relatively high level, the structure of a framework and details greatly simplifies the reader's reading and learning.
In-depth Linux Device Driver kernel mechanism is not only suitable for those who are engaged in device driver development in Linux systems, it is also suitable for students interested in developing drivers for Linux devices or reading drivers for linux kernels. For beginners who do not have any Linux device driver development experience, it is recommended to read the introductory books on "how" To Write Device Drivers in Linux, then read this book to understand why you need to write the device driver in one way or another. DirectoryIn-depth Linux Device Driver Kernel Mechanism
Chapter 1 kernel module 1
1.1 kernel module File Format 2
1.2 export_symbol kernel Implementation 5
1.3 Module loading process 8
1.3.1 sys_init_module (Part 1) 9
1.3.2 struct module 9
1.3.3 load_module 13
1.3.4 sys_init_module (Part 2) 49
1.3.5 uninstall module 54
1.4 Summary 55
Chapter 2 character device driver 57
2.1 application and Device Driver interaction instance 58
2.2 struct file_operations 62
2.3 character device kernel abstraction 63
2.4 Composition and allocation of device numbers 65
2.4.1 composition of the device number 65
2.4.2 assignment and Management of device numbers 66
2.5 character device registration 71
2.6 create a device file node 74. 2.7 characters open a device file 77
2.8 summary of this Chapter 85
Chapter 1 allocate memory 87
3.1 Physical memory management 87
3.1.1 memory node 87
3.1.2 memory zone 88
3.1.3 Memory Page 89
3.2 page distributor (page Allocator) 90
3.2.1 gfp_mask 91
3.2.2 alloc_pages 95
3.2.3 _ get_free_pages 96
3.2.4 get_zeroed_page 97
3.2.5 _ get_dma_pages 97
3.3 slab distributor (Slab allocator) 98
3.3.1 manage slab Data Structure 99
3.3.2 kmalloc and kzarloc 105
3.3.3 kmem_cache_create and kmem_cache_alloc 108
3.4 Memory Pool (mempool) 110
3.5 Virtual Memory Management 111
3.5.1 kernel virtual address space composition 111
3.5.2 vmalloc & vfree 112
3.5.3 ioremap 115
3.6 per-CPU variable 115
3.6.1 declaration and definition of static per-CPU variables 116
3.6.2 static per-CPU variable link script 117
3.6.3 setup_per_cpu_areas function 118
3.6.4 use per-CPU variable 121
3.7 summary of this Chapter 125
Chapter 2 mutex and synchronization 4th
4.1 concurrent source 127
4.2 local_irq_enable and local_irq_disable 128
4.3 spin lock 129
4.3.1 spin_lock 130
4.3.2 variation of spin_lock 133
4.3.3 single-processor spin_lock function 136
4.3.4 reader and writer spin lock rwlock 137
4.4 semaphores (semaphore) 141
4.4.1 semaphore definition and initialization 141
4.4.2 down operation 142
4.4.3 up Operation 145
4.4.4 reader and writer semaphores rwsem 146
4.5 mutex 148
4.5.1 Definition and initialization of mutex 148
4.5.2 down operation of mutex lock 149
4.5.3 up operation for mutex lock 150
4.6 sequential lock 152
4.7 RCU 155
4.7.1 The RCU critical section of the reader 156
4.7.2 writer's RCU operation 156
4.7.3 features of RCU 157
4.8 atomic variables and bit operations 159
4.9 waiting queue 162
4.9.1 waiting queue header wait_queue_head_t 162
4.9.2 wait queue node 163
4.9.3 applications waiting for the queue 164
4.10 complete interface completion 164
4.11 summary of this chapter 168
Chapter 4 interrupt handling 5th
5.1 interrupted hardware framework 169
5.2 PIC and software interrupt No. 170
5.3 General interrupt handling functions 171
5.4 do_irq function 172
5.5 struct irq_chip 178
5.6 struct irqaction 179
5.7 irq_set_handler 180
5.8 handle_irq_event 184
5.9 request_irq 186
5.10 irq_thread mechanism for interrupt handling 190
5.11 free_irq 191
5.12 softirq 192
5.13 automatic IRQ detection 196
5.14 interrupt handling routine 200
5.15 interrupt sharing 201
5.16 summary of this chapter 202
Chapter 4 delayed operations 6th
6.1 tasklet 203
6.1.1 tasklet mechanism initialization 204
6.1.2 submit a tasklet 205
6.1.3 tasklet_action 209
6.1.4 other tasklet operations 212
6.2 work queue 214
6.2.1 Data Structure 214
6.2.2 create_singlethread_workqueue and create_workqueue 216
6.2.3 worker_thread 219
6.2.4 destroy_workqueue 221
6.2.5 submit the work node queue_work 224
6.2.6 kernel-created working queue 229
6.3 Summary of this chapter 230
Chapter 4 Advanced Operations on Device Files 7th
7.1 IOCTL File Operations 231
7.1.1 System Call of IOCTL 231
7.1.2 IOCTL command code 235
7.1.3 copy_from_user and copy_to_user 238
7.2 character device I/O model 243
7.3 synchronous blocking I/O 244
7.3.1 wait_event_interruptible 244
7.3.2 wake_up_interruptible 246
7.4 synchronous non-blocking I/O 250
7.5 asynchronous blocking I/O 251
7.6 asynchronous non-blocking I/O 258
7.7 fsync routine of the driver 259
7.8 fasync routine 260
7.9 llseek routine 269
7.10 access capability 272
7.11 summary of this chapter 273
Chapter 1 time management 8th
8.1 jiffies 274
8.1.1 time comparison 277
8.1.2 time conversion 278
8.2 delayed operations 279
8.2.1 long latency 280
8.2.2 short latency 285
8.3 kernel timer 286
8.3.1 init_timer 289
8.3.2 add_timer 289
8.3.3 del_timer and del_timer_sync 293
8.4 summary of this chapter 293
Chapter 2 Linux Device Driver Model 9th
9.1 sysfs File System 295
9.2 kobject and kset 298
9.2.1 kobject 298
9.2.2 type attribute 305 of kobject
9.2.3 kset 308
9.2.4 uevent and call_usermodehelper 311 in hot swapping
9.2.5 source code 320
9.3 bus, device and drive 328
9.3.1 bus and registration 328
9.3.2 bus attribute 335
9.3.3 device-driver binding: 338
9.3.4 device 339
9.3.5 driving 348
9.4 class 351
9.5 summary of this chapter 355
Chapter 2 memory ing and DMA 10th
10.1 device cache and device memory 356
10.2 MMAP 356
10.2.1 struct vm_area_struct 357
10.2.2 layout of user space Virtual Address: 358
10.2.3 MMAP System Call process 362
10.2.4 implementation of the mmap method in the driver 368
10.2.5 MMAP sample 373
10.2.6 munmap 383
10.3 DMA 384
10.3.1 DMA layer 384 in the kernel
10.3.2 physical address and BUS address 386
10.3.3 dma_set_mask 387
10.3.4 DMA ing 388
10.3.5 rebounding buffer (bounce buffer) 401
10.3.6 DMA pool 401
10.4 summary of this Chapter 405
Chapter 2 block device drivers 11th
11.1 subsystem initialization 408
11.2 ramdisk source code instance 410
11.2.1 source code of RAM disk of make_request 411
11.2.2 source code of the Request version RAM disk 416
11.2.3 use of ramdisk 420
Registration and Management of 11.3 device numbers 422
11.4 block_device 424
11.5 struct gendisk 425
11.6 struct hd_struct 428
11.7 allocating gendisk objects with alloc_disk 428
11.8 Add a block device add_disk 430 to the System
11.9 block_device_operations 439
Opening of 11.10 Device Files 440
11.11 blk_init_queue 448
11.12 blk_queue_make_request 459
11.13 submit a request to the queue 460
Request processing functions of 11.14 devices: 466
11.15 bio structure 467
11.16 summary of this Chapter 472
Chapter 2 network device drivers 12th
12.1 net_device 475
12.2 registration of network devices 488
12.3 device method 492
12.3.1 device initialization 494
12.3.2 enable and disable a device interface 495
12.3.3 packet sending 495
12.3.4 Traffic Control Mechanism during network packet transmission 500
12.3.5 transmission timeout (watchdog timeout) 503
12.3.6 receiving 506 of data packets
12.4 Socket buffer 510
12.5 interrupt handling 518
12.6 napi 520
12.7 summary of this chapter 522

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.