Today, Linux is included with nearly every embedded platform. Embedded developers can take a more modern route and spend more time tuning Linux and taking advantage of open source code to build more robust, feature-rich applications. While Gene Sally does not neglect porting Linux to new hardware, modern embedded hardware is more sophisticated than ever: most systems include the capabilities found on desktop systems. This book is written from the perspective of a user employing technologies and techniques typically reserved for desktop systems. Modern guide for developing embedded Linux systems Shows you how to work with existing Linux embedded system, while still teaching how to port Linux Explains best practices from somebody who has done it before Pro Linux Embedded Systems (December 2009) (ATTiCA)......Page 1 Contents at a Glance......Page 6 Contents......Page 7 About the Author......Page 18 About the Technical Reviewer......Page 19 Acknowledgments......Page 20 Introduction......Page 21 About Embedded Linux......Page 23 Technical Reasons to Use Embedded Linux......Page 24 Standards Based......Page 25 Process Isolation and Control......Page 26 Security......Page 28 Commercial Reasons to Use Embedded Linux......Page 29 Target Hardware......Page 31 Development Environment......Page 32 Anatomy of an Embedded Linux System......Page 33 Boot Loader......Page 34 Root File System......Page 35 Cross-Compiler......Page 36 The GNU Compiler Collection......Page 37 uClibc......Page 38 Packaging Systems......Page 39 Make......Page 40 Mailing Lists and Newsgroups......Page 41 Vendor-Sponsored Resources......Page 42 Trade Group and Community Interest Sites......Page 43 Next Up......Page 45 Configuring the Software Environment......Page 47 Linux......Page 48 Debian (Ubuntu) Systems......Page 49 RPM......Page 50 Cygwin......Page 51 Virtual Linux Machines on Windows......Page 61 Host Services......Page 65 TFTP......Page 66 DHCP......Page 67 NFS......Page 69 NFS with Cygwin......Page 70 PXE......Page 72 Network......Page 73 Dual-Homed Host......Page 74 Why Target Emulation?......Page 77 Compiling QEMU......Page 78 Using QEMU to Emulate a Target......Page 80 Using QEMU to Compile under Emulation......Page 82 Approaches to Virtualization......Page 83 Summary......Page 84 Starting Your Project......Page 85 Most Boards Include a Linux Distribution......Page 86 What to Do After Unpacking the Board......Page 87 Have Linux? Boot It!......Page 88 Locate Sources and Patches......Page 95 Locate the Configuration......Page 96 File System Format......Page 98 Devices and In-Memory File Systems......Page 101 Suitability for Your Project......Page 102 Cross-Compiler......Page 103 Moving Forward......Page 104 Getting Linux for Your Board......Page 105 Questions You Should Ask Your Board Vendor......Page 106 Open Source Embedded Distributions......Page 109 Should You Use One?......Page 110 LTIB (http://www.bitshrine.org)......Page 111 Buildroot (http://buildroot.uclibc.org/)......Page 115 OpenEmbedded (http://wiki.openembedded.net/)......Page 120 Do You Need a Commercial Vendor?......Page 124 What You Should Expect......Page 125 MontaVista......Page 126 Free Electrons......Page 127 What’s Next......Page 128 Creating a Linux Distribution from Scratch......Page 129 Cross-Compiler Basics......Page 130 A Note about Building Software......Page 131 Get Comfortable with the Command Line......Page 132 Overview of Building a GCC Cross-Compiler......Page 133 Gathering Sources......Page 134 Getting Sources via Source Control......Page 135 Getting via Source Archives......Page 137 The Build Environment......Page 139 Binutils......Page 141 Kernel Headers......Page 142 Bootstrap (Stage 1) GCC......Page 143 Creating Glibc Headers......Page 145 Building Glibc......Page 147 Building the Next GCC......Page 148 Building GMP and MPFR......Page 149 Building the Final GCC......Page 151 Building Toolchains with Crosstool-NG......Page 152 Creating the Root File System......Page 153 Building and Installing BusyBox......Page 154 Libraries......Page 155 Finishing Touches......Page 156 Building the Kernel......Page 157 Improperly Configured Board......Page 160 The Root File System init Program Doesn’t Run......Page 161 Distributing the Distribution......Page 162 Wrapping Up......Page 163 The Boot Loader......Page 165 Kernel-Land vs. Userland......Page 168 RedBoot......Page 169 YAMON......Page 171 Das U-Boot......Page 172 LILO......Page 173 About Flash Memory......Page 174 Kernel Startup......Page 175 The Kernel Entry Point......Page 176 Sysfs and Device Management......Page 177 Finding a Root File System......Page 178 Userland Startup......Page 183 Mysteries of the /etc/init.d Directory......Page 186 Your Init......Page 187 What’s Next......Page 189 Know Your Application......Page 191 Hardware Constraints......Page 192 Software Constraints......Page 193 C......Page 194 Java Runtime Environment......Page 195 Embedded GCJ......Page 196 Embedding Python......Page 197 Debugging......Page 198 Embedding TCL......Page 199 Shell Scripting......Page 200 PHP......Page 201 Profiling......Page 202 Leak Detection......Page 206 dmalloc......Page 207 Mpatrol......Page 208 Static Analysis......Page 209 Your Editor + Make + Shell......Page 210 Using Make......Page 211 Installing Eclipse and Plug-ins......Page 213 Using Eclipse......Page 216 What’s Next......Page 218 Desktop vs. Target......Page 219 Coding for Portability......Page 220 FIFO......Page 221 Hello World......Page 222 Making Make Work......Page 223 Running the Code on the Target......Page 227 More Complex Projects......Page 228 Getting Ready for Debugging......Page 233 What’s Next......Page 235 Types of Debugging......Page 237 Remote Debugging Overview......Page 238 Building GDB......Page 239 GDB Front Ends......Page 240 Compiling for Debugging......Page 241 GDB Command Line Survival Guide......Page 243 Remote Debugging with DDD......Page 244 Remote Debugging with GNU Emacs......Page 246 Remote Debugging with Eclipse......Page 247 Debugging Java......Page 251 Instrumentation......Page 255 Java Instrumentation......Page 257 What’s Next......Page 258 Kernel Project Layout......Page 259 Downloading the Kernel......Page 261 Downloading a Compressed Tar File......Page 262 Building the Kernel......Page 263 How Kernel Configuration Works......Page 266 Default Configurations......Page 267 Building the Kernel......Page 269 Building Modules......Page 272 Cleaning Up......Page 273 Contributing to the Linux Kernel......Page 274 Applying Patches......Page 276 What’s Next......Page 277 Real Time......Page 279 Deadline......Page 280 Periodic Task......Page 281 Real-Time Scheduler......Page 282 Real-Time Implementation in Linux......Page 283 Getting the Patch......Page 284 Lock Memory......Page 286 Asking for Priority Inheritance Mutexes......Page 287 Using Thread Pools......Page 288 LatencyTOP......Page 289 DMA Bus Mastering......Page 292 Summary......Page 293 Using Open Source Packages......Page 295 How an Open Source Project Is Structured......Page 296 Permissive vs. Restrictive Licenses......Page 297 Common Licensing Types......Page 298 Downloading......Page 299 Using Source Control Systems to Fetch Code......Page 300 Using CVS......Page 301 Using Subversion......Page 302 Using Mercurial......Page 303 Using configure......Page 304 Creating the Script......Page 305 Gaming the Cache......Page 307 Setting Other Configure Options......Page 308 Configuration Process for Non-Automake Projects......Page 309 Building and Installing......Page 310 JamVM......Page 311 Micro_httpd......Page 312 fgetty......Page 313 How a BusyBox-Based System Is Structured......Page 315 Building a BusyBox-Based System......Page 316 Configure......Page 317 Build......Page 319 Install......Page 320 Default Init Scripts......Page 321 Create Additional Folders......Page 323 What Makes BusyBox Small?......Page 324 Create the Applet Code......Page 325 Register Applet with BusyBox......Page 326 Build and Verify......Page 327 What’s Next......Page 329 The Big Picture......Page 331 U-Boot......Page 332 Selecting a Root File System......Page 335 Block-Based File Systems......Page 336 Ext2......Page 338 MINIX......Page 339 JFFS2......Page 340 Initramfs......Page 341 Create the Staging Area......Page 342 Gather Libraries and Required Files......Page 343 Required Files......Page 344 Create Initialization Scripts......Page 345 Using Init and Inittab......Page 346 Using a Program......Page 347 Set Ownership and Permissions......Page 349 Built-In Security......Page 350 SELinux......Page 351 Using SEEdit......Page 353 PAM......Page 354 What’s Next......Page 356 Three or Fewer Megabytes......Page 357 More than a Gigabyte......Page 358 Start from Zero......Page 359 Mounting Small File Systems......Page 360 Shared Libraries......Page 361 Compiling to Save Space......Page 362 Static Linking......Page 363 Reducing the Size of the Kernel......Page 365 Removing Unneeded Features and Drivers......Page 366 Recommendations for Embedded Systems......Page 367 Measuring......Page 369 Minimizing Boot Time......Page 371 No Console Output on Boot......Page 372 Deferred Initialization......Page 373 Grabserial......Page 374 Initcall_debug......Page 377 Use a Read-Only File System......Page 378 Replacing Initialization Scripts......Page 379 Inittab Abuse......Page 381 Link with GNU Hash Style......Page 382 What’s Next......Page 383 Deployment for Embedded Devices......Page 385 Requirements......Page 386 Mechanical Design......Page 387 Electrical Engineering......Page 388 Software Design......Page 389 Software Engineering......Page 390 Manufacturing......Page 391 Deployment Strategies and Tactics......Page 393 In General......Page 394 UBOOT: Configuring Initial Parameters......Page 395 Expect......Page 396 Using Expect......Page 397 Boot Loaders Are Just Programs......Page 399 Deployment Root File Systems......Page 400 Small Root File Systems......Page 401 What’s Next......Page 403 Root File System Updates......Page 405 Forklift Upgrade......Page 406 Designing for Forklift Upgrades......Page 407 Forklift-Upgrade Example......Page 408 Parallel System Example......Page 410 Do It Yourself......Page 411 Using Package Managers......Page 412 RPM......Page 413 Dpkg......Page 417 Ipkg......Page 420 Kernel Updates......Page 423 Forklift Upgrade......Page 424 Using Modprobe......Page 425 Roll Your Own......Page 426 Forklift......Page 427 Failsafe Kernel......Page 428 In Summary......Page 429 Index......Page 431 Today, Linux is included with nearly every embedded platform. Embedded developers can take a more modern route and spend more time tuning Linux and taking advantage of open source code to build more robust, feature-rich applications. While Gene Sally does not neglect porting Linux to new hardware, modern embedded hardware is more sophisticated than most systems include the capabilities found on desktop systems. This book is written from the perspective of a user employing technologies and techniques typically reserved for desktop systems. Modern guide for developing embedded Linux systems Shows you how to work with existing Linux embedded system, while still teaching how to port Linux Explains best practices from somebody who has done it before What you'll learn The anatomy of an embedded Linux project How to create an embedded Linux development environment How to configure and build an embedded Linux kernel How to configure and build open source projects for embedded systems How to minimize resources and boot times What resources are available in open source to help you build your project Who is this book for?This book is for professional embedded developers who have an understanding of basic software development concepts. You don't have to be familiar with Linux, but you should be comfortable working from the command-line. Modern Embedded Hardware Is More Sophisticated Than Ever: Most Systems Include The Capabilities Found On Desktop Systems. This Book Is Written From The Perspective Of A User Employing Technologies And Techniques Typically Reserved For Desktop Systems--resource Description Page. Gene Sally. Description Based On Resource Description Page (viewed June 25, 2010). Includes Index.