《嵌入式Linux基础教程(第2版)(英文版)》是嵌入式Linux的经典教程,介绍了引导装入程序、系统初始化、文件系统、闪存和内核、应用程序调试技巧等,还讲述了构建Linux系统的工作原理,用于驱动不同体系结构的配置,Linux内核源码树的特性,如何根据需求配制内核运行时的行为,如何扩展系统功能,用于构建完整嵌入式Linux发行版的常用构建系统,USB子系统和系统配置工具udev等内容。更重要的是,《嵌入式Linux基础教程(第2版•英文版)》阐述了如何修改系统使之满足读者自己的需求,使读者能从中学习一些嵌入式工程中非常有用的提示和技巧。
《嵌入式Linux基础教程(第2版)(英文版)》适合Linux程序员阅读,也可作为高等院校相关专业师生的参考读物。
作者簡介:
哈利南,Christopher Hallinan,著名嵌入式Linux技术专家。Mentor Graphics公司技术市场工程师。Monta Vista软件公司现场应用工程师,3Com司工程总监,Crosscomm公司工程总监。他有25年以上网络和通信产品的软硬件开发经验。曾担任Linux咨询师,提供定制Linux主板接口、设备驱动程序和引导装入程序等方面的解决方案。
目錄
tramfs 153
6.5.1 Customizing 154
6.3.1 inittab 143
6.3.2 Sample Web Server Startup Script 145
6.4 Initial RAM Disk 146
6.4.1 Booting with initrd 147
6.4.2 Bootloader Support for initrd 148
6.4.3 initrd Magic: linuxrc 150
6.4.4 The initrd Plumbing 151
6.4.5 Building an initrd Image 152
6.5 Using initramfs 153
6.5.1 Customizing initramfs 154
6.6 Shutdown 156
6.7 Summary 156
6.7.1 Suggestions for Additional Reading 157
Chapter 7 Bootloaders 159
7.1 Role of a Bootloader 160
7.2 Bootloader Challenges 161
7.2.1 DRAM Controller 161
7.2.2 Flash Versus RAM 162
7.2.3 Image Complexity 162
7.2.4 Execution Context 165
7.3 A Universal Bootloader: Das U-Boot 166
7.3.1 Obtaining U-Boot 166
7.3.2 Configuring U-Boot 167
7.3.3 U-Boot Monitor Commands 169
7.3.4 Network Operations 170
7.3.5 Storage Subsystems 173
7.3.6 Booting from Disk 174
7.4 Porting U-Boot 174
7.4.1 EP405 U-Boot Port 175
7.4.2 U-Boot Makefile Configuration Target 176
7.4.3 EP405 First Build 177
7.4.4 EP405 Processor Initialization 178
7.4.5 Board-Specific Initialization 181
7.4.6 Porting Summary 184
7.4.7 U-Boot Image Format 185
7.5 Device Tree Blob (Flat Device Tree) 187
7.3.6 Booting from Disk 174
7.4 Porting U-Boot 174
7.4.1 EP405 U-Boot Port 175
7.4.2 U-Boot Makefile Configuration Target 176
7.4.3 EP405 First Build 177
7.4.4 EP405 Processor Initialization 178
7.4.5 Board-Specific Initialization 181
7.4.6 Porting Summary 184
7.4.7 U-Boot Image Format 185
7.5 Device Tree Blob (Flat Device Tree) 187
7.5.1 Device Tree Source 189
7.5.2 Device Tree Compiler 192
7.5.3 Alternative Kernel Images Using DTB 193
7.6 Other Bootloaders 194
7.6.1 Lilo 194
7.6.2 GRUB 195
7.6.3 Still More Bootloaders 197
7.7 Summary 197
7.7.1 Suggestions for Additional Reading 198
Chapter 8 Device Driver Basics 201
8.1 Device Driver Concepts 202
8.1.1 Loadable Modules 203
8.1.2 Device Driver Architecture 204
8.1.3 Minimal Device Driver Example 204
8.1.4 Module Build Infrastructure 205
8.1.5 Installing a Device Driver 209
8.1.6 Loading a Module 210
8.1.7 Module Parameters 211
8.2 Module Utilities 212
8.2.1 insmod 212
8.2.2 lsmod 213
8.2.3 modprobe 213
8.2.4 depmod 214
8.2.5 rmmod 215
8.2.6 modinfo 216
8.3 Driver Methods 217
8.1.5 Installing a Device Driver 209
8.1.6 Loading a Module 210
8.1.7 Module Parameters 211
8.2 Module Utilities 212
8.2.1 insmod 212
8.2.2 lsmod 213
8.2.3 modprobe 213
8.2.4 depmod 214
8.2.5 rmmod 215
8.2.6 modinfo 216
8.3 Driver Methods 217
8.3.1 Driver File System Operations 217
8.3.2 Allocation of Device Numbers 220
8.3.3 Device Nodes and mknod 220
8.4 Bringing It All Together 222
8.5 Building Out-of-Tree Drivers 223
8.6 Device Drivers and the GPL 224
8.7 Summary 225
8.7.1 Suggestions for Additional Reading 226
Chapter 9 File Systems 227
9.1 Linux File System Concepts 228
9.1.1 Partitions 229
9.2 ext2 230
9.2.1 Mounting a File System 232
9.2.2 Checking File System Integrity 233
9.3 ext3 235
9.4 ext4 237
9.5 ReiserFS 238
9.6 JFFS2 239
9.6.1 Building a JFFS2 Image 240
9.7 cramfs 242
9.8 Network File System 244
9.8.1 Root File System on NFS 246
9.9 Pseudo File Systems 248
9.9.1 /proc File System 249
9.9.2 sysfs 252
9.4 ext4 237
9.5 ReiserFS 238
9.6 JFFS2 239
9.6.1 Building a JFFS2 Image 240
9.7 cramfs 242
9.8 Network File System 244
9.8.1 Root File System on NFS 246
9.9 Pseudo File Systems 248
9.9.1 /proc File System 249
9.9.2 sysfs 252
9.10 Other File Systems 255
9.11 Building a Simple File System 256
9.12 Summary 258
9.12.1 Suggestions for Additional Reading 259
Chapter 10 MTD Subsystem 261
10.1 MTD Overview 262
10.1.1 Enabling MTD Services 263
10.1.2 MTD Basics 265
10.1.3 Configuring MTD on Your Target 267
10.2 MTD Partitions 267
10.2.1 Redboot Partition Table Partitioning 269
10.2.2 Kernel Command-Line Partitioning 273
10.2.3 Mapping Driver 274
10.2.4 Flash Chip Drivers 276
10.2.5 Board-Specific Initialization 276
10.3 MTD Utilities 279
10.3.1 JFFS2 Root File System 281
10.4 UBI File System 284
10.4.1 Configuring for UBIFS 284
10.4.2 Building a UBIFS Image 284
10.4.3 Using UBIFS as the Root File System 287
10.5 Summary 287
10.5.1 Suggestions for Additional Reading 288
Chapter 11 BusyBox 289
11.1 Introduction to BusyBox 290
11.1.1 BusyBox Is Easy 291
11.2 BusyBox Configuration 291
11.2.1 Cross-Compiling BusyBox 293
11.3 BusyBox Operation 293
11.3.1 BusyBox init 297
11.3.2 Sample rcS Initialization Script 299
11.3.3 BusyBox Target Installation 300
11.3.4 BusyBox Applets 302
11.4 Summary 303
11.4.1 Suggestions for Additional Reading 304
Chapter 12 Embedded Development Environment 305
12.1 Cross-Development Environment 306
12.1.1 “Hello World” Embedded 307
12.2 Host System Requirements 311
12.2.1 Hardware Debug Probe 311
12.3 Hosting Target Boards 312
12.3.1 TFTP Server 312
12.3.2 BOOTP/DHCP Server 313
12.3.3 NFS Server 316
12.3.4 Target NFS Root Mount 318
12.3.5 U-Boot NFS Root Mount Example 320
12.4 Summary 322
12.4.1 Suggestions for Additional Reading 323
Chapter 13 Development Tools 325
13.1 GNU Debugger (GDB) 326
12.3 Hosting Target Boards 312
12.3.1 TFTP Server 312
12.3.2 BOOTP/DHCP Server 313
12.3.3 NFS Server 316
12.3.4 Target NFS Root Mount 318
12.3.5 U-Boot NFS Root Mount Example 320
12.4 Summary 322
12.4.1 Suggestions for Additional Reading 323
Chapter 13 Development Tools 325
13.1 GNU Debugger (GDB) 326
13.1.1 Debugging a Core Dump 327
13.1.2 Invoking GDB 329
13.1.3 Debug Session in GDB 331
13.2 Data Display Debugger 333
13.3 cbrowser/cscope 335
13.4 Tracing and Profiling Tools 337
13.4.1 strace 337
13.4.2 strace Variations 341
13.4.3 ltrace 343
13.4.4 ps 344
13.4.5 top 346
13.4.6 mtrace 348
13.4.7 dmalloc 350
13.4.8 Kernel Oops 353
13.5 Binary Utilities 355
13.5.1 readelf 355
13.5.2 Examining Debug Information Using readelf 357
13.5.3 objdump 359
13.5.4 objcopy 360
13.6 Miscellaneous Binary Utilities 361
13.6.1 strip 361
13.6.2 addr2line 361
13.6.3 strings 362
13.6.4 ldd 362
13.6.5 nm 363
13.6.6 prelink 364
13.5.2 Examining Debug Information Using readelf 357
13.5.3 objdump 359
13.5.4 objcopy 360
13.6 Miscellaneous Binary Utilities 361
13.6.1 strip 361
13.6.2 addr2line 361
13.6.3 strings 362
13.6.4 ldd 362
13.6.5 nm 363
13.6.6 prelink 364
13.7 Summary 364
13.7.1 Suggestions for Additional Reading 365
Chapter 14 Kernel Debugging Techniques 367
14.1 Challenges to Kernel Debugging 368
14.2 Using KGDB for Kernel Debugging 369
14.2.1 KGDB Kernel Configuration 371
14.2.2 Target Boot with KGDB Support 372
14.2.3 Useful Kernel Breakpoints 376
14.2.4 Sharing a Console Serial Port with KGDB 377
14.2.5 Debugging Very Early Kernel Code 379
14.2.6 KGDB Support in the Mainline Kernel 380
14.3 Kernel Debugging Techniques 381
14.3.1 gdb Remote Serial Protocol 382
14.3.2 Debugging Optimized Kernel Code 385
14.3.3 GDB User-Defined Commands 392
14.3.4 Useful Kernel GDB Macros 393
14.3.5 Debugging Loadable Modules 402
14.3.6 printk Debugging 407
14.3.7 Magic SysReq Key 409
14.4 Hardware-Assisted Debugging 410
14.4.1 Programming Flash Using a JTAG Probe 411
14.4.2 Debugging with a JTAG Probe 413
14.5 When It Doesn't Boot 417
14.5.1 Early Serial Debug Output 417
14.5.2 Dumping the printk Log Buffer 417
14.5.3 KGDB on Panic 420
14.3.4 Useful Kernel GDB Macros 393
14.3.5 Debugging Loadable Modules 402
14.3.6 printk Debugging 407
14.3.7 Magic SysReq Key 409
14.4 Hardware-Assisted Debugging 410
14.4.1 Programming Flash Using a JTAG Probe 411
14.4.2 Debugging with a JTAG Probe 413
14.5 When It Doesn't Boot 417
14.5.1 Early Serial Debug Output 417
14.5.2 Dumping the printk Log Buffer 417
14.5.3 KGDB on Panic 420
14.6 Summary 421
14.6.1 Suggestions for Additional Reading 422
Chapter 15 Debugging Embedded Linux Applications 423
15.1 Target Debugging 424
15.2 Remote (Cross) Debugging 424
15.2.1 gdbserver 427
15.3 Debugging with Shared Libraries 429
15.3.1 Shared Library Events in GDB 431
15.4 Debugging Multiple Tasks 435
15.4.1 Debugging Multiple Processes 435
15.4.2 Debugging Multithreaded Applications 438
15.4.3 Debugging Bootloader/Flash Code 441
15.5 Additional Remote Debug Options 442
15.5.1 Debugging Using a Serial Port 442
15.5.2 Attaching to a Running Process 442
15.6 Summary 443
15.6.1 Suggestions for Additional Reading 444
Chapter 16 Open Source Build Systems 445
16.1 Why Use a Build System? 446
16.2 Scratchbox 447
16.2.1 Installing Scratchbox 447
16.2.2 Creating a Cross-Compilation Target 448
16.3 Buildroot 451
16.3.1 Buildroot Installation 451
16.3.2 Buildroot Configuration 451
15.6 Summary 443
15.6.1 Suggestions for Additional Reading 444
Chapter 16 Open Source Build Systems 445
16.1 Why Use a Build System? 446
16.2 Scratchbox 447
16.2.1 Installing Scratchbox 447
16.2.2 Creating a Cross-Compilation Target 448
16.3 Buildroot 451
16.3.1 Buildroot Installation 451
16.3.2 Buildroot Configuration 451
16.3.3 Buildroot Build 452
16.4 OpenEmbedded 454
16.4.1 OpenEmbedded Composition 455
16.4.2 BitBake Metadata 456
16.4.3 Recipe Basics 456
16.4.4 Metadata Tasks 460
16.4.5 Metadata Classes 461
16.4.6 Configuring OpenEmbedded 462
16.4.7 Building Images 463
16.5 Summary 464
16.5.1 Suggestions for Additional Reading 464
Chapter 17 Linux and Real Time 465
17.1 What Is Real Time? 466
17.1.1 Soft Real Time 466
17.1.2 Hard Real Time 467
17.1.3 Linux Scheduling 467
17.1.4 Latency 467
17.2 Kernel Preemption 469
17.2.1 Impediments to Preemption 469
17.2.2 Preemption Models 471
17.2.3 SMP Kernel 472
17.2.4 Sources of Preemption Latency 473
17.3 Real-Time Kernel Patch 473
17.3.1 Real-Time Features 475
17.3.2 O(1) Scheduler 476
17.1.3 Linux Scheduling 467
17.1.4 Latency 467
17.2 Kernel Preemption 469
17.2.1 Impediments to Preemption 469
17.2.2 Preemption Models 471
17.2.3 SMP Kernel 472
17.2.4 Sources of Preemption Latency 473
17.3 Real-Time Kernel Patch 473
17.3.1 Real-Time Features 475
17.3.2 O(1) Scheduler 476
17.3.3 Creating a Real-Time Process 477
17.4 Real-Time Kernel Performance Analysis 478
17.4.1 Using Ftrace for Tracing 478
17.4.2 Preemption Off Latency Measurement 479
17.4.3 Wakeup Latency Measurement 481
17.4.4 Interrupt Off Timing 483
17.4.5 Soft Lockup Detection 484
17.5 Summary 485
17.5.1 Suggestion for Additional Reading 485
Chapter 18 Universal Serial Bus 487
18.1 USB Overview 488
18.1.1 USB Physical Topology 488
18.1.2 USB Logical Topology 490
18.1.3 USB Revisions 491
18.1.4 USB Connectors 492
18.1.5 USB Cable Assemblies 494
18.1.6 USB Modes 494
18.2 Configuring USB 495
18.2.1 USB Initialization 497
18.3 sysfs and USB Device Naming 500
18.4 Useful USB Tools 502
18.4.1 USB File System 502
18.4.2 Using usbview 504
18.4.3 USB Utils (lsusb) 507
18.5 Common USB Subsystems 508
18.5.1 USB Mass Storage Class 508
18.1.6 USB Modes 494
18.2 Configuring USB 495
18.2.1 USB Initialization 497
18.3 sysfs and USB Device Naming 500
18.4 Useful USB Tools 502
18.4.1 USB File System 502
18.4.2 Using usbview 504
18.4.3 USB Utils (lsusb) 507
18.5 Common USB Subsystems 508
18.5.1 USB Mass Storage Class 508
18.5.2 USB HID Class 511
18.5.3 USB CDC Class Drivers 512
18.5.4 USB Network Support 515
18.6 USB Debug 516
18.6.1 usbmon 517
18.6.2 Useful USB Miscellanea 518
18.7 Summary 519
18.7.1 Suggestions for Additional Reading 519
Chapter 19 udev 521
19.1 What Is udev? 522
19.2 Device Discovery 523
19.3 Default udev Behavior 525
19.4 Understanding udev Rules 527
19.4.1 Modalias 530
19.4.2 Typical udev Rules Configuration 533
19.4.3 Initial System Setup for udev 535
19.5 Loading Platform Device Drivers 538
19.6 Customizing udev Behavior 540
19.6.1 udev Customization Example: USB Automounting 540
19.7 Persistent Device Naming 541
19.7.1 udev Helper Utilities 542
19.8 Using udev with busybox 545
19.8.1 busybox mdev 545
19.8.2 Configuring mdev 547
19.9 Summary 548
19.9.1 Suggestions for Additional Reading 548
19.6 Customizing udev Behavior 540
19.6.1 udev Customization Example: USB Automounting 540
19.7 Persistent Device Naming 541
19.7.1 udev Helper Utilities 542
19.8 Using udev with busybox 545
19.8.1 busybox mdev 545
19.8.2 Configuring mdev 547
19.9 Summary 548
19.9.1 Suggestions for Additional Reading 548
Appendix A GNU Public License 549
Preamble 550
Terms and Conditions for Copying, Distribution, and Modification 551
No Warranty 555
Appendix B U-Boot Configurable Commands 557
Appendix C BusyBox Commands 561
Appendix D SDRAM Interface Considerations 571
D.1 SDRAM Basics 572
D.1.1 SDRAM Refresh 573
D.2 Clocking 574
D.3 SDRAM Setup 575
D.4 Summary 580
D.4.1 Suggestions for Additional Reading 580
Appendix E Open Source Resources 581
Source Repositories and Developer Information 582
Mailing Lists 582
Linux News and Developments 583
Open Source Legal Insight and Discussion 583
Appendix F Sample BDI-2000 Configuration File 585
Index 593
tramfs 153
6.5.1 Customizing 154
6.3.1 inittab 143
6.3.2 Sample Web Server Startup Script 145
6.4 Initial RAM Disk 146
6.4.1 Booting with initrd 147
6.4.2 Bootloader Support for initrd 148
6.4.3 initrd Magic: linuxrc 150
6.4.4 The initrd Plumbing 151
6.4.5 Building an initrd Image 152
6.5 Using initramfs 153
6.5.1 Customizing initramfs 154
6.6 Shutdown 156
6.7 Summary 156
6.7.1 Suggestions for Additional Reading 157
Chapter 7 Bootloaders 159
7.1 Role of a Bootloader 160
7.2 Bootloader Challenge...
購物須知
退換貨說明:
會員均享有10天的商品猶豫期(含例假日)。若您欲辦理退換貨,請於取得該商品10日內寄回。
辦理退換貨時,請保持商品全新狀態與完整包裝(商品本身、贈品、贈票、附件、內外包裝、保證書、隨貨文件等)一併寄回。若退回商品無法回復原狀者,可能影響退換貨權利之行使或須負擔部分費用。
訂購本商品前請務必詳閱退換貨原則。