SlideShare a Scribd company logo
Visit https://ebookgate.com to download the full version and
explore more ebooks
Embedded Linux system design and development 1st
Edition P. Raghavan
_____ Click the link below to download _____
https://ebookgate.com/product/embedded-linux-system-
design-and-development-1st-edition-p-raghavan/
Explore and download more ebooks at ebookgate.com
Here are some recommended products that might interest you.
You can download now and explore!
Embedded System Design Third Edition Santanu Chattopadhyay
https://ebookgate.com/product/embedded-system-design-third-edition-
santanu-chattopadhyay/
ebookgate.com
Principles Of Complier Design 1st Edition Raghavan
https://ebookgate.com/product/principles-of-complier-design-1st-
edition-raghavan/
ebookgate.com
Linux for embedded and real time applications 2nd Edition
Doug Abbott
https://ebookgate.com/product/linux-for-embedded-and-real-time-
applications-2nd-edition-doug-abbott/
ebookgate.com
Linux Thin Client Networks Design and Deployment A quick
guide for System Administrators David Richards
https://ebookgate.com/product/linux-thin-client-networks-design-and-
deployment-a-quick-guide-for-system-administrators-david-richards/
ebookgate.com
Linux system programming 1st Edition Robert Love
https://ebookgate.com/product/linux-system-programming-1st-edition-
robert-love/
ebookgate.com
Linux System Administration 1st ed Edition Tom Adelstein
https://ebookgate.com/product/linux-system-administration-1st-ed-
edition-tom-adelstein/
ebookgate.com
Automating Linux and Unix System Administration 2nd
Edition Campi
https://ebookgate.com/product/automating-linux-and-unix-system-
administration-2nd-edition-campi/
ebookgate.com
Fast and Effective Embedded Systems Design 1st Edition Rob
Toulson
https://ebookgate.com/product/fast-and-effective-embedded-systems-
design-1st-edition-rob-toulson/
ebookgate.com
Red Hat Linux Networking and System Administration Terry
Collings
https://ebookgate.com/product/red-hat-linux-networking-and-system-
administration-terry-collings/
ebookgate.com
Complete Download Embedded Linux system design and development 1st Edition P. Raghavan PDF All Chapters
Complete Download Embedded Linux system design and development 1st Edition P. Raghavan PDF All Chapters
EMBEDDED
LINUX SYSTEM
DESIGN AND
DEVELOPMENT
Complete Download Embedded Linux system design and development 1st Edition P. Raghavan PDF All Chapters
TEAM
FLY
Boca Raton New York
EMBEDDED
LINUX SYSTEM
DESIGN AND
DEVELOPMENT
P. Raghavan • Amol Lad • Sriram Neelakandan
Published in 2006 by
Auerbach Publications
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742
© 2006 by Taylor & Francis Group, LLC
Auerbach is an imprint of Taylor & Francis Group
No claim to original U.S. Government works
Printed in the United States of America on acid-free paper
10 9 8 7 6 5 4 3 2 1
International Standard Book Number-10: 0-8493-4058-6 (Hardcover)
International Standard Book Number-13: 978-0-8493-4058-1 (Hardcover)
Library of Congress Card Number 2005048179
This book contains information obtained from authentic and highly regarded sources. Reprinted material is quoted with
permission, and sources are indicated. A wide variety of references are listed. Reasonable efforts have been made to publish
reliable data and information, but the author and the publisher cannot assume responsibility for the validity of all materials
or for the consequences of their use.
No part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or
other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information
storage or retrieval system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, please access www.copyright.com
(http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC) 222 Rosewood Drive, Danvers, MA
01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For
organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged.
Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for
identification and explanation without intent to infringe.
Library of Congress Cataloging-in-Publication Data
Raghavan, P. (Pichai), 1973-
Embedded Linux system design and development / P. Raghavan, Amol Lad, Sriram Neelakandan.
p. cm.
Includes bibliographical references and index.
ISBN 0-8493-4058-6 (alk. paper)
1. Linux. 2. Operating systems (Computers) 3. Embedded computer systems. I. Lad, Amol. II.
Neelakandan, Sriram. III. Title.
QA76.76.O63R335 2005
005.4'32--dc22 2005048179
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com
and the Auerbach Publications Web site at
http://www.auerbach-publications.com
Taylor & Francis Group
is the Academic Division of T&F Informa plc.
All source code in the book is released under GNU GPL v2. It can be used as desired under terms and
conditions of GNU GPL v2.
Trademarks
 MIPS is a registered trademark and YAMON is a trademark of MIPS Technologies.
 IBM and ClearCase are registered trademarks and PowerPC is a trademark of International Business
Machines Corporation.
 UNIX is a registered trademark in the United States and other countries, licensed exclusively through
X/Open Company Limited.
 X11 is a trademark of Massachusetts Institute of Technology.
 NEC is a registered trademark of NEC Corporation
 HP is a registered trademark of Hewlett-Packard Company.
 ColdFire is a registered trademark and Motorola is a trademark of Motorola, Inc
 Microblaze is trademark of Xilinx Inc
 Red Hat is a registered trademark and eCos and RedBoot are trademarks of Red Hat, Inc.
 uClinux is a registered trademark of Arcturus Networks Inc
 Linux is a registered trademark of Linus Torvalds
 GoAhead is a registered trademark of GoAhead Software, Inc
 RTLinux is a registered trademark and FSMLabs, RTLinuxPro and RTCore are trademarks of Finite State
Machine Labs, Inc
 Debian is a registered trademark of Software in the Public Interest, Inc
 LMBench is a trademark of BitMover, Inc
 VRTX is a trademark of Microtech Research Inc
 VxWorks and pSOS are registered trademarks of Wind River Systems, Inc
 Trolltech is registered trademark and Qt is a trademark of Trolltech in Norway, the United States and
other countries
 OpenGL is a registered trademark of Silicon Graphics, Inc
 Perforce is a registered trademark of Perforce Software, Inc
 Eclipse is trademark of Eclipse Foundation, Inc
 KDE and K Desktop Environment are trademarks of KDE
 FFmpeg is a trademark of Fabrice Bellard, originator of the FFmpeg project
 NVIDIA is a registered trademark of NVIDIA Corporation in the United States and other countries
 ViewML is a registered trademark of Century Software Inc
 QNX and Neutrino are registered trademarks of QNX Software Systems Ltd
 Nucleus is a trademark of Accelerated Technology, Inc
 Accelerated Technology is a registered trademark of Mentor Graphics Corporation
 ARM and StrongARM are registered trademarks and ARM7 and ARM9 are trademarks of Advanced RISC
Machines, Ltd.
 AMD is a registered trademark of Advanced Micro Devices, Inc.
 Intel and Pentium are registered trademarks and i386 and XScale are trademarks of Intel Corporation.
 Sharp is a registered trademark of Sharp Electronics Corp.
 SPARC is a registered trademark of SPARC International, Inc., and is used under license by Sun
Microsystems, Inc.
 Toshiba is a registered trademark of the Toshiba Corporation.
 MontaVista is registered trademark of MontaVista Software Inc.
 LynxOS and BlueCat are registered trademarks and LynuxWorks, SpyKer and VisualLynux are trademarks
of LynuxWorks, Inc.
 Samsung is a registered trademark of Samsung Electronics America, Inc. and its related entities.
 Ericsson is a registered trademark of Ericsson, Inc.
 Atmel is registered trademarks of Atmel Corporation.
 TimeSys®, TimeStorm®, TimeStorm IDE™, TimeStorm LVS™, TimeStorm LDS™, TimeStorm LHD™,
TimeSys Reservations™, TimeTrace®, Linux/RTTM and TimeWiz® are registered or unregistered trademarks
of TimeSys Corporation in the United States and other countries.
 NeoMagic is registered trademark of NeoMagic Corporation.
 Transmeta is a trademark of Transmeta Corporation.
 Broadcom is a registered trademark of Broadcom Corporation and/or its subsidiaries.
 SuSE is a registered trademark of SuSE AG.
vi Embedded Linux System Design and Development
 Borland is a registered trademark of Borland Software Corporation in the United States and other
countries.
 Merant is a registered trademark of Merant.
 SnapGear is a registered trademark of SnapGear Inc.
 Matsushita is a trademark of the Matsushita Electric Corporation.
 I2C is a trademark of Philips Semiconductors Corporation.
 Philips® is a registered trademark of Philips Consumer Electronics Corporation.
 Cadenux is a trademark of Cadenux, LLC.
 ELinOS is a registered trademark of SYSGO AG.
 Metrowerks and CodeWarrior are trademarks of Metrowerks Corp. in the U.S. or other countries.
 FreeBSD is a registered trademark of the FreeBSD Foundation.
 IEEE and POSIX are registered trademarks of Institute of Electrical and Electronics Engineers, Inc. in
the United States.
 Xtensa is a trademark belonging to Tensilica Inc.
 Fujitsu is a registered trademark of Fujitsu, Ltd.
 Firewire is a registered trademark of Apple computer.
 SuperH is a trademark of Hitachi, Ltd.
 Windows, WinCE and Microsoft are registered trademarks and MS-DOS and DirectX .are trademarks of
Microsoft Corporation.
 Solaris and Java are registered trademarks and ChorusOS is a trademark of Sun Microsystems, Inc. in
the U.S. or other countries.
 Symbian is a trademark of Symbian Ltd.
vii
Dedication
Raghavan
In memory of my late father
Amol
To Lord Krsna,
. . . my parents, my wife Parul, and my brother Amit
Sriram
To my family and all Linux enthusiasts
Complete Download Embedded Linux system design and development 1st Edition P. Raghavan PDF All Chapters
ix
Contents
1 Intr oduction ............................................................................................. 1
1.1 History of Embedded Linux .................................................... 2
1.1.1 Year 1999 ..................................................................... 3
1.1.2 Year 2000 ..................................................................... 4
1.1.3 Year 2001 ..................................................................... 4
1.1.4 Year 2002 ..................................................................... 5
1.1.5 Year 2003 ..................................................................... 6
1.1.6 Year 2004 ..................................................................... 6
1.2 Why Embedded Linux? ............................................................ 7
1.2.1 Vendor Independence................................................. 7
1.2.2 Time to Market............................................................ 8
1.2.3 Varied Hardware Support ........................................... 8
1.2.4 Low Cost ...................................................................... 8
1.2.5 Open Source................................................................ 9
1.2.6 Standards (POSIX®) Compliance............................. 10
1.3 Embedded Linux Versus Desktop Linux .............................. 10
1.4 Frequently Asked Questions.................................................. 11
1.4.1 Is Linux Too Large?................................................... 11
1.4.2 Is Linux Real-Time Enough?..................................... 11
1.4.3 How Can I Protect My Proprietary Software?......... 12
1.4.4 Should I Buy a Commercial Embedded
Linux Distribution?..................................................... 12
1.4.5 Which Embedded Linux Distribution Do I
Choose? ...................................................................... 12
1.5 Embedded Linux Distributions.............................................. 13
1.5.1 BlueCat Linux ............................................................ 14
1.5.2 Cadenux ..................................................................... 15
1.5.3 Denx........................................................................... 17
x Embedded Linux System Design and Development
1.5.4 Embedded Debian (Emdebian)................................ 18
1.5.5 ELinOS (SYSGO) ....................................................... 19
1.5.6 Metrowerks ................................................................ 20
1.5.7 MontaVista Linux....................................................... 22
1.5.8 RTLinuxPro™ ............................................................. 23
1.5.9 TimeSys Linux............................................................ 24
1.6 Porting Roadmap.................................................................... 26
Notes ................................................................................................. 28
2 Getting Started ........................................................................................ 29
2.1 Architecture of Embedded Linux .......................................... 29
2.1.1 Real-Time Executive.................................................. 29
2.1.2 Monolithic Kernels .................................................... 30
2.1.3 Microkernel ................................................................ 31
2.2 Linux Kernel Architecture...................................................... 32
2.2.1 Hardware Abstraction Layer (HAL).......................... 33
2.2.2 Memory Manager....................................................... 33
2.2.3 Scheduler.................................................................... 34
2.2.4 File System................................................................. 35
2.2.5 IO Subsystem............................................................. 36
2.2.6 Networking Subsystems............................................ 36
2.2.7 IPC.............................................................................. 36
2.3 User Space .............................................................................. 36
2.4 Linux Start-Up Sequence........................................................ 41
2.4.1 Boot Loader Phase.................................................... 42
2.4.2 Kernel Start-Up .......................................................... 43
2.4.3 User Space Initialization ........................................... 47
2.5 GNU Cross-Platform Toolchain ............................................. 48
2.5.1 Building Toolchain.................................................... 50
2.5.2 Building Toolchain for MIPS.................................... 55
3 Boar d Support Package ......................................................................... 59
3.1 Inserting BSP in Kernel Build Procedure............................. 60
3.2 The Boot Loader Interface..................................................... 62
3.3 Memory Map........................................................................... 66
3.3.1 The Processor Memory Map — MIPS Memory
Model.......................................................................... 67
3.3.2 Board Memory Map .................................................. 68
3.3.3 Software Memory Map.............................................. 68
3.4 Interrupt Management............................................................ 72
3.5 The PCI Subsystem................................................................. 77
3.5.1 Uniqueness of PCI Architecture............................... 77
3.5.2 PCI Software Architecture......................................... 79
Contents xi
3.6 Timers...................................................................................... 81
3.7 UART ....................................................................................... 81
3.7.1 Implementing the Console ....................................... 81
3.7.2 The KGDB Interface ................................................. 82
3.8 Power Management................................................................ 83
3.8.1 Hardware and Power Management ......................... 83
3.8.2 Power Management Standards ................................. 85
3.8.3 Supporting Processor’s Power-Saving Modes ......... 86
3.8.4 Unified Driver Framework for Power
Management............................................................... 87
3.8.5 Power Management Applications............................. 88
4 Embedded Storage ................................................................................. 89
4.1 Flash Map................................................................................ 89
4.2 MTD—Memory Technology Device...................................... 91
4.2.1 The MTD Model........................................................ 91
4.2.2 Flash Chips ................................................................ 92
4.2.3 Flash Disks................................................................. 92
4.3 MTD Architecture ................................................................... 94
4.3.1 mtd_info Data Structure ......................................... 96
4.3.2 Interface Between MTD Core and Low-Level
Flash Drivers.............................................................. 96
4.4 Sample MTD Driver for NOR Flash...................................... 97
4.5 The Flash-Mapping Drivers ................................................. 106
4.5.1 Filling up mtd_info for NOR Flash Chip............ 106
4.5.2 Filling up mtd_info for NAND Flash Chip ......... 108
4.5.3 Registering mtd_info.............................................. 109
4.5.4 Sample Mapping Driver for NOR Flash ................ 111
4.6 MTD Block and Character Devices..................................... 114
4.7 Mtdutils Package................................................................... 116
4.8 Embedded File Systems ....................................................... 116
4.8.1 Ramdisk.................................................................... 117
4.8.2 RAMFS ...................................................................... 117
4.8.3 CRAMFS (Compressed RAM File System) ............. 117
4.8.4 Journaling Flash File Systems — JFFS and
JFFS2......................................................................... 117
4.8.5 NFS — Network File System.................................. 119
4.8.6 PROC File System.................................................... 119
4.9 Optimizing Storage Space.................................................... 120
4.9.1 Kernel Space Optimization..................................... 120
4.9.2 Application Space Optimization............................. 121
4.9.3 Applications for Embedded Linux ......................... 122
4.10 Tuning Kernel Memory........................................................ 124
xii Embedded Linux System Design and Development
5 Embedded Drivers ............................................................................... 127
5.1 Linux Serial Driver................................................................ 128
5.1.1 Driver Initialization and Start-Up ........................... 130
5.1.2 Data Transmission ................................................... 134
5.1.3 Data Reception ........................................................ 134
5.1.4 Interrupt Handler..................................................... 134
5.1.5 Terminos Settings .................................................... 138
5.2 Ethernet Driver ..................................................................... 138
5.2.1 Device Initialization and Clean-Up........................ 140
5.2.2 Data Transmission and Reception ......................... 142
5.3 I2C Subsystem on Linux...................................................... 144
5.3.1 I2C Bus..................................................................... 145
5.3.2 I2C Software Architecture....................................... 147
5.4 USB Gadgets......................................................................... 152
5.4.1 USB Basics ............................................................... 153
5.4.2 Ethernet Gadget Driver........................................... 158
5.5 Watchdog Timer ................................................................... 161
5.6 Kernel Modules..................................................................... 162
5.6.1 Module APIs ............................................................ 162
5.6.2 Module Loading and Unloading ............................ 164
Notes ............................................................................................... 164
6 Porting Applications ............................................................................ 165
6.1 Architectural Comparison..................................................... 165
6.2 Application Porting Roadmap.............................................. 166
6.2.1 Decide Porting Strategy .......................................... 167
6.2.2 Write an Operating System Porting Layer
(OSPL) ...................................................................... 169
6.2.3 Write a Kernel API Driver ...................................... 170
6.3 Programming with Pthreads ................................................ 171
6.3.1 Thread Creation and Exit ....................................... 172
6.3.2 Thread Synchronization .......................................... 174
6.3.3 Thread Cancellation ................................................ 180
6.3.4 Detached Threads ................................................... 181
6.4 Operating System Porting Layer (OSPL)............................. 182
6.4.1 RTOS Mutex APIs Emulation.................................. 182
6.4.2 RTOS Task APIs Emulation .................................... 185
6.4.3 IPC and Timer APIs Emulation.............................. 191
6.5 Kernel API Driver................................................................. 191
6.5.1 Writing User-Space Stubs........................................ 194
6.5.2 Kapi Driver Implementation................................... 195
6.5.3 Using the Kapi Driver............................................. 199
Note................................................................................................. 200
Contents xiii
7 Real-Time Linux ................................................................................... 201
7.1 Real-Time Operating System ............................................... 202
7.2 Linux and Real-Time............................................................ 202
7.2.1 Interrupt Latency ..................................................... 203
7.2.2 ISR Duration ............................................................ 204
7.2.3 Scheduler Latency.................................................... 205
7.2.4 Scheduler Duration.................................................. 207
7.2.5 User-Space Real-Time ............................................. 209
7.3 Real-Time Programming in Linux ....................................... 209
7.3.1 Process Scheduling.................................................. 210
7.3.2 Memory Locking...................................................... 213
7.3.3 POSIX Shared Memory ........................................... 223
7.3.4 POSIX Message Queues.......................................... 225
7.3.5 POSIX Semaphores.................................................. 232
7.3.6 Real-Time Signals .................................................... 233
7.3.7 POSIX.1b Clock and Timers................................... 241
7.3.8 Asynchronous I/O................................................... 246
7.4 Hard Real-Time Linux.......................................................... 252
7.4.1 Real-Time Application Interface (RTAI)................. 253
7.4.2 ADEOS...................................................................... 258
8 Building and Debugging ...................................................................... 261
8.1 Building the Kernel.............................................................. 263
8.1.1 Understanding Build Procedure............................. 265
8.1.2 The Configuration Process...................................... 266
8.1.3 Kernel Makefile Framework................................... 268
8.2 Building Applications........................................................... 270
8.2.1 Cross-Compiling Using Configure.......................... 273
8.2.2 Troubleshooting Configure Script .......................... 274
8.3 Building the Root File System............................................. 275
8.4 Integrated Development Environment................................ 278
8.4.1 Eclipse ...................................................................... 279
8.4.2 KDevelop ................................................................. 279
8.4.3 TimeStorm................................................................ 279
8.4.4 CodeWarrior............................................................. 280
8.5 Debugging Virtual Memory Problems ................................ 280
8.5.1 Debugging Memory Leaks...................................... 282
8.5.2 Debugging Memory Overflows.............................. 286
8.5.3 Debugging Memory Corruption............................. 287
8.6 Kernel Debuggers................................................................. 291
8.7 Profiling................................................................................. 293
8.7.1 eProf—An Embedded Profiler................................ 294
8.7.2 OProfile .................................................................... 300
xiv Embedded Linux System Design and Development
8.7.3 Kernel Function Instrumentation ........................... 302
Notes ............................................................................................... 308
9 Embedded Graphics ............................................................................. 309
9.1 Graphics System ................................................................... 309
9.2 Linux Desktop Graphics—The X Graphics System........... 311
9.2.1 Embedded Systems and X...................................... 312
9.3 Introduction to Display Hardware ...................................... 313
9.3.1 Display System ........................................................ 313
9.3.2 Input Interface......................................................... 316
9.4 Embedded Linux Graphics .................................................. 316
9.5 Embedded Linux Graphics Driver ...................................... 316
9.5.1 Linux Frame Buffer Interface ................................. 317
9.5.2 Frame Buffer Internals............................................ 326
9.6 Windowing Environments, Toolkits, and Applications ..... 328
9.6.1 Nano-X ..................................................................... 335
9.7 Conclusion............................................................................. 340
Notes ............................................................................................... 340
10 uClinux ................................................................................................. 341
10.1 Linux on MMU-Less Systems............................................... 341
10.1.1 Linux Versus uClinux .............................................. 342
10.2 Program Load and Execution.............................................. 343
10.2.1 Fully Relocatable Binaries (FRB)............................ 345
10.2.2 Position Independent Code (PIC).......................... 345
10.2.3 bFLT File Format..................................................... 346
10.2.4 Loading a bFLT File ................................................ 347
10.3 Memory Management........................................................... 358
10.3.1 Heap......................................................................... 358
10.3.2 Stack ......................................................................... 363
10.4 File / Memory Mapping—The Intricacies of mmap( )
in uClinux ............................................................................. 364
10.5 Process Creation ................................................................... 365
10.6 Shared Libraries .................................................................... 367
10.6.1 uClinux Shared Library Implementation
(libN.so).................................................................... 367
10.7 Porting Applications to uClinux.......................................... 370
10.7.1 Creating uClinux Programs..................................... 370
10.7.2 Creating Shared Libraries in uClinux..................... 371
10.7.3 Using Shared Library in an Application................ 373
10.7.4 Memory Limitations................................................. 375
10.7.5 mmap Limitations.................................................... 375
10.7.6 Process-Level Limitations ........................................ 375
Contents xv
10.8 XIP—eXecute In Place......................................................... 375
10.8.1 Hardware Requirements ......................................... 377
10.8.2 Software Requirements ........................................... 378
10.9 Building uClinux Distribution.............................................. 378
Notes ............................................................................................... 380
Appendices
A Booting Faster ...................................................................................... 383
Techniques for Cutting Down Bootloader Initialization............. 384
Tuning Kernel for Decreased Boot-Up Time .............................. 385
Tuning User Space for Decreased Boot-Up Time ...................... 385
Measuring Boot-Up Time .............................................................. 386
B GPL and Embedded Linux ................................................................... 387
User-Space Applications ................................................................ 387
Kernel.............................................................................................. 388
Points to Remember ...................................................................... 389
Notes ............................................................................................... 390
Index ............................................................................................................ 391
Complete Download Embedded Linux system design and development 1st Edition P. Raghavan PDF All Chapters
xvii
Foreword
The industrial revolution appears as a knife-edge change from a rural self-
employed lifestyle to a clock-punching, whistle-blowing corporate urban way
of life. Being in the middle of the current revolution makes it hard to realize
that in fifty years most people will consider the messy, dynamic, no-rules
embedded product development environment of today as an obvious clean
transition caused by technological changes.
The first embedded software project I worked on didn’t use an off-the-
shelf operating system—there was none. It wasn’t until several years later that
WindRiver introduced VxWorks®. In the mid-1990s it appeared that nothing
could unseat VxWorks; yet, recently WindRiver announced a Linux-based
product. Why the change? Today the most common embedded operating
system used in new products is Linux.
For fourteen years I was part of a small army of firmware engineers working
on the development of HP LaserJet™ printers. The printer used a homegrown
operating system that as I recall was called LaserJet O.S. Usually the very best
engineers worked on supporting and extending the operating system. Any
LaserJet O.S. documentation that existed, engineers had created. Any test suite
was similarly a burden placed on the engineer’s shoulders. The effort and
expense of these highly talented engineers seldom led to any features that
differentiated the product from the competitors. The most important lesson I
learned from the experience was to always put your most talented engineers
on the features that make your product unique and outsource the infrastruc-
ture. Embedded Linux is often the best choice for the operating system
infrastructure for products needing nontrivial connectivity.
Whether you support Linux in-house or purchase a Linux board support
package for your processor, you will still need to understand the overall system
and at times the details of a particular subsystem. In this book the authors
have done a good job fitting all the pieces together that are necessary for
embedded Linux development. The book discusses topics such as board
support packages, embedded storage, and real-time Linux programming in
xviii Embedded Linux System Design and Development
depth. Embedded graphics and uClinux are also explained with clarity. The
book is a good attempt to address the concerns of an embedded Linux
developer.
The rapid growth of Linux as the top choice for an embedded operating
system in new products is in part due to the ease of using embedded Linux
to replace homegrown operating systems. Although this book is specifically
for running Linux on embedded systems it can also be used as a guide to
port a system from a traditional RTOS or homegrown operating system to
embedded Linux. It may be the need for TCP/IP networking, USB support,
SecureDigital support, or some other standard that causes a company to dump
their current operating system and switch to Linux. But it is the joy of
developing with Linux that keeps the engineers promoting it for future
products.
An astounding amount of Linux information is available on the Web. I
suspect it is the most extensively documented software ever. How can a book
about embedded Linux provide value over what is already available? First, the
scope of embedded Linux and related applications is so large that getting a
feel for what is available and what can be done is challenging. Seeing all the
pieces separately and working together can help you make sense of the
embedded Linux ecosystem. Second, there are technical reasons for needing
the right information. In an embedded device, the bootloader, kernel, and file
system containing the applications all need to be developed in concert for
the solution to work properly. Understanding the interdependencies and
getting the development environment to properly build all three images is not
straightforward. Also, when you encounter a problem, understanding the tools
available to debug the problem and knowing the techniques used for debug-
ging embedded devices can save a significant amount of time and effort.
Finally, the best reason for reading this book on embedded Linux is because
the technology is so fascinating. Anyone who had developed embedded
products the old way, with one single executable image, will be amazed at
the flexibility and power of using embedded Linux. Anyone new to embedded
development will find most of the power and flexibility available on their
desktop PC works the same in their embedded development environment.
Todd Fischer
President and Founder
Cadenux
xix
Preface
When we were in college in the mid-1990s we heard of an exciting new
technology called the Internet that was to have a profound impact on our
lives. Along with the Internet we also heard of an open source operating
system, Linux, which was being developed by hundreds of programmers
around the world. Linux gave us an opportunity to understand the internals
of the operating system and we quickly became Linux enthusiasts. We realized
that Linux was more than an operating system; here was a movement with
few parallels in human history as it was based on the concepts of human
dignity, choice, and freedom. Linux gave young programmers like us the reach
to the latest technology.
When we became embedded professionals Linux had yet to make a strong
presence in the embedded market. However, we were hearing of some exciting
improvements such as running a hard real-time kernel along with the Linux
kernel and running Linux on MMU-less microcontrollers. Our happiness grew
unbounded when we were asked by a customer to move our software on a
MIPS-based SoC from a commercial RTOS to embedded Linux. Our experience
revealed that the road to embedded Linux is not a very smooth ride. Some
of the main reasons were:
1. There is undoubtedly lots of information about embedded Linux on the
Internet but it is too scattered to give a consolidated view. Converting this
information into a knowledge base can be a time-consuming task. Most
of the product-based companies are normally short on time. Decisions
need to be made quickly and executed quickly. However, a wrong decision
especially on crucial issues such as licensing can prove disastrous to the
company.
2. There is a gross misconception that embedded systems are all about the
hardware or the operating system. As computing power increases rapidly
as per Moore’s law the amount of application software that goes into the
embedded system has also increased at the same rate. Hence the appli-
cations have become the USP for the embedded system. So building a
xx Embedded Linux System Design and Development
Linux-based embedded system does not stop with the OS but has to do
a lot with writing and building applications. And applications have their
own set of issues that are different from the operating system such as
licensing, toolchains, and so on.
3. Unlike a commercial RTOS, which gives a single point of support such as
patches and documentation, embedded Linux takes a whole new devel-
opment paradigm. Often the developers need to search for patches or for
new information from the various mailing lists. And this can be very time
consuming.
When we came out successfully with an embedded Linux design with a
variety of applications, we decided to share some of our thoughts and
experiences with the rest of the world. The result of that thought process is
this book. This book contains an entire development roadmap for embedded
Linux systems. Our primary aim is to make the reader aware of the various
issues that arise out of embedded Linux development.
The theme of the book is twofold:
 To facilitate movement to embedded Linux from a traditional RTOS
 To explain the system design model with embedded Linux
Benefits to the Reader
The book offers solutions to problems that a developer faces when program-
ming in an embedded Linux environment. Some of the common problems are:
 Understand the embedded Linux development model.
 Write, debug, and profile applications and drivers in embedded Linux.
 Understand embedded Linux BSP architecture.
The book offers practical solutions to the above problems.
After reading this book the reader will
 Understand the embedded Linux development environment.
 Understand and create Linux BSP for a hardware platform.
 Understand the Linux model for embedded storage and write drivers and
applications for the same.
 Understand various embedded Linux drivers such as serial, I2C, and so on.
 Port applications to embedded Linux from a traditional RTOS.
 Write real-time applications in embedded Linux.
 Learn methods to find memory leaks and memory corruption in applica-
tions and drivers.
 Learn methods to profile applications and the kernel.
 Understand uCLinux architecture and its programming model.
 Understand the embedded Linux graphics subsystem.
Preface xxi
The book is also an aid to managers in choosing an embedded Linux
distribution, creating a roadmap for the transition to embedded Linux, and
applying the Linux licensing model in a commercial product.
Audience
Primary Audience
 Architects: They are more concerned with real-time issues, performance,
and porting plans.
 Software programmers: They need to get into the minute details of the
technology.
Secondary Audience
 Legal staff: Because most embedded products involve intellectual property,
any wrong understanding of the licensing issues can prove detrimental to
the company itself.
 Managers: They are normally concerned about choosing the distribution,
version, toolset, and vendor.
 Testing and support team: Because the look and feel of the product can
change when moving to embedded Linux, the test and support team needs
to be educated.
Background
The authors expect a basic understanding of embedded system programming
in any embedded OS from the reader. The book is not a Linux kernel book.
Familiarity with basic Linux kernel concepts and the user-space programming
model is desirable.
The book attempts to be independent of the kernel version; however,
wherever necessary the 2.4 or the 2.6 kernels are used as examples.
Downloading Source Code
Readers can download source code from the following URL: http://www.
crcpress.com/e_products/downloads/download.asp?cat_no=AU0586
Complete Download Embedded Linux system design and development 1st Edition P. Raghavan PDF All Chapters
xxiii
Acknowledgments
I thank the management of my present employer, Philips, for giving me the
support to go ahead with the book. Any work of mine has always been
incomplete without the blessings of my dear mother. And last but not least I
would like to thank my wife, Bhargavi, for spending some cold days alone
when I was busy penning down the pages for this book.
Raghavan
I would like to thank all the people who made this work possible. First my
mother, who used to tell me to work for the book whenever she saw me
roaming here and there, like any mother telling her kid to study. I also express
thanks to my father who kept on asking me about the status of the manuscript,
like a project manager. I thank my wife, Parul, for her patience during
manuscript preparation. I remember when Raghav told me about this project
and asked me to join. It was just two months after my marriage. I thank Parul
for her encouragement and also thank her for helping me out in formatting
the manuscript.
Amol
Thanks to Raghav who had the idea of writing this book. I still remember
the first meeting when he instilled the confidence in me to take up this work.
I thank my dad, mom, and sister for their support. Thanks to the entire “boys”
gang at Bangalore who have been kind enough to share the powerful
“Athlon/Audigy/ATI Radeon 9500” game PC for mean activities such as running
Linux and typing sample code. They consider running a word processor on
such a PC as a gross waste of computing power.
Sriram
We take this opportunity to thank Todd Fischer, president and founder,
Cadenux, for giving us time from his busy schedule to write the foreword for
the book. We thank David McCullogh, one of the uClinux core maintainers,
xxiv Embedded Linux System Design and Development
and Dr. Paul Dale for reviewing the chapter on uClinux and for providing
their valuable comments. We also thank Greg Haerr, CEO of Century Software
and founder of the Nano-X windowing system, for his valuable review com-
ments on the embedded graphics chapter. We thank Satish MM, director of
Verismo Networks, for his valuable comments on GPL. We thank our close
friend and guide, Deepak Shenoy, for coming up with the idea to write a
book based on our development experience. Finally we thank all Linux kernel
developers and user-space programmers for taking Linux to new heights.
xxv
Introduction
The text is divided into ten chapters and two appendices.
Chapter 1, “Introduction,” gives a brief history of embedded Linux and
what the benefits of embedded Linux are over other RTOSs. It discusses in
detail the features of various open source and commercial embedded Linux
distributions available. The chapter concludes by presenting a transition road-
map from a traditional RTOS to embedded Linux.
Chapter 2, “Getting Started,” explains the architecture of embedded Linux
and compares it with traditional RTOS and microkernel architectures. In brief
various Linux kernel subsystems such as the hardware abstraction layer,
memory management, scheduler, file system, and so on are given. A small
description of the user-space Linux programming model is also given. The
second half of the chapter explains the Linux start-up sequence, from boot-
loaders to kernel start-up and user-space start-up scripts. The last section
explains the steps involved in building a GNU cross-platform toolchain.
Chapter 3, “Board Support Package,” explains bootloader architecture fol-
lowed by a discussion on the system memory map, both hardware and
software memory maps. The second half of the chapter explains interrupt
management, the PCI subsystem, timers, UART, and power management in
detail.
Chapter 4, “Embedded Storage,” explains the MTD subsystem architecture
for accessing flash devices. The second half of the chapter discusses various
embedded file systems such as RAMFS, CRAMFS, JFFS2, NFS, and so on. The
chapter also discusses various methods for optimizing storage space in an
embedded system, both kernel and user-space optimizations. A discussion of
various applications designed for embedded Linux such as Busybox is given.
Finally some steps for tuning the kernel memory are given.
Chapter 5, “Embedded Drivers,” discusses in detail various embedded
drivers such as the Serial driver, Ethernet driver, I2C subsystem, and USB
gadgets.
xxvi Embedded Linux System Design and Development
Chapter 6, “Porting Applications,” discusses an application porting roadmap
from a traditional RTOS to embedded Linux. The rest of the chapter explains
the porting roadmap in detail. First a discussion on Linux pthreads is given,
then the Operating System Porting Layer (OSPL), and finally a kernel API driver.
Chapter 7, “Real-Time Linux,” discusses the real-time features in Linux. It
explains the various latencies involved in the kernel such as interrupt and
scheduling latency and efforts that are made to improve the kernel response
time such as kernel preemption and O(1) scheduler. The core of the chapter
is the discussion of POSIX.1b programming interfaces in Linux. The chapter
explains various POSIX.1b real-time extensions such as real-time schedulers,
memory locking, message queues, semaphores, and asynchronous I/O in
detail. The last section explains in brief the hard real-time approach to Linux
followed by a real-time programming model in RTAI.
Chapter 8, “Building and Debugging,” is divided into three sections: build-
ing, debugging, and profiling. The first section explains various mechanisms
for building kernel and user-space applications. In the second section tools
such as mtrace, dmalloc, and valgrind to debug memory problems are
explained. Finally the last section discusses eProf, OProfile, and kernel function
instrumentation profiling methods to profile user-space and kernel functions.
Chapter 9, “Embedded Graphics,” explains in detail a generic frame buffer
driver and how to write applications using the frame buffer interface. It also
discusses in brief the X graphics subsystem and why it is not suitable for
embedded devices. The last section explains the Nano-X windowing envi-
ronment.
Chapter 10, “uClinux,” explains the architecture and programming environ-
ment in uClinux. The first half of the chapter explains the bFLT executable
file format and how programs are loaded and executed in uClinux-based
systems. Next a discussion about memory management, process creation, and
shared libraries in uClinux is given. The final section explains XIP and how
to port applications from standard Linux to uClinux. It also explains how to
build applications for uClinux.
Appendix A, “Booting Faster,” explains various techniques to reduce Linux
boot-up time.
Appendix B, “GPL and Embedded Linux,” discusses what GPL means to
embedded Linux and how proprietary software can be kept safe with embed-
ded Linux.
Source code is available for downloading from http://www.crcpress.com/e_
products/downloads/download.asp?cat_no=AU0586
xxvii
About the Authors
P. Raghavan has nine years of experience in embedded software develop-
ment. He has worked on a variety of embedded products ranging from graphics
displays and televisions to network equipment. Other than embedded Linux
he has worked on a variety of commercial operating systems such as VxWorks
and Nucleus. He understands the various issues related to the software
development life cycle for embedded systems. He holds an electronics engi-
neering degree from Bangalore University, India. Presently he is employed
with Philips Software, Bangalore.
Amol Lad is a computer science graduate from Motilal Nehru National Institute
of Technology, Allahabad, India, one of the prestigious engineering colleges
in the country. He first peeked into the Linux kernel sources in 1996 during
his second year of engineering. It was his curiosity to understand how things
work “under the hood” that attracted him to Linux. He started his career in
1999 as a device driver writer for satellite communication systems. His first
exposure to embedded Linux was in the year 2001 when he wrote a BSP for
a MIPS-based custom hardware platform. Presently he is employed by Verismo
Networks as a Linux kernel engineer. He is responsible for designing systems
based on embedded Linux for his company. If not busy reading kernel sources
you can find him playing (or watching) cricket. He is also devoted to music.
If he had not been a computer engineer he surely would have been a music
composer.
Sriram Neelakandan graduated with an electronics engineering degree and
started his career as a Windows device driver programmer. He likes problems
that require a soldering iron and an oscilloscope to solve rather than just the
keyboard. He has worked on device drivers for various technologies including
ISA, PCI, USB, PCMCIA, and CF+ across platforms such as Windows, VxWorks,
and Linux. His embedded Linux experience started with porting a MIPS-based
System-on-Chip (SoC) networking product. Working on the product gave him
xxviii Embedded Linux System Design and Development
the opportunity to understand various modules of Linux including the routing
subsystem (fib, netlink), MTD drivers, and flash file systems (CRAMFS, JFFS2).
Currently employed at Verismo Networks, India, he is part of the embedded
Linux team responsible for media solutions.
1
Chapter 1
Introduction
An embedded system is a special-purpose computer system that is designed
to perform very small sets of designated activities. Embedded systems date
back as early as the late 1960s where they used to control electromechanical
telephone switches. The first recognizable embedded system was the Apollo
guidance computer developed by Charles Draper and his team. Later they
found their way into the military, medical sciences, and the aerospace and
automobile industries. Today they are widely used to serve various purposes;
some examples are the following.
 Network equipment such as firewall, router, switch, and so on
 Consumer equipment such as MP3 players, cell phones, PDAs, digital
cameras, camcorders, home entertainment systems, and so on
 Household appliances such as microwaves, washing machines, televisions,
and so on
 Mission-critical systems such as satellites and flight control
Following are the key factors that differentiate an embedded system from
a desktop computer.
 Embedded systems are usually cost sensitive.
 Most embedded systems have real-time constraints.
 There are multitudes of CPU architectures (such as ARM®, MIPS®, Pow-
erPC™, etc.) that are used in embedded systems. Embedded systems
employ application-specific processors. For example, the processor in your
digital camera is specially tailored for image capturing and rendering.
 Embedded systems have (and require) very few resources in terms of RAM,
ROM, or other I/O devices as compared to a desktop computer.
 Power management is an important aspect in most embedded systems.
2 Embedded Linux System Design and Development
 The development and debugging environment in an embedded system is
very different from a desktop computer. Embedded systems generally have
an inbuilt circuitry for debugging purposes.
 An embedded system is designed from both the hardware and software
perspective, taking into account a specific application or set of applications.
For example, your MP3 player may have a separate hardware MP3 decoder
built inside it.
In the early days effectively no operating system was used in embedded
systems. There was in-house development of all the software that directly
drives the hardware with almost no or very minimal multitasking and user
interaction in place. But with the passage of time, more complex embedded
systems started emerging and along with that a growing list of features that
an embedded system should support. All of these requirements mandated use
of an operating system in embedded systems that should at least provide
multitasking/multithreading, process and memory management, interprocess
communication, timers, and so on. So the companies started enhancing their
in-house developed software so that they could have a minimal but a full-
featured operating system running on their embedded platform. Various firms
started efforts to provide an operating system aimed at embedded systems.
Today we have a multitude of embedded operating systems. Apart from
company in-house developed operating systems we have Wind River’s VxWorks®,
Microsoft® Windows® CE, QNX® Neutrino®, Accelerated Technology®’s
Nucleus™, Red Hat®’s eCos™, Sun Microsystems ChorusOS™, LynuxWorks™’s
LynxOS®, and embedded Linux as primary embedded operating systems.
1.1 History of Embedded Linux
Linus Benedict Torvalds at the University of Helsinki created the Linux®
operating system in 1991. It was his mail in a minix development mailing list
as shown in Listing 1.1 that is said to have started the Linux revolution.
Since then Linux has never looked back. Its open source development
model and GNU General Public License (GPL), under which Linux is released,
attracted contributions from thousands of developers worldwide. This license
allowed all the Linux kernel source code to be freely available for personal
or commercial use. As the Linux kernel source code is freely available, it
encouraged many developers to contribute to the Linux kernel. It is because
of this global pool of developers that we have a highly reliable, robust, and
powerful operating system. In early 1996 Linux saw its arrival in hard real-time
embedded systems as a research project of Michael Barabanov and Victor
Yodaiken. This RT-Linux research project was based on using a small real-time
kernel along with Linux to provide hard real-time deadline guarantees. In 1997
the uClinux® project was started with the aim of using Linux in no-MMU
processors. It was released for use in the year 1998. During the years 1999 to
2004 Linux was widely used in embedded systems. The following sections
mention some of the major developments in embedded Linux during this period.
Introduction 3
1.1.1 Year 1999
Linux started to develop its roots in the embedded systems area in the year
1999. Some of the major developments in this year were:
 At the Embedded Systems Conference (ESC) of September 1999 companies
including Lineo, FSM Labs, MontaVista®, and Zentropix made announce-
ments about embedded Linux support.
 Zentropix founded RealTimeLinux.org to discuss possibilities of real-time
Linux solutions.
 Lineo announced an Embedded Advisory Board (EMLAB) for discussing
the possibilities of using Linux in embedded areas.
 Rick Lehrbaum started an embedded Linux portal: Linuxdevices.com.
 RTAI was released by Paolo Mantegazza to add hard real-time support in
Linux.
 BlueCat® Linux was announced by Lynx real-time systems (now Lynux-
Works). It was the first commercial embedded Linux distribution.
Listing 1.1 The Origin of Linux
From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds)
Newsgroups: comp.os.minix
Subject: What would you like to see most in minix?
Summary: small poll for my new operating system
Message-ID: 1991Aug25.205708.9541@klaava.Helsinki.FI
Date: 25 Aug 91 20:57:08 GMT
Organization: University of Helsinki
Hello everybody out there using minix –
I’m doing a (free) operating system (just a hobby, won’t be big
and Professional like gnu) for 386(486) AT clones. This has been
brewing since april, and is starting to get ready. I’d like any
feedback on things people like/dislike in minix, as my OS resembles
it somewhat(same physical layout of the file-system (due to
practical reasons)among other things).
I’ve currently ported bash(1.08) and gcc(1.40), and things seem to
work. This implies that I’ll get something practical within a few
months, and I’d like to know what features most people would want.
Any suggestions are welcome, but I won’t promise I’ll implement
them :-)
Linus (torvalds@kruuna.helsinki.fi)
PS. Yes - it’s free of any minix code, and it has a multi threaded
fs. It is NOT portable (uses 386 task switching etc), and it
probably never will support anything other than AT-harddisks, as
that’s all I have :-(.
4 Embedded Linux System Design and Development
1.1.2 Year 2000
In the year 2000 many companies adopted embedded Linux in their product
lines.
 Samsung® launched Yopy, a PDA with Linux inside.
 Ericsson® launched HS210, a Linux-based cordless screen phone that
combines wireless connectivity with Internet access, telephony, and e-mail
functions.
 Atmel® announced a Linux-based single-chip Internet appliance, the
AT75C310, that includes support for VoIP and audio.
 Agenda Computing demonstrated a Linux-based PDA at Linuxworld.
This year also saw increased awareness about real-time support in Linux.
 TimeSys® Corporation announced Linux/RT™, an embedded Linux distri-
bution aiming to provide predictable application response times by using
resource reservation technology.
 MontaVista Software started a Linux Real-Time Characterization Project to
provide developers with a set of open source tools for measuring real-
time responsiveness of Linux systems.
 Red Hat released EL/IX version 1.1 specifications for adding real-time
support in Linux.
In this year many tools and utilities were released for use in embedded Linux.
 Busybox 0.43 was released. It was the first and most stable Busybox release.
 GoAhead® Software announced the GoAhead Web server for embedded
Linux applications.
 Trolltech® launched Qt™/Embedded, a GUI application framework and
windowing system for embedded Linux.
 ViewML® embedded browser was announced by Greg Haerr. ViewML is
based on the Microwindows windowing system.
In this year the Embedded Linux Consortium (ELC) was founded by Rick
Lehrbaum with major corporations such as Intel® and IBM® as its members.
The aim of this consortium was to facilitate the use of Linux and open source
software in embedded areas. ELC promoted Linux as an effective, secure, and
reliable operating system for embedded systems.
OSDL (Open Source Development Lab) was also founded in this year by
HP®, Intel, IBM, and NEC® with the goal of supporting enterprise Linux
solutions.
1.1.3 Year 2001
The biggest announcement of the year 2001 was the release of Linux kernel
2.4, which was later adopted in many embedded Linux distributions. In this
year Linux was also widely used in handheld devices and gadgets.
Introduction 5
 Sharp® Electronics introduced Linux-based PDAs.
 Trolltech and Lisa systems announced a wireless iPAQ solution for the
Compaq iPAQ palmtop computer.
 NeoMagic® also announced a Linux-based SOC platform for smart handheld
devices.
 Transmeta™ Corporation released “Midori” Linux, an open source distri-
bution targeting small devices.
Embedded Linux standardization efforts were also gaining pace in the year
2001.
 Japan Embedded Linux Consortium (EMBLIX) was founded by major
corporations including Toshiba® and NEC with the aim of promoting,
educating, and standardizing embedded Linux in Japan.
 TV Linux Alliance was formed to define a set of standards for using Linux
in set-top boxes. Broadcom®, Motorola, and Sun Microsystems were some
of its cofounders.
 The Free Standards Group (FSG) released Linux Standard Base (LSB)
specification version 1.0. The goal of LSB was to develop a set of standards
to increase compatibility among Linux distributions so that applications
can run on any compliant Linux system. LSB is widely recognized by the
enterprise Linux industry and is also considered useful for embedded Linux.
In terms of tools and utilities the following also occurred.
 First major release of uClibc, uClibc 0.9.8, was made. uClibc now is an
integral part of almost all embedded Linux distributions.
 Eclipse™ consortium was formed by major corporations including IBM,
SuSE®, Red Hat, QNX Software Systems, Borland®, and Merant® to provide
a development environment framework for embedded systems. Today
companies such as TimeSys, LynuxWorks, MontaVista, and others are using
the Eclipse framework to provide IDEs for embedded Linux development.
1.1.4 Year 2002
The year 2002 saw a major advancement of Linux in embedded markets with
more and more companies adopting Linux in their product designs. Real-time
support in Linux was also getting better.
 Kernel preemption patch from Robert Love, low latency patches by Andrew
Morton, and the O(1) scheduler by Ingo Molnar found their ways into the
Linux kernel.
 RTLinux® added hard real-time capability to user space.
 The ADEOS project announced the first release of ADEOS, a hardware
abstraction layer allowing a real-time kernel and a general-purpose OS to
co-exist.
In terms of standardization efforts, the following occurred.
6 Embedded Linux System Design and Development
 ELC released the Embedded Linux Consortium Platform Specification
(ELCPS). The ELCPS provided a standard for the API layer that increases
reusability and portability of program code. The standard helps developers
by decreasing time and cost to develop embedded applications in Linux.
 OSDL announced the Carrier Grade Linux (CGL) working group to promote
and standardize the use of Linux in carrier grade systems. CGL released
v1.x CGL requirements specifications in the same year.
 Free Standards Group announced the LSB 1.1 and LSB certification pro-
gram. The aim of the LSB certification program was to employ an inde-
pendent authority to verify that a Linux distribution or application adheres
to LSB.
In this year Linux saw more inroads in the digital entertainment industry.
Intel announced a reference design for a home digital media adapter. Trace
Strategies Inc. published a research report projecting Linux as a preferred OS
in devices such as digital interactive TV (ITV), set-top boxes, and so on.
In this year uClinux also gained shared library support from SnapGear® and
Ridgerun. It later found its way into mainstream Linux kernel version 2.5.46.
1.1.5 Year 2003
In the year 2003 Linux saw its growth in the cell phone and SOHO markets.
 Motorola announced its A760 mobile phone handset that uses Linux as its
embedded OS.
 Linux saw more penetration in gateway, routers, and wireless LANs for
SOHO and consumer markets.
In this year more stress was put on standardization.
 ELC added an extension to ELCPS to add support for power management,
user interface, and real-time standards.
 OSDL announced CGL v2.0 with major advances in security, high avail-
ability, and clustering.
 The Consumer Electronics Linux Forum (CELF) was formed in June 2003
to provide specifications for using Linux in CE devices and to maintain a
Linux kernel source tree that has enhancements specifically for CE devices.
CELF invites companies to contribute to the tree so that Linux can become
a de facto operating system for CE devices. Matsushita™, Sony, Hitachi,
NEC, Royal Philips® Electronics, Samsung, Sharp Corporation, and Toshiba
Corporation were the founders of CELF.
The year 2003 ended with the release of the Linux 2.6.0 kernel.
1.1.6 Year 2004
Some of the highlights of the year 2004 were as follows.
Introduction 7
 In this year LynuxWorks released the 2.6 Linux kernel-based BlueCat Linux
distribution. It was the first commercial embedded Linux distribution based
on the 2.6 Linux kernel.
 Sony Corporation introduced Linux-based devices for in-car navigation and
infotainment systems in Japan. The devices feature 3-D map navigation
technology, media players, hard drives, GPS, and PC connectivity.
 Trolltech announced a mobile phone application stack that delivers PDA-
like features on smartphones.
 OSDL’s CGL specifications saw wide acceptance in the telecommunications
industry.
 CELF released its first specification for using Linux in CE devices. The
specification is also supported by a reference implementation in the form
of a patched Linux kernel source tree supporting nine target boards.
 Free Standards Group (FSG) and OSDL released LSB 2.0.
Today lots of companies are adopting embedded Linux for their new
designs. More and more vendors are providing embedded Linux distribution
for various hardware platforms. Today embedded Linux is a preferred oper-
ating system for embedded systems. Silicon suppliers such as AMD®, ARM,
TI, Motorola™, IBM, Intel, and so on all use Linux as a preferred hardware
bring-up platform. CE devices OEMs such as Sony and NEC are deploying
Linux in DVDs, DVRs, and digital handsets.
1.2 Why Embedded Linux?
Any newcomer to the domain of embedded Linux is bound to be riddled with
a question: “Why choose embedded Linux as an operating system in the
target?” In this section we discuss some benefits of embedded Linux against
proprietary embedded operating systems.
1.2.1 Vendor Independence
Selecting a proprietary OS may lock you up with the same vendor for the
lifetime of your product. Bad support from the vendor can result in increased
time to market of your product. You may end up waiting days or even weeks
for the solution to even small problems. Changing the vendor may mean
restarting the whole product life cycle.
Embedded Linux brings vendor independence. Vendors of all embedded
Linux distributions have more or less the same business model. The distribu-
tions are variations of the same theme. They all have the same and common
basic components such as Linux kernel, libraries, basic utilities, and the like.
If at some point you feel that your embedded Linux distribution vendor is
not living up to your expectations, you can switch vendors at a relatively low
cost. Above all you can also decide to have no embedded OS vendor at all
8 Embedded Linux System Design and Development
for your product, as the source code of the Linux kernel and associated utilities
are freely available.
1.2.2 Time to Market
For embedded Linux, a rich set of toolsets and utilities is available. Most of
the vendors provide preview kits for various hardware platforms that can be
downloaded free of cost. It is highly likely that a Linux port for your hardware
is already available. Consequently you will spend time only in writing appli-
cations without worrying about the Linux port for the hardware or device
driver for a high-performance I/O card that is part of your system. With an
embedded Linux system a product can be rolled out very quickly.
One advantage of using Linux in an embedded platform is reduced devel-
opment time. By using a Linux-based host development environment, most
of the applications that are to be run on the target hardware can be tested
on a Linux host, reducing time to port applications. For example, if your target
needs a DHCP client, you can very well take any open source DHCP client
(meeting the size requirement for target), compile, and test on a Linux host.
If it works on the host then the only effort required is to cross-compile it for
your target. It should run on the target without any problems.
1.2.3 Varied Hardware Support
With the arrival of large numbers of new high-end, low-cost, and much more
sophisticated microprocessors and I/O devices it’s becoming increasingly
difficult for the vendors of proprietary embedded OSs to support them in
time. Even if the product demands high-end hardware, customers may not be
able to use it because their proprietary embedded OS vendor may not support
it.
Linux support for many architectures and high-end I/O devices gives you
the independence to choose appropriate hardware for your system. Linux is
also a preferred OS for any hardware or software innovation. It is widely
accepted in universities as a research and learning tool. Linux is also a preferred
bring-up platform for hardware manufacturers.
1.2.4 Low Cost
Embedded Linux brings minimal cost for development, training, and hiring
needs.
Development Cost
A vendor of proprietary software may charge a huge amount for licenses of
development tools. These are generally per-seat licenses and thus limit the
number of users that can use the development environment. With embedded
Introduction 9
Linux, all the tools and utilities such as compilers, linkers, libraries, shells,
and the like that constitute its development environment can be downloaded
for free. Good IDEs are also available at either very little cost or completely
free of charge. GUI-based configuration environment and profiling tools are
also available.
Training and Hiring Costs
New development environments are expensive. The manufacturing cost of
your product significantly increases when your developers require retraining
or if you decide to hire a specialist who understands the development process,
API usage, optimization techniques, and so on in the particular proprietary
OS. Linux has a UNIX®-based programming model, which is familiar to most
engineers. Thus the learning curve for embedded Linux is very small.
Runtime Royalty
Finally, a runtime royalty of the proprietary embedded OS (or some other
third-party component) adds to product cost. The embedded market is highly
cost sensitive. These days a lot of effort is being paid to reduce the cost of
the product that reaches the end user. Embedded Linux is royalty free. Most
vendors of embedded Linux distribution charge no runtime royalties to their
customers. Lack of runtime royalties reduces the BOM (Bill Of Materials) of
the product.
1.2.5 Open Source
One of the main reasons why Linux became so popular is its open source model
of development. Linux has the following advantages because of open source.
 There are thousands of developers around the world who are contributing
to and enhancing the Linux kernel and other applications.
 You are assured of global support during your development. There are
separate mailing lists for almost all the Linux ports whether ARM, MIPS,
or no-MMU. The mailing list archives might already contain answers to
most of your questions. If not, a proper reply can be expected for a
genuine question posted in these lists.
 It has a rich set of features with superior software and a rich talent pool
across the world reviews every feature that goes in the kernel. This makes
Linux robust and reliable.
 Availability of source code facilitates better understanding of what’s going
under the hood, how to customize it for optimal designs, and how to fix
bugs if they arise. The Linux kernel or some device driver can be tailored
for achieving high performance for your platform.
 Even the tools, applications, and utilities that come with Linux have an
open source nature, thus benefiting from the open source advantage.
10 Embedded Linux System Design and Development
1.2.6 Standards (POSIX®) Compliance
The idea of POSIX is to improve the portability of software written for UNIX,
thus making the job of a UNIX developer much easier. It aims at providing
standards that define common interfaces and features for a UNIX-like operating
system. The Linux kernel provides POSIX-compliant APIs for services such as
memory management, process and thread creation, interprocess communica-
tion, file systems, and TCP/IP.
It’s because of these benefits that the current system software trend for an
embedded system is shifting towards embedded Linux. From lower cost to
rich toolset, these benefits are providing a big thrust for using Linux in
embedded areas.
1.3 Embedded Linux Versus Desktop Linux
Linux is used in a variety of hardware: right from huge SMP servers to the
smallest of gadgets. But it is indeed a marvel that a single code base is used
for the kernel irrespective of its final destination. This was achieved by
implementing a high level of modularity within the kernel and making it easily
configurable to be employed across a variety of hardware. However, some
distributions do provide enhancements as patches to the standard Linux kernel
to “suit” it for embedded systems. But truly speaking one can simply download
a stable Linux kernel source, configure it as per system requirement, cross-
compile, and it should be ready for use. Features such as real-time scheduling
and kernel preemption, which are suited for embedded applications, are now
part of the main kernel source tree.
Following are some of the key differences.
 The way the Linux kernel is configured for embedded systems differs from
its desktop counterpart. The set of device drivers and file systems that is
needed differs in both. For example, an embedded system may need a
flash driver and a flash file system (such as CRAMFS or JFFS2) whereas
they are not needed in a desktop system.
 In embedded Linux more focus is paid to tools that are needed for
development, debugging, and profiling. In embedded Linux focus is paid
to a set of cross-development tools that allow developers to build appli-
cations for their target on say x86-based host systems. On the other hand,
in desktop Linux more focus is paid to a set of packages that are useful
for users such as word processors, e-mail, newsreaders, and so on.
 The utilities that are part of an embedded Linux distribution are different
from similar ones in desktop Linux. Ash, Tinylogin, and Busybox are
considered to be requirements for using with embedded Linux. Even the
application libraries such as uClibc are preferred for embedded applications
as opposed to its Glibc desktop counterpart.1
 Windowing and GUI environments that are used in embedded Linux differ
from the desktop ones. The X window system, which is quite common
Introduction 11
for desktop Linux, is not suited to embedded environments. For embedded
Linux, Microwindows (nanoX) serves a similar purpose.
 Targets deploying embedded Linux mostly run in single-user mode with
almost no system administration capabilities. On the other hand, system
administration plays a very important role in desktop Linux.
1.4 Frequently Asked Questions
In this section we try to answer some of the common questions regarding
embedded Linux.
1.4.1 Is Linux Too Large?
Generally one tends to think that as Linux was designed to run on desktop
systems, it might be bulky and unsuitable for embedded systems. But contrary
to all these speculations, Linux is highly modular and it has an excellent
component selection mechanism. Based on system configuration, one can
keep only the components needed. For example, if no network support is
needed, just disable it at Linux kernel configuration time; no file systems, just
disable them too.
One may also ask about SDRAM and flash requirements of embedded
Linux. A minimal working embedded Linux system with networking and file
system support needs around 4 MB of SDRAM and 2 MB of flash. 16 MB or
32 MB of SDRAM and 4 MB of flash will enable one to add a rich set of
applications to the platform with increased system performance
Some of the small-footprint embedded Linux efforts include the following.
 uClinux, a Linux port for no-MMU platforms such as Motorola 68k, ARM7™,
and so on has a full-featured version with minimum SDRAM and FLASH
requirement.
 ELKS (Embedded Linux Kernel Subset) plans to put embedded Linux in
the Palm Pilot.
 ThinLinux is yet another small-footprint distribution targeted at digital
cameras, MP3 players, and similar embedded applications.
1.4.2 Is Linux Real-Time Enough?
As Linux’s roots are in desktop computing, people question its usage in real-
time systems. There is a lot of work going on in the embedded Linux area
to enable it for real-time systems. The enhancements are either in the form
of a preemptive kernel or real-time–capable scheduler. For hard real-time
applications the dual kernel approach is used in which a real-time executive
is responsible for handling time-critical jobs while preserving the Linux advan-
tage. Today Linux is capable of satisfying the real-time needs of systems. We
discuss more about Linux real-time capabilities in Chapter 7.
12 Embedded Linux System Design and Development
1.4.3 How Can I Protect My Proprietary Software?
There is lot of concern regarding GPL licensing and proprietary software. GPL
licensing is seldom a problem for embedded applications. Proprietary software
can always be kept safe with embedded Linux. Please refer to Appendix B
for a complete discussion on GPL and its use in embedded systems.
1.4.4 Should I Buy a Commercial Embedded Linux Distribution?
This is one of the questions that you may come across when you decide to
use embedded Linux for your target. With embedded Linux, it is not at all
mandatory to go for any commercial distribution. You can always download
free sources and then customize them for the target. But there are some
disadvantages of the “on your own” approach. You may need to spend
considerable time and resources to create a Linux port for your target. Even
if a port is already available, lack of good support and enhanced development
tools can delay the development cycle.
The authors recommend using a commercial embedded Linux distribution,
unless your company has sufficient expertise in embedded Linux. There are
lots of very good open source distributions available. They can also be used
if they fit your requirements.
A commercial distribution comes with various advantages. Some of them
are as follows.
 Support: This is one of the biggest advantages of going with a commercial
distribution. Embedded Linux distribution firms generally have a well-
trained staff and expertise in the area of system software. They can assist
you with any part of your project and for a very low cost.
 Development tools and utilities: With commercial distribution comes a rich
development environment. Most distributions have GUI-based installation,
configuration, development, and debugging tools. Some provide special-
ized tools for profiling. Others have very user-friendly tools for download-
ing the image in the target. They all come with a rich set of utilities
compiled for your platform. All this drastically reduces development time.
 Kernel enhancements: The commercial distribution generally provides some
kernel enhancement either as a part of the kernel or as kernel modules. The
enhancements include increased real-time response of the kernel, reduced
kernel memory and flash footprint, drivers and utilities for supporting graph-
ical or networking needs of embedded applications, and so on.
In a nutshell, a commercial embedded Linux distribution reduces effort
and development time, thus reducing time to market of your product. For a
company that is moving to embedded Linux with no prior Linux experience,
these benefits may ease the movement.
1.4.5 Which Embedded Linux Distribution Do I Choose?
There are lots of embedded Linux distributions available. Choosing the right
one is very important for the successful completion of your project. The
following points should be considered before finalizing a distribution.
Introduction 13
 Package: Is the distribution providing all the software necessary for your
project? For example, it may have tons of utilities and drivers, but does it
really have all the drivers that are needed in your target? Does the package
include development, debugging, and profiling tools?
 Documentation: The distribution should provide documentation and sam-
ple programs for all the tools and utilities that are part of the package. It
should accompany a proper reference manual explaining in detail mech-
anisms such as how to build the binaries and load them in the target, how
to profile the system, and so on. If a distribution is accompanied by any
proprietary software then that too should be properly documented.
 Proprietary software: Some distributions ship proprietary software either
in the form of some tools or some device driver in the form of “binary
only” kernel modules. You should be very careful when choosing such a
distribution. You should be totally convinced that such software from the
distribution is really required and there are no other alternatives. Too much
dependence on proprietary software nullifies the vendor independence
aspect of embedded Linux. Also check if there is any runtime royalty
associated with such software.
 Software upgrades: An embedded Linux distribution vendor keeps enhanc-
ing the distribution either by adding more tools and utilities or using a
higher version of the Linux kernel. Make sure whether they are available
for free or there is extra cost involved.
 Flexibility: Is the distribution fitting well in short- or long-term company
goals? Can you reuse the same software for the future version of your
product? Can you use at least the tools provided, if not the kernel for
some other product on similar lines?
 Support: Finally and most important is the support aspect. Do you need to
sign any separate support contract? What is the cost involved? How good
is the support, whether it be for some bug fixing or writing a whole new
device driver? If possible, check with some existing customer of the vendor.
Choosing the right distribution is very important for the successful com-
pletion of your project. A vendor of an embedded Linux distribution should
guide you in all your system software needs. But a word of caution: too much
dependence on a vendor is also not recommended. A company should slowly
build proper expertise in Linux. This will be a long-term benefit for the
organization.
1.5 Embedded Linux Distributions
In this section we discuss various commercial and open source embedded
Linux distributions available today. The idea of this section is to give readers
a brief description of various embedded Linux distributions to facilitate decision
making for their platform.
In this section we cover prominent distributions such as Cadenux®, Embed-
ded Debian®, Denx, ELinOS®, RTLinux, BlueCat, Metrowerks™, MontaVista,
and TimeSys. We compare distributions against the following points.
14 Embedded Linux System Design and Development
 Features: What are the kernel and toolchain features?
 Development environment: How user-friendly is the development environ-
ment?
 Documentation: What documentation is provided with the distribution?
 Support: What is the support policy?
The distributions are discussed in alphabetical order.
1.5.1 BlueCat Linux
BlueCat Embedded Linux 5.0 from LynuxWorks (www.lynuxworks.com) is a
commercial distribution based on the Linux 2.6 kernel. The distribution is
targeted for use in embedded systems ranging from small consumer-type
devices to large-scale, multi-CPU systems.
Features
BlueCat uses Linux kernel version 2.6 thus providing
 Kernel preemption
 Low-latency fixed-time scheduler
 Improved POSIX threading support; new POSIX threads implementation
based on NPTL (New POSIX Thread Library)
 POSIX timers and real-time signals
It also includes
 Enhanced GNU cross-development tools including GCC 3.2.2, GDB mul-
tithreading debugging support, and kernel debuggers
 Target support for XScale™ micro architecture, PowerPC, IA-32, ARM, MIPS,
and x86 PC-compatibles
 Utilities such as Busybox, Tinylogin, uClibc, and so on
 Zebra routing protocol and enhanced network management and security
features
 Embedded target tools for footprint minimization and kernel configuration
Development Environment
LynuxWorks provides a range of development tools for speedy development.
 VisualLynux™: Windows-based IDE. VisualLynux is a plug-in for Microsoft
Visual Studio™ .NET IDE that lets developers build BlueCat Linux appli-
cations in a Windows host environment. The plug-in provides all the
commands and standard GNU tools needed to streamline application
development for BlueCat Linux targets in a Windows environment.
 CodeWarrior™: Linux- and Solaris®-based IDE. Combining an editor, code
browser, compiler, linker, debugger, and intuitive GUI, the CodeWarrior
Introduction 15
IDE speeds up Linux- and Solaris-based development for BlueCat Linux
targets.
Apart from the above IDEs, LynuxWorks provides the following debugging
tools.
 TotalView: Provides advanced debugging across multiple processors,
threads, and processes
 LynxInsure++: For runtime error detection and analysis
 SpyKer™ : To monitor all the events in a system environment when some
application is running
Documentation
BlueCat Linux 5.0 comes with an extensive user guide that is also available
for downloading from their site.
Support
LynuxWorks provides three support packages.
 BlueCat maintenance support: Mainly aimed at customers who need limited
support. This is competitively priced support for OS development seats
and tools.
 BlueCat priority support: Ideal if you require short response times, unlimited
access, corrections to known or observed defects, and assistance at the
implementation level.
 Block-of-time support: Apart from all the benefits of priority support, in
block-of-time support purchased support hours may be used any time
during a one-year period.
1.5.2 Cadenux
Cadenux specializes in providing embedded Linux distributions for the no-
MMU ARM7 and ARM9™ family of processors. Their distribution is also built
around uClinux.
Features
 Linux BSP: Cadenux provides prebuilt board support packages based on
the 2.0, 2.4, and 2.6 Linux kernels for ARM7 (TI DSC21, DSC25, DM270,
etc.) and ARM9 (TI DM310, OMAP1510, etc.). It also comes with useful
drivers for the above BSPs.
 Shared library support: Cadenux provides shared library support for no-
MMU platforms. Their XFLAT shared library technology allows applications
to link dynamically to libraries.
16 Embedded Linux System Design and Development
 Compressed kernel support: The Linux kernel can be compressed and stored
in flash, thus reducing the flash requirement.
 Real-time extensions: These include an interrupt latency measurement tool,
preemptive kernel, and real-time schedulers.
 File mapping support: Cadenux has implemented file mapping support into
its uClinux 2.4 kernel. File mapping support allows shared program text
sections. This program is like Busybox, which is large and may have
numerous copies running simultaneously. These capabilities were previ-
ously available only with a file system that supports eXecute In Place (XIP)
such as the ROMFS file system on a memory block driver. With file mapping,
these capabilities are available using any file system or block driver.
 Microwindows support: This enables rich GUI applications to run on the
target.
Development Environment
The Cadenux development environment consists of the GUI-based BSP con-
figuration tool, memconfig. This is a one stop for building all the components
of BSP such as the Linux kernel, bootloader, and file systems. Details such
as target platform, SDRAM and flash types, kernel, root file system, and device
details can all be configured with this tool. Cadenux BSPs ship with the rrload
bootloader. Cadenux provides the uClinux toolchain modified to support
XFLAT shared library support. Application libraries such as uClibc and pthreads
are also provided.
Documentation
Cadenux provides extensive documentation. Some of the manuals are the
following.
 Cadenux ARM board support package user’s guide
 RRload bootloader manual
 Cadenux board support package configuration tool
 XFLAT shared library support
The documents are available for download from the Cadenux Web site
(www.cadenux.com). These and other documents regarding device driver
architecture and usage ship with Cadenux BSP.
Support
Cadenux provides support through e-mail or telephone. They offer porting
services to get Linux running on your embedded hardware. They also provide
other services such as driver porting, performance tuning, application devel-
opment, and training for those new to embedded Linux.
Random documents with unrelated
content Scribd suggests to you:
Helena pointed from her seat on Wocha, and a lilt of hope was eager
in the tired voice: See—a ship—ahead there!
They stared, and someone raised a ragged cheer. Over the black
square-built houses of the inner city they could make out the metal
nose of a freighter. Takahashi squinted. It's Denebian, I think, he
said. Looks as if man isn't the only race which has suffered from
these scum.
All right, boys, said Helena. Let's go in and get it.
They went down a long empty avenue which ran spear-straight for
the center. The porticoed houses gaped with wells of blackness at
their passage, looming in cracked and crazily leaning massiveness on
either side, throwing back the hollow slam of their boots. Donovan
heard the uneasy mutter of voices to his rear: Don't like this
place.... Haunted.... They could be waiting anywhere for us....
The wind blew a whirl of snow across their path.
Basil. Basil, my dear.
Donovan's head jerked around, and he felt his throat tighten.
Nothing. No movement, no sound, emptiness.
Basil, I am calling you. No one else can hear.
Why are you with these creatures, Basil? Why are you marching with
the oppressors of your planet? We could free Ansa, Basil, given time
to raise our armies. We could sweep the Terrans before us and
hound them down the ways of night. And yet you march against us.
Valduma, he whispered.
Basil, you were very dear to me. You were something new and
strong and of the future, come to our weary old world, and I think I
loved you.
I could still love you, Basil. I could hold you forever, if you would let
me.
Valduma—have done!
A mocking ripple of laughter, sweet as rain in springtime, the
gallantry of a race which was old and sick and doomed and could
still know mirth. Donovan shook his head and stared rigidly before
him. It was as if he had laid hands on that piece of his soul which
had been lost, and she was trying to wrench it from him again. Only
he wanted her to win.
Go home, Basil. Go home with this female of yours. Breed your cubs,
fill the house with brats, and try to think your little round of days
means something. Strut about under the blue skies, growing fat and
gray, bragging of what a great fellow you used to be and
disapproving of the younger generation. As you like, Basil. But don't
go out to space again. Don't look at the naked stars. You won't dare.
No, he whispered.
She laughed, a harsh bell of mockery ringing in his brain. You could
have been a god—or a devil. But you would rather be a pot-bellied
Imperial magistrate. Go home, Basil Donovan, take your female
home, and when you are wakened at night by her—shall we say her
breathing?—do not remember me.
The Terrans slogged on down the street, filthy with dust and grease
and blood, uncouth shamblers, apes in the somber ruin of the gods.
Donovan thought he had a glimpse of Valduma standing on a roof-
top, the clean lithe fire of her, silken flame of her hair and the green
unhuman eyes which had lighted in the dark at his side. She had
been a living blaze, an unending trumpet and challenge, and when
she broke with him it had been quick and clean, no soddenness of
age and custom and—and, damn it, all the little things which made
humanness.
All right, Valduma. We're monkeys. We're noisy and self-important,
compromisers and trimmers and petty cheats, we huddle away from
the greatness we could have, our edifices are laid brick by brick with
endless futile squabbling over each one—and yet, Valduma, there is
something in man which you don't have. There's something by
which these men have fought their way through everything you
could loose on them, helping each other, going forward under a
ridiculous rag of colored cloth and singing as they went.
Fine words, added his mind. Too bad you don't really believe them.
He grew aware of Helena's anxious eyes on him. What's the matter,
darling? she asked gently. You look ill.
Tired, he said. But we can't have so very far to go now—
Look out!
Whirling, he saw the pillars of the house to the right buckle, saw the
huge stone slabs of the roof come thundering over the top and
streetward. For a blinding instant he saw Valduma, riding the slab
down, yelling and laughing, and then she was gone and the stone
struck.
They were already running, dropping their burden of the hurt and
fleeing for safety. Another house groaned and rumbled. The ground
shook, flying shards stung Donovan's back, echoes rolled down the
ways of Drogobych. Someone was screaming, far and faint under
the grinding racket.
Forward. Forward! Helena's voice whipped back to him, she led the
rush while the city thundered about her. Then a veil of rising dust
blotted her out, he groped ahead, stumbling over fallen pillars and
cornices, hearing the boom around him, running and running.
Valduma laughed, a red flame through the whirling dust. Her spear
gleamed for his breast, he grabbed it with one hand and hacked at
her with his sword. She was gone, and he raced ahead, not stopping
to think, not daring.
They came out on a great open plaza. Once there had been a park
here, and carved fountains, but nothing remained save a few leafless
trees and broken pieces. And the spaceships.
The spaceships, a loom of metal against the dark stone beyond, half
a dozen standing there and waiting—spaceships, spaceships, the
most beautiful sight in the cosmos! Helena and Wocha were halted
near a small fast Comet-class scoutboat. The surviving Terrans ran
toward them. Few, thought Donovan sickly, few—perhaps a score
left, bleeding from the cuts of flying stone, gray with dust and fear.
The city had been a trap.
Come on! yelled the woman. Over here and off this planet!
The men of Drogobych were suddenly there, a ring about the ship
and another about the whole plaza, crouched with their weapons
and their cat's eyes aflame. A score of hurt starvelings and half a
thousand un-men.
A trumpet blew its high note into the dusking heavens. The
Arzunians rested arms, expressionless. Donovan and the other
humans continued their pace, forming a battle square.
A trumpet blew its high note into the dusking heavens, and Valduma
appeared above the battlers to give heart to the men of Drogobych.
Morzach stood forth in front of the scout-ship. You have no further
chance to escape, he called. But we want your services, not your
lives, and the service will be well rewarded. Lay down your
weapons.
Wocha's arm straightened. His ax flew like a thunderbolt, and
Morzach's head burst open. The Donarrian roared and went against
the enemy line.
They edged away, fearfully, and the Terrans followed him in a
trotting wedge. Donovan moved up on Wocha's right side, sword
hammering at the thrusts for his ribs.
An Arzunian yelled an order which must have meant Stop them!
Donovan saw the outer line break into a run, converging on the knot
of struggle. No flying spears this time, he reflected in a moment's
bleak satisfaction—tearing down those walls must have exhausted
most of their directing energies.
A native rushed at him, sword whistling from behind a black shield.
Donovan caught the blow on his own plundered scute, feeling it ring
in the bones of his arm, and hewed back. His blade screamed close
to the white teeth-bared face, and he called a panting salutation:
Try again, Davleka!
I will!
The blows rained on his shield, sang viciously low to cut at his legs,
clattering and clanging, whistle of air and howl of iron under the
westering sun. He backed up against Wocha's side, where the
Donarrian and the woman smote against the airlock's defenders, and
braced himself and struck out.
Davleka snarled and hacked at Donovan's spread leg. The Ansan's
glaive snaked forth against his unshielded neck. Davleka's sword
clashed to earth and he sprawled against the human. Raising his
bloody face, he drew a knife, lifted it, and tried to thrust upward.
Donovan, already crossing blades with Uboda, stamped on his hand.
Davleka grinned, a rueful crooked grin through the streaming blood,
and died.
Uboda pressed close, working up against Donovan's shield. He had
none himself, but there was a dirk in his left hand. His sword locked
with Donovan's, strained it aside, and his knife clattered swiftly for
an opening.
Helena turned about and struck from her seat. Uboda's head rolled
against Donovan's shield and left a red splash down it. The man
retched.
Wocha, swinging one of his swords, pushed ahead into the
Arzunians, crowding them aside by his sheer mass, beating down a
guard and the helmet or armor beyond it. Clear! he bellowed. I
got the way clear, lady!
Helena sprang to the ground and into the lock. Takahashi, Cohen,
Basil, Wang-ki, come in and help me start the engines. The rest of
you hold them off. Don't give them time to exert what collective para
power they have left and ruin something. Make them think!
Think about their lives, huh? Wocha squared off in front of the
airlock and raised his sword. All right, boys, here they come. Let
'em have what they want.
Donovan halted in the airlock. Valduma was there, her fiery head
whirling in the rush of black-clad warriors. He leaned over and
grabbed a spaceman's arm. Ben Ali, go in and help start this crate.
I have to stay here.
But—
Donovan shoved him in, stood beside Takahashi, and braced himself
to meet the Arzunian charge.
They rushed in, knowing that they had to kill the humans before
there was an escape, swinging their weapons and howling. The
shock of the assault threw men back, pressed them to the ship and
jammed weapons close to breasts. The Terrans cursed and began to
use fists and feet, clearing a space to fight in.
Donovan's sword clashed against a shield, drove off another blade,
stabbed for a face, and then it was all lost in the crazed maelstrom,
hack and thrust and take the blows they give, hew, sword, hew!
They raged against Wocha, careless now of their lives, thundering
blows against his shield, slashing and stabbing and using their last
wizard strength to fill the air with blades. He roared and stood his
ground, the sword leaped in his hand, metal clove in thunder. The
shield was crumpled, falling apart—he tossed it with rib-cracking
force against the nearest Arzunian. His nicked and blunted sword
burst against a helmet, and he drew the other.
The ship trembled, thutter of engines warming up, the eager
promise of sky and stars and green Terra again. Get in! bawled
Donovan. Get in! We'll hold them!
He stood by Wocha as the last crewmen entered, stood barring the
airlock with a wall of blood and iron. Through a blurring vision, he
saw Valduma approach.
She smiled at him, one slim hand running through the copper hair,
the other held out in sign of peace. Tall and gracious and lovely
beyond his knowing, she moved up toward Donovan, and her clear
voice rang in his darkening mind.
Basil—you, at least, could stay. You could guide us out to the stars.
You go away, groaned Wocha.
The devil's rage flamed in her face. She yelled, and a lance whistled
from the sky and buried itself in the great breast.
Wocha! yelled Donovan.
The Donarrian snarled and snapped off the shaft that stood between
his ribs. He whirled it over his head, and Valduma's green eyes
widened in fear.
Donovan! roared Wocha, and let it fly.
It smashed home, and the Ansan dropped his sword and swayed on
his feet. He couldn't look on the broken thing which had been
Valduma.
Boss, you go home now.
Wocha laid him in the airlock and slammed the outer valve shut.
Turning, he faced the Arzunians. He couldn't see very well—one eye
was gone, and there was a ragged darkness before the other. The
sword felt heavy in his hand. But—
Hooo! he roared and charged them.
He spitted one and trampled another and tossed a third into the air.
Whirling, he clove a head and smashed a rib-case with his fist and
chopped another across. His sword broke, and he grabbed two
Arzunians and cracked their skulls together.
They ran, then, turned and fled from him. And he stood watching
them go and laughed. His laughter filled the city, rolling from its
walls, drowning the whistle of the ship's takeoff and bringing blood
to his lips. He wiped his mouth with the back of one hand, spat, and
lay down.
We're clear, Basil. Helena clung to him, shivering in his arms, and
he didn't know if it was a laugh or a sob in her throat. We're away,
safe, we'll carry word back to Sol and they'll clear the Black Nebula
for good.
Yeah. He rubbed his eyes. Though I doubt the Navy will find
anything. If those Arzunians have any sense, they'll project to
various fringe planets, scatter, and try to pass as harmless
humanoids. But it doesn't matter, I suppose. Their power is broken.
And we'll go back to your home, Basil, and bring Ansa and Terra
together and have a dozen children and—
He nodded. Sure. Sure.
But he wouldn't forget. In the winter nights, when the stars were
sharp and cold in a sky of ringing crystal black, he would—go out
and watch them? Or pull his roof over him and wait for dawn? He
didn't know yet.
Still—even if this was a long ways from being the best of all possible
universes, it had enough in it to make a man glad of his day.
He whistled softly, feeling the words run through his head:
Lift your glasses high,
kiss the girls good-bye,
(Live well, my friend, live well, live you well)
for we're riding,
for we're riding
for we're riding out to Terran sky! Terran sky! Terran sky!
The thought came all at once that it could be a song of
comradeship, too.
*** END OF THE PROJECT GUTENBERG EBOOK SARGASSO OF
LOST STARSHIPS ***
Updated editions will replace the previous one—the old editions
will be renamed.
Creating the works from print editions not protected by U.S.
copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.
START: FULL LICENSE
THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK
To protect the Project Gutenberg™ mission of promoting the
free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.
Section 1. General Terms of Use and
Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.
1.B. “Project Gutenberg” is a registered trademark. It may only
be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E. Unless you have removed all references to Project
Gutenberg:
1.E.1. The following sentence, with active links to, or other
immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and
with almost no restrictions whatsoever. You may copy it,
give it away or re-use it under the terms of the Project
Gutenberg License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country
where you are located before using this eBook.
1.E.2. If an individual Project Gutenberg™ electronic work is
derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.
1.E.3. If an individual Project Gutenberg™ electronic work is
posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.
1.E.4. Do not unlink or detach or remove the full Project
Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.
1.E.5. Do not copy, display, perform, distribute or redistribute
this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
1.E.7. Do not charge a fee for access to, viewing, displaying,
performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.
1.E.8. You may charge a reasonable fee for copies of or
providing access to or distributing Project Gutenberg™
electronic works provided that:
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You provide a full refund of any money paid by a user who
notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.
• You provide, in accordance with paragraph 1.F.3, a full refund of
any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.E.9. If you wish to charge a fee or distribute a Project
Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.
1.F.
1.F.1. Project Gutenberg volunteers and employees expend
considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.
1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except
for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.
1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you
discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.
1.F.4. Except for the limited right of replacement or refund set
forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.
1.F.5. Some states do not allow disclaimers of certain implied
warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.
1.F.6. INDEMNITY - You agree to indemnify and hold the
Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.
Section 2. Information about the Mission
of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.
Volunteers and financial support to provide volunteers with the
assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.
Section 3. Information about the Project
Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.
The Foundation’s business office is located at 809 North 1500
West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.
The Foundation is committed to complying with the laws
regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.
While we cannot and do not solicit contributions from states
where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.
International donations are gratefully accepted, but we cannot
make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.
Please check the Project Gutenberg web pages for current
donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.
Section 5. General Information About
Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.
Project Gutenberg™ eBooks are often created from several
printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.
Most people start at our website which has the main PG search
facility: www.gutenberg.org.
This website includes information about Project Gutenberg™,
including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebookgate.com

More Related Content

PDF
Embedded Linux system design and development 1st Edition P. Raghavan
PDF
PDF Embedded Linux system design and development 1st Edition P. Raghavan down...
PDF
Embedded Linux system design and development 1st Edition P. Raghavan
PDF
Embedded Linux system design and development 1st Edition P. Raghavan
PDF
Buy ebook Embedded Linux system design and development 1st Edition P. Raghava...
PDF
The IoT Architect's Guide to Attainable Security and Privacy 1st Edition Dami...
PDF
It Infrastructure Architecture Infrastructure Building Blocks And Concepts 3r...
PDF
FreeBSD Handbook 2nd Edition Murray Stokely
Embedded Linux system design and development 1st Edition P. Raghavan
PDF Embedded Linux system design and development 1st Edition P. Raghavan down...
Embedded Linux system design and development 1st Edition P. Raghavan
Embedded Linux system design and development 1st Edition P. Raghavan
Buy ebook Embedded Linux system design and development 1st Edition P. Raghava...
The IoT Architect's Guide to Attainable Security and Privacy 1st Edition Dami...
It Infrastructure Architecture Infrastructure Building Blocks And Concepts 3r...
FreeBSD Handbook 2nd Edition Murray Stokely

Similar to Complete Download Embedded Linux system design and development 1st Edition P. Raghavan PDF All Chapters (20)

PDF
FreeBSD Handbook 2nd Edition Murray Stokely
PDF
The Fundamentals of Internet of Everything Connectivity
PDF
Red_Hat_Enterprise_Linux-3-Reference_Guide-en-US.pdf
PDF
FreeBSD Handbook 2nd Edition Murray Stokely
PDF
Operating System Design The Xinu Approach 2nd Edition Douglas Comer
PDF
Operating System Design The Xinu Approach 2nd Edition Douglas Comer
PDF
Introduction ciot workshop premeetup
RTF
FreeBSD Handbook
PDF
Networking Concepts And Technology Deepak Kakadia Francesco Dimambro
PDF
Practical Security for Agile and DevOps 1st Edition Mark S Merkow
PDF
Verilog HDL-Samir Palnitkar.pdf
PDF
Informatica Command Line Statements
PDF
Data Migration Approach to SAP ISU CRM ECC.pdf
PDF
Informatica transformation guide
PDF
Practical Security For Agile And Devops 1st Edition Mark S Merkow
PDF
Download full ebook of Freebsd Handbook 27th F3thinker instant download pdf
PDF
17294_HiperSockets.pdf
PDF
Power center 10.4 getting started .pdf
PDF
Dataformat
PDF
AT&T Shape Hackathon Kick-off
FreeBSD Handbook 2nd Edition Murray Stokely
The Fundamentals of Internet of Everything Connectivity
Red_Hat_Enterprise_Linux-3-Reference_Guide-en-US.pdf
FreeBSD Handbook 2nd Edition Murray Stokely
Operating System Design The Xinu Approach 2nd Edition Douglas Comer
Operating System Design The Xinu Approach 2nd Edition Douglas Comer
Introduction ciot workshop premeetup
FreeBSD Handbook
Networking Concepts And Technology Deepak Kakadia Francesco Dimambro
Practical Security for Agile and DevOps 1st Edition Mark S Merkow
Verilog HDL-Samir Palnitkar.pdf
Informatica Command Line Statements
Data Migration Approach to SAP ISU CRM ECC.pdf
Informatica transformation guide
Practical Security For Agile And Devops 1st Edition Mark S Merkow
Download full ebook of Freebsd Handbook 27th F3thinker instant download pdf
17294_HiperSockets.pdf
Power center 10.4 getting started .pdf
Dataformat
AT&T Shape Hackathon Kick-off
Ad

Recently uploaded (20)

PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Pharma ospi slides which help in ospi learning
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
01-Introduction-to-Information-Management.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Classroom Observation Tools for Teachers
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Cell Structure & Organelles in detailed.
PPTX
Cell Types and Its function , kingdom of life
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
master seminar digital applications in india
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Insiders guide to clinical Medicine.pdf
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
VCE English Exam - Section C Student Revision Booklet
Microbial disease of the cardiovascular and lymphatic systems
Pharma ospi slides which help in ospi learning
102 student loan defaulters named and shamed – Is someone you know on the list?
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
GDM (1) (1).pptx small presentation for students
Microbial diseases, their pathogenesis and prophylaxis
01-Introduction-to-Information-Management.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Classroom Observation Tools for Teachers
O7-L3 Supply Chain Operations - ICLT Program
Abdominal Access Techniques with Prof. Dr. R K Mishra
Cell Structure & Organelles in detailed.
Cell Types and Its function , kingdom of life
Pharmacology of Heart Failure /Pharmacotherapy of CHF
master seminar digital applications in india
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Insiders guide to clinical Medicine.pdf
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPH.pptx obstetrics and gynecology in nursing
VCE English Exam - Section C Student Revision Booklet
Ad

Complete Download Embedded Linux system design and development 1st Edition P. Raghavan PDF All Chapters

  • 1. Visit https://ebookgate.com to download the full version and explore more ebooks Embedded Linux system design and development 1st Edition P. Raghavan _____ Click the link below to download _____ https://ebookgate.com/product/embedded-linux-system- design-and-development-1st-edition-p-raghavan/ Explore and download more ebooks at ebookgate.com
  • 2. Here are some recommended products that might interest you. You can download now and explore! Embedded System Design Third Edition Santanu Chattopadhyay https://ebookgate.com/product/embedded-system-design-third-edition- santanu-chattopadhyay/ ebookgate.com Principles Of Complier Design 1st Edition Raghavan https://ebookgate.com/product/principles-of-complier-design-1st- edition-raghavan/ ebookgate.com Linux for embedded and real time applications 2nd Edition Doug Abbott https://ebookgate.com/product/linux-for-embedded-and-real-time- applications-2nd-edition-doug-abbott/ ebookgate.com Linux Thin Client Networks Design and Deployment A quick guide for System Administrators David Richards https://ebookgate.com/product/linux-thin-client-networks-design-and- deployment-a-quick-guide-for-system-administrators-david-richards/ ebookgate.com
  • 3. Linux system programming 1st Edition Robert Love https://ebookgate.com/product/linux-system-programming-1st-edition- robert-love/ ebookgate.com Linux System Administration 1st ed Edition Tom Adelstein https://ebookgate.com/product/linux-system-administration-1st-ed- edition-tom-adelstein/ ebookgate.com Automating Linux and Unix System Administration 2nd Edition Campi https://ebookgate.com/product/automating-linux-and-unix-system- administration-2nd-edition-campi/ ebookgate.com Fast and Effective Embedded Systems Design 1st Edition Rob Toulson https://ebookgate.com/product/fast-and-effective-embedded-systems- design-1st-edition-rob-toulson/ ebookgate.com Red Hat Linux Networking and System Administration Terry Collings https://ebookgate.com/product/red-hat-linux-networking-and-system- administration-terry-collings/ ebookgate.com
  • 8. TEAM FLY Boca Raton New York EMBEDDED LINUX SYSTEM DESIGN AND DEVELOPMENT P. Raghavan • Amol Lad • Sriram Neelakandan
  • 9. Published in 2006 by Auerbach Publications Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 © 2006 by Taylor & Francis Group, LLC Auerbach is an imprint of Taylor & Francis Group No claim to original U.S. Government works Printed in the United States of America on acid-free paper 10 9 8 7 6 5 4 3 2 1 International Standard Book Number-10: 0-8493-4058-6 (Hardcover) International Standard Book Number-13: 978-0-8493-4058-1 (Hardcover) Library of Congress Card Number 2005048179 This book contains information obtained from authentic and highly regarded sources. Reprinted material is quoted with permission, and sources are indicated. A wide variety of references are listed. Reasonable efforts have been made to publish reliable data and information, but the author and the publisher cannot assume responsibility for the validity of all materials or for the consequences of their use. No part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC) 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged. Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe. Library of Congress Cataloging-in-Publication Data Raghavan, P. (Pichai), 1973- Embedded Linux system design and development / P. Raghavan, Amol Lad, Sriram Neelakandan. p. cm. Includes bibliographical references and index. ISBN 0-8493-4058-6 (alk. paper) 1. Linux. 2. Operating systems (Computers) 3. Embedded computer systems. I. Lad, Amol. II. Neelakandan, Sriram. III. Title. QA76.76.O63R335 2005 005.4'32--dc22 2005048179 Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the Auerbach Publications Web site at http://www.auerbach-publications.com Taylor & Francis Group is the Academic Division of T&F Informa plc.
  • 10. All source code in the book is released under GNU GPL v2. It can be used as desired under terms and conditions of GNU GPL v2. Trademarks MIPS is a registered trademark and YAMON is a trademark of MIPS Technologies. IBM and ClearCase are registered trademarks and PowerPC is a trademark of International Business Machines Corporation. UNIX is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Limited. X11 is a trademark of Massachusetts Institute of Technology. NEC is a registered trademark of NEC Corporation HP is a registered trademark of Hewlett-Packard Company. ColdFire is a registered trademark and Motorola is a trademark of Motorola, Inc Microblaze is trademark of Xilinx Inc Red Hat is a registered trademark and eCos and RedBoot are trademarks of Red Hat, Inc. uClinux is a registered trademark of Arcturus Networks Inc Linux is a registered trademark of Linus Torvalds GoAhead is a registered trademark of GoAhead Software, Inc RTLinux is a registered trademark and FSMLabs, RTLinuxPro and RTCore are trademarks of Finite State Machine Labs, Inc Debian is a registered trademark of Software in the Public Interest, Inc LMBench is a trademark of BitMover, Inc VRTX is a trademark of Microtech Research Inc VxWorks and pSOS are registered trademarks of Wind River Systems, Inc Trolltech is registered trademark and Qt is a trademark of Trolltech in Norway, the United States and other countries OpenGL is a registered trademark of Silicon Graphics, Inc Perforce is a registered trademark of Perforce Software, Inc Eclipse is trademark of Eclipse Foundation, Inc KDE and K Desktop Environment are trademarks of KDE FFmpeg is a trademark of Fabrice Bellard, originator of the FFmpeg project NVIDIA is a registered trademark of NVIDIA Corporation in the United States and other countries ViewML is a registered trademark of Century Software Inc QNX and Neutrino are registered trademarks of QNX Software Systems Ltd Nucleus is a trademark of Accelerated Technology, Inc Accelerated Technology is a registered trademark of Mentor Graphics Corporation ARM and StrongARM are registered trademarks and ARM7 and ARM9 are trademarks of Advanced RISC Machines, Ltd. AMD is a registered trademark of Advanced Micro Devices, Inc. Intel and Pentium are registered trademarks and i386 and XScale are trademarks of Intel Corporation. Sharp is a registered trademark of Sharp Electronics Corp. SPARC is a registered trademark of SPARC International, Inc., and is used under license by Sun Microsystems, Inc. Toshiba is a registered trademark of the Toshiba Corporation. MontaVista is registered trademark of MontaVista Software Inc. LynxOS and BlueCat are registered trademarks and LynuxWorks, SpyKer and VisualLynux are trademarks of LynuxWorks, Inc. Samsung is a registered trademark of Samsung Electronics America, Inc. and its related entities. Ericsson is a registered trademark of Ericsson, Inc. Atmel is registered trademarks of Atmel Corporation. TimeSys®, TimeStorm®, TimeStorm IDE™, TimeStorm LVS™, TimeStorm LDS™, TimeStorm LHD™, TimeSys Reservations™, TimeTrace®, Linux/RTTM and TimeWiz® are registered or unregistered trademarks of TimeSys Corporation in the United States and other countries. NeoMagic is registered trademark of NeoMagic Corporation. Transmeta is a trademark of Transmeta Corporation. Broadcom is a registered trademark of Broadcom Corporation and/or its subsidiaries. SuSE is a registered trademark of SuSE AG.
  • 11. vi Embedded Linux System Design and Development Borland is a registered trademark of Borland Software Corporation in the United States and other countries. Merant is a registered trademark of Merant. SnapGear is a registered trademark of SnapGear Inc. Matsushita is a trademark of the Matsushita Electric Corporation. I2C is a trademark of Philips Semiconductors Corporation. Philips® is a registered trademark of Philips Consumer Electronics Corporation. Cadenux is a trademark of Cadenux, LLC. ELinOS is a registered trademark of SYSGO AG. Metrowerks and CodeWarrior are trademarks of Metrowerks Corp. in the U.S. or other countries. FreeBSD is a registered trademark of the FreeBSD Foundation. IEEE and POSIX are registered trademarks of Institute of Electrical and Electronics Engineers, Inc. in the United States. Xtensa is a trademark belonging to Tensilica Inc. Fujitsu is a registered trademark of Fujitsu, Ltd. Firewire is a registered trademark of Apple computer. SuperH is a trademark of Hitachi, Ltd. Windows, WinCE and Microsoft are registered trademarks and MS-DOS and DirectX .are trademarks of Microsoft Corporation. Solaris and Java are registered trademarks and ChorusOS is a trademark of Sun Microsystems, Inc. in the U.S. or other countries. Symbian is a trademark of Symbian Ltd.
  • 12. vii Dedication Raghavan In memory of my late father Amol To Lord Krsna, . . . my parents, my wife Parul, and my brother Amit Sriram To my family and all Linux enthusiasts
  • 14. ix Contents 1 Intr oduction ............................................................................................. 1 1.1 History of Embedded Linux .................................................... 2 1.1.1 Year 1999 ..................................................................... 3 1.1.2 Year 2000 ..................................................................... 4 1.1.3 Year 2001 ..................................................................... 4 1.1.4 Year 2002 ..................................................................... 5 1.1.5 Year 2003 ..................................................................... 6 1.1.6 Year 2004 ..................................................................... 6 1.2 Why Embedded Linux? ............................................................ 7 1.2.1 Vendor Independence................................................. 7 1.2.2 Time to Market............................................................ 8 1.2.3 Varied Hardware Support ........................................... 8 1.2.4 Low Cost ...................................................................... 8 1.2.5 Open Source................................................................ 9 1.2.6 Standards (POSIX®) Compliance............................. 10 1.3 Embedded Linux Versus Desktop Linux .............................. 10 1.4 Frequently Asked Questions.................................................. 11 1.4.1 Is Linux Too Large?................................................... 11 1.4.2 Is Linux Real-Time Enough?..................................... 11 1.4.3 How Can I Protect My Proprietary Software?......... 12 1.4.4 Should I Buy a Commercial Embedded Linux Distribution?..................................................... 12 1.4.5 Which Embedded Linux Distribution Do I Choose? ...................................................................... 12 1.5 Embedded Linux Distributions.............................................. 13 1.5.1 BlueCat Linux ............................................................ 14 1.5.2 Cadenux ..................................................................... 15 1.5.3 Denx........................................................................... 17
  • 15. x Embedded Linux System Design and Development 1.5.4 Embedded Debian (Emdebian)................................ 18 1.5.5 ELinOS (SYSGO) ....................................................... 19 1.5.6 Metrowerks ................................................................ 20 1.5.7 MontaVista Linux....................................................... 22 1.5.8 RTLinuxPro™ ............................................................. 23 1.5.9 TimeSys Linux............................................................ 24 1.6 Porting Roadmap.................................................................... 26 Notes ................................................................................................. 28 2 Getting Started ........................................................................................ 29 2.1 Architecture of Embedded Linux .......................................... 29 2.1.1 Real-Time Executive.................................................. 29 2.1.2 Monolithic Kernels .................................................... 30 2.1.3 Microkernel ................................................................ 31 2.2 Linux Kernel Architecture...................................................... 32 2.2.1 Hardware Abstraction Layer (HAL).......................... 33 2.2.2 Memory Manager....................................................... 33 2.2.3 Scheduler.................................................................... 34 2.2.4 File System................................................................. 35 2.2.5 IO Subsystem............................................................. 36 2.2.6 Networking Subsystems............................................ 36 2.2.7 IPC.............................................................................. 36 2.3 User Space .............................................................................. 36 2.4 Linux Start-Up Sequence........................................................ 41 2.4.1 Boot Loader Phase.................................................... 42 2.4.2 Kernel Start-Up .......................................................... 43 2.4.3 User Space Initialization ........................................... 47 2.5 GNU Cross-Platform Toolchain ............................................. 48 2.5.1 Building Toolchain.................................................... 50 2.5.2 Building Toolchain for MIPS.................................... 55 3 Boar d Support Package ......................................................................... 59 3.1 Inserting BSP in Kernel Build Procedure............................. 60 3.2 The Boot Loader Interface..................................................... 62 3.3 Memory Map........................................................................... 66 3.3.1 The Processor Memory Map — MIPS Memory Model.......................................................................... 67 3.3.2 Board Memory Map .................................................. 68 3.3.3 Software Memory Map.............................................. 68 3.4 Interrupt Management............................................................ 72 3.5 The PCI Subsystem................................................................. 77 3.5.1 Uniqueness of PCI Architecture............................... 77 3.5.2 PCI Software Architecture......................................... 79
  • 16. Contents xi 3.6 Timers...................................................................................... 81 3.7 UART ....................................................................................... 81 3.7.1 Implementing the Console ....................................... 81 3.7.2 The KGDB Interface ................................................. 82 3.8 Power Management................................................................ 83 3.8.1 Hardware and Power Management ......................... 83 3.8.2 Power Management Standards ................................. 85 3.8.3 Supporting Processor’s Power-Saving Modes ......... 86 3.8.4 Unified Driver Framework for Power Management............................................................... 87 3.8.5 Power Management Applications............................. 88 4 Embedded Storage ................................................................................. 89 4.1 Flash Map................................................................................ 89 4.2 MTD—Memory Technology Device...................................... 91 4.2.1 The MTD Model........................................................ 91 4.2.2 Flash Chips ................................................................ 92 4.2.3 Flash Disks................................................................. 92 4.3 MTD Architecture ................................................................... 94 4.3.1 mtd_info Data Structure ......................................... 96 4.3.2 Interface Between MTD Core and Low-Level Flash Drivers.............................................................. 96 4.4 Sample MTD Driver for NOR Flash...................................... 97 4.5 The Flash-Mapping Drivers ................................................. 106 4.5.1 Filling up mtd_info for NOR Flash Chip............ 106 4.5.2 Filling up mtd_info for NAND Flash Chip ......... 108 4.5.3 Registering mtd_info.............................................. 109 4.5.4 Sample Mapping Driver for NOR Flash ................ 111 4.6 MTD Block and Character Devices..................................... 114 4.7 Mtdutils Package................................................................... 116 4.8 Embedded File Systems ....................................................... 116 4.8.1 Ramdisk.................................................................... 117 4.8.2 RAMFS ...................................................................... 117 4.8.3 CRAMFS (Compressed RAM File System) ............. 117 4.8.4 Journaling Flash File Systems — JFFS and JFFS2......................................................................... 117 4.8.5 NFS — Network File System.................................. 119 4.8.6 PROC File System.................................................... 119 4.9 Optimizing Storage Space.................................................... 120 4.9.1 Kernel Space Optimization..................................... 120 4.9.2 Application Space Optimization............................. 121 4.9.3 Applications for Embedded Linux ......................... 122 4.10 Tuning Kernel Memory........................................................ 124
  • 17. xii Embedded Linux System Design and Development 5 Embedded Drivers ............................................................................... 127 5.1 Linux Serial Driver................................................................ 128 5.1.1 Driver Initialization and Start-Up ........................... 130 5.1.2 Data Transmission ................................................... 134 5.1.3 Data Reception ........................................................ 134 5.1.4 Interrupt Handler..................................................... 134 5.1.5 Terminos Settings .................................................... 138 5.2 Ethernet Driver ..................................................................... 138 5.2.1 Device Initialization and Clean-Up........................ 140 5.2.2 Data Transmission and Reception ......................... 142 5.3 I2C Subsystem on Linux...................................................... 144 5.3.1 I2C Bus..................................................................... 145 5.3.2 I2C Software Architecture....................................... 147 5.4 USB Gadgets......................................................................... 152 5.4.1 USB Basics ............................................................... 153 5.4.2 Ethernet Gadget Driver........................................... 158 5.5 Watchdog Timer ................................................................... 161 5.6 Kernel Modules..................................................................... 162 5.6.1 Module APIs ............................................................ 162 5.6.2 Module Loading and Unloading ............................ 164 Notes ............................................................................................... 164 6 Porting Applications ............................................................................ 165 6.1 Architectural Comparison..................................................... 165 6.2 Application Porting Roadmap.............................................. 166 6.2.1 Decide Porting Strategy .......................................... 167 6.2.2 Write an Operating System Porting Layer (OSPL) ...................................................................... 169 6.2.3 Write a Kernel API Driver ...................................... 170 6.3 Programming with Pthreads ................................................ 171 6.3.1 Thread Creation and Exit ....................................... 172 6.3.2 Thread Synchronization .......................................... 174 6.3.3 Thread Cancellation ................................................ 180 6.3.4 Detached Threads ................................................... 181 6.4 Operating System Porting Layer (OSPL)............................. 182 6.4.1 RTOS Mutex APIs Emulation.................................. 182 6.4.2 RTOS Task APIs Emulation .................................... 185 6.4.3 IPC and Timer APIs Emulation.............................. 191 6.5 Kernel API Driver................................................................. 191 6.5.1 Writing User-Space Stubs........................................ 194 6.5.2 Kapi Driver Implementation................................... 195 6.5.3 Using the Kapi Driver............................................. 199 Note................................................................................................. 200
  • 18. Contents xiii 7 Real-Time Linux ................................................................................... 201 7.1 Real-Time Operating System ............................................... 202 7.2 Linux and Real-Time............................................................ 202 7.2.1 Interrupt Latency ..................................................... 203 7.2.2 ISR Duration ............................................................ 204 7.2.3 Scheduler Latency.................................................... 205 7.2.4 Scheduler Duration.................................................. 207 7.2.5 User-Space Real-Time ............................................. 209 7.3 Real-Time Programming in Linux ....................................... 209 7.3.1 Process Scheduling.................................................. 210 7.3.2 Memory Locking...................................................... 213 7.3.3 POSIX Shared Memory ........................................... 223 7.3.4 POSIX Message Queues.......................................... 225 7.3.5 POSIX Semaphores.................................................. 232 7.3.6 Real-Time Signals .................................................... 233 7.3.7 POSIX.1b Clock and Timers................................... 241 7.3.8 Asynchronous I/O................................................... 246 7.4 Hard Real-Time Linux.......................................................... 252 7.4.1 Real-Time Application Interface (RTAI)................. 253 7.4.2 ADEOS...................................................................... 258 8 Building and Debugging ...................................................................... 261 8.1 Building the Kernel.............................................................. 263 8.1.1 Understanding Build Procedure............................. 265 8.1.2 The Configuration Process...................................... 266 8.1.3 Kernel Makefile Framework................................... 268 8.2 Building Applications........................................................... 270 8.2.1 Cross-Compiling Using Configure.......................... 273 8.2.2 Troubleshooting Configure Script .......................... 274 8.3 Building the Root File System............................................. 275 8.4 Integrated Development Environment................................ 278 8.4.1 Eclipse ...................................................................... 279 8.4.2 KDevelop ................................................................. 279 8.4.3 TimeStorm................................................................ 279 8.4.4 CodeWarrior............................................................. 280 8.5 Debugging Virtual Memory Problems ................................ 280 8.5.1 Debugging Memory Leaks...................................... 282 8.5.2 Debugging Memory Overflows.............................. 286 8.5.3 Debugging Memory Corruption............................. 287 8.6 Kernel Debuggers................................................................. 291 8.7 Profiling................................................................................. 293 8.7.1 eProf—An Embedded Profiler................................ 294 8.7.2 OProfile .................................................................... 300
  • 19. xiv Embedded Linux System Design and Development 8.7.3 Kernel Function Instrumentation ........................... 302 Notes ............................................................................................... 308 9 Embedded Graphics ............................................................................. 309 9.1 Graphics System ................................................................... 309 9.2 Linux Desktop Graphics—The X Graphics System........... 311 9.2.1 Embedded Systems and X...................................... 312 9.3 Introduction to Display Hardware ...................................... 313 9.3.1 Display System ........................................................ 313 9.3.2 Input Interface......................................................... 316 9.4 Embedded Linux Graphics .................................................. 316 9.5 Embedded Linux Graphics Driver ...................................... 316 9.5.1 Linux Frame Buffer Interface ................................. 317 9.5.2 Frame Buffer Internals............................................ 326 9.6 Windowing Environments, Toolkits, and Applications ..... 328 9.6.1 Nano-X ..................................................................... 335 9.7 Conclusion............................................................................. 340 Notes ............................................................................................... 340 10 uClinux ................................................................................................. 341 10.1 Linux on MMU-Less Systems............................................... 341 10.1.1 Linux Versus uClinux .............................................. 342 10.2 Program Load and Execution.............................................. 343 10.2.1 Fully Relocatable Binaries (FRB)............................ 345 10.2.2 Position Independent Code (PIC).......................... 345 10.2.3 bFLT File Format..................................................... 346 10.2.4 Loading a bFLT File ................................................ 347 10.3 Memory Management........................................................... 358 10.3.1 Heap......................................................................... 358 10.3.2 Stack ......................................................................... 363 10.4 File / Memory Mapping—The Intricacies of mmap( ) in uClinux ............................................................................. 364 10.5 Process Creation ................................................................... 365 10.6 Shared Libraries .................................................................... 367 10.6.1 uClinux Shared Library Implementation (libN.so).................................................................... 367 10.7 Porting Applications to uClinux.......................................... 370 10.7.1 Creating uClinux Programs..................................... 370 10.7.2 Creating Shared Libraries in uClinux..................... 371 10.7.3 Using Shared Library in an Application................ 373 10.7.4 Memory Limitations................................................. 375 10.7.5 mmap Limitations.................................................... 375 10.7.6 Process-Level Limitations ........................................ 375
  • 20. Contents xv 10.8 XIP—eXecute In Place......................................................... 375 10.8.1 Hardware Requirements ......................................... 377 10.8.2 Software Requirements ........................................... 378 10.9 Building uClinux Distribution.............................................. 378 Notes ............................................................................................... 380 Appendices A Booting Faster ...................................................................................... 383 Techniques for Cutting Down Bootloader Initialization............. 384 Tuning Kernel for Decreased Boot-Up Time .............................. 385 Tuning User Space for Decreased Boot-Up Time ...................... 385 Measuring Boot-Up Time .............................................................. 386 B GPL and Embedded Linux ................................................................... 387 User-Space Applications ................................................................ 387 Kernel.............................................................................................. 388 Points to Remember ...................................................................... 389 Notes ............................................................................................... 390 Index ............................................................................................................ 391
  • 22. xvii Foreword The industrial revolution appears as a knife-edge change from a rural self- employed lifestyle to a clock-punching, whistle-blowing corporate urban way of life. Being in the middle of the current revolution makes it hard to realize that in fifty years most people will consider the messy, dynamic, no-rules embedded product development environment of today as an obvious clean transition caused by technological changes. The first embedded software project I worked on didn’t use an off-the- shelf operating system—there was none. It wasn’t until several years later that WindRiver introduced VxWorks®. In the mid-1990s it appeared that nothing could unseat VxWorks; yet, recently WindRiver announced a Linux-based product. Why the change? Today the most common embedded operating system used in new products is Linux. For fourteen years I was part of a small army of firmware engineers working on the development of HP LaserJet™ printers. The printer used a homegrown operating system that as I recall was called LaserJet O.S. Usually the very best engineers worked on supporting and extending the operating system. Any LaserJet O.S. documentation that existed, engineers had created. Any test suite was similarly a burden placed on the engineer’s shoulders. The effort and expense of these highly talented engineers seldom led to any features that differentiated the product from the competitors. The most important lesson I learned from the experience was to always put your most talented engineers on the features that make your product unique and outsource the infrastruc- ture. Embedded Linux is often the best choice for the operating system infrastructure for products needing nontrivial connectivity. Whether you support Linux in-house or purchase a Linux board support package for your processor, you will still need to understand the overall system and at times the details of a particular subsystem. In this book the authors have done a good job fitting all the pieces together that are necessary for embedded Linux development. The book discusses topics such as board support packages, embedded storage, and real-time Linux programming in
  • 23. xviii Embedded Linux System Design and Development depth. Embedded graphics and uClinux are also explained with clarity. The book is a good attempt to address the concerns of an embedded Linux developer. The rapid growth of Linux as the top choice for an embedded operating system in new products is in part due to the ease of using embedded Linux to replace homegrown operating systems. Although this book is specifically for running Linux on embedded systems it can also be used as a guide to port a system from a traditional RTOS or homegrown operating system to embedded Linux. It may be the need for TCP/IP networking, USB support, SecureDigital support, or some other standard that causes a company to dump their current operating system and switch to Linux. But it is the joy of developing with Linux that keeps the engineers promoting it for future products. An astounding amount of Linux information is available on the Web. I suspect it is the most extensively documented software ever. How can a book about embedded Linux provide value over what is already available? First, the scope of embedded Linux and related applications is so large that getting a feel for what is available and what can be done is challenging. Seeing all the pieces separately and working together can help you make sense of the embedded Linux ecosystem. Second, there are technical reasons for needing the right information. In an embedded device, the bootloader, kernel, and file system containing the applications all need to be developed in concert for the solution to work properly. Understanding the interdependencies and getting the development environment to properly build all three images is not straightforward. Also, when you encounter a problem, understanding the tools available to debug the problem and knowing the techniques used for debug- ging embedded devices can save a significant amount of time and effort. Finally, the best reason for reading this book on embedded Linux is because the technology is so fascinating. Anyone who had developed embedded products the old way, with one single executable image, will be amazed at the flexibility and power of using embedded Linux. Anyone new to embedded development will find most of the power and flexibility available on their desktop PC works the same in their embedded development environment. Todd Fischer President and Founder Cadenux
  • 24. xix Preface When we were in college in the mid-1990s we heard of an exciting new technology called the Internet that was to have a profound impact on our lives. Along with the Internet we also heard of an open source operating system, Linux, which was being developed by hundreds of programmers around the world. Linux gave us an opportunity to understand the internals of the operating system and we quickly became Linux enthusiasts. We realized that Linux was more than an operating system; here was a movement with few parallels in human history as it was based on the concepts of human dignity, choice, and freedom. Linux gave young programmers like us the reach to the latest technology. When we became embedded professionals Linux had yet to make a strong presence in the embedded market. However, we were hearing of some exciting improvements such as running a hard real-time kernel along with the Linux kernel and running Linux on MMU-less microcontrollers. Our happiness grew unbounded when we were asked by a customer to move our software on a MIPS-based SoC from a commercial RTOS to embedded Linux. Our experience revealed that the road to embedded Linux is not a very smooth ride. Some of the main reasons were: 1. There is undoubtedly lots of information about embedded Linux on the Internet but it is too scattered to give a consolidated view. Converting this information into a knowledge base can be a time-consuming task. Most of the product-based companies are normally short on time. Decisions need to be made quickly and executed quickly. However, a wrong decision especially on crucial issues such as licensing can prove disastrous to the company. 2. There is a gross misconception that embedded systems are all about the hardware or the operating system. As computing power increases rapidly as per Moore’s law the amount of application software that goes into the embedded system has also increased at the same rate. Hence the appli- cations have become the USP for the embedded system. So building a
  • 25. xx Embedded Linux System Design and Development Linux-based embedded system does not stop with the OS but has to do a lot with writing and building applications. And applications have their own set of issues that are different from the operating system such as licensing, toolchains, and so on. 3. Unlike a commercial RTOS, which gives a single point of support such as patches and documentation, embedded Linux takes a whole new devel- opment paradigm. Often the developers need to search for patches or for new information from the various mailing lists. And this can be very time consuming. When we came out successfully with an embedded Linux design with a variety of applications, we decided to share some of our thoughts and experiences with the rest of the world. The result of that thought process is this book. This book contains an entire development roadmap for embedded Linux systems. Our primary aim is to make the reader aware of the various issues that arise out of embedded Linux development. The theme of the book is twofold: To facilitate movement to embedded Linux from a traditional RTOS To explain the system design model with embedded Linux Benefits to the Reader The book offers solutions to problems that a developer faces when program- ming in an embedded Linux environment. Some of the common problems are: Understand the embedded Linux development model. Write, debug, and profile applications and drivers in embedded Linux. Understand embedded Linux BSP architecture. The book offers practical solutions to the above problems. After reading this book the reader will Understand the embedded Linux development environment. Understand and create Linux BSP for a hardware platform. Understand the Linux model for embedded storage and write drivers and applications for the same. Understand various embedded Linux drivers such as serial, I2C, and so on. Port applications to embedded Linux from a traditional RTOS. Write real-time applications in embedded Linux. Learn methods to find memory leaks and memory corruption in applica- tions and drivers. Learn methods to profile applications and the kernel. Understand uCLinux architecture and its programming model. Understand the embedded Linux graphics subsystem.
  • 26. Preface xxi The book is also an aid to managers in choosing an embedded Linux distribution, creating a roadmap for the transition to embedded Linux, and applying the Linux licensing model in a commercial product. Audience Primary Audience Architects: They are more concerned with real-time issues, performance, and porting plans. Software programmers: They need to get into the minute details of the technology. Secondary Audience Legal staff: Because most embedded products involve intellectual property, any wrong understanding of the licensing issues can prove detrimental to the company itself. Managers: They are normally concerned about choosing the distribution, version, toolset, and vendor. Testing and support team: Because the look and feel of the product can change when moving to embedded Linux, the test and support team needs to be educated. Background The authors expect a basic understanding of embedded system programming in any embedded OS from the reader. The book is not a Linux kernel book. Familiarity with basic Linux kernel concepts and the user-space programming model is desirable. The book attempts to be independent of the kernel version; however, wherever necessary the 2.4 or the 2.6 kernels are used as examples. Downloading Source Code Readers can download source code from the following URL: http://www. crcpress.com/e_products/downloads/download.asp?cat_no=AU0586
  • 28. xxiii Acknowledgments I thank the management of my present employer, Philips, for giving me the support to go ahead with the book. Any work of mine has always been incomplete without the blessings of my dear mother. And last but not least I would like to thank my wife, Bhargavi, for spending some cold days alone when I was busy penning down the pages for this book. Raghavan I would like to thank all the people who made this work possible. First my mother, who used to tell me to work for the book whenever she saw me roaming here and there, like any mother telling her kid to study. I also express thanks to my father who kept on asking me about the status of the manuscript, like a project manager. I thank my wife, Parul, for her patience during manuscript preparation. I remember when Raghav told me about this project and asked me to join. It was just two months after my marriage. I thank Parul for her encouragement and also thank her for helping me out in formatting the manuscript. Amol Thanks to Raghav who had the idea of writing this book. I still remember the first meeting when he instilled the confidence in me to take up this work. I thank my dad, mom, and sister for their support. Thanks to the entire “boys” gang at Bangalore who have been kind enough to share the powerful “Athlon/Audigy/ATI Radeon 9500” game PC for mean activities such as running Linux and typing sample code. They consider running a word processor on such a PC as a gross waste of computing power. Sriram We take this opportunity to thank Todd Fischer, president and founder, Cadenux, for giving us time from his busy schedule to write the foreword for the book. We thank David McCullogh, one of the uClinux core maintainers,
  • 29. xxiv Embedded Linux System Design and Development and Dr. Paul Dale for reviewing the chapter on uClinux and for providing their valuable comments. We also thank Greg Haerr, CEO of Century Software and founder of the Nano-X windowing system, for his valuable review com- ments on the embedded graphics chapter. We thank Satish MM, director of Verismo Networks, for his valuable comments on GPL. We thank our close friend and guide, Deepak Shenoy, for coming up with the idea to write a book based on our development experience. Finally we thank all Linux kernel developers and user-space programmers for taking Linux to new heights.
  • 30. xxv Introduction The text is divided into ten chapters and two appendices. Chapter 1, “Introduction,” gives a brief history of embedded Linux and what the benefits of embedded Linux are over other RTOSs. It discusses in detail the features of various open source and commercial embedded Linux distributions available. The chapter concludes by presenting a transition road- map from a traditional RTOS to embedded Linux. Chapter 2, “Getting Started,” explains the architecture of embedded Linux and compares it with traditional RTOS and microkernel architectures. In brief various Linux kernel subsystems such as the hardware abstraction layer, memory management, scheduler, file system, and so on are given. A small description of the user-space Linux programming model is also given. The second half of the chapter explains the Linux start-up sequence, from boot- loaders to kernel start-up and user-space start-up scripts. The last section explains the steps involved in building a GNU cross-platform toolchain. Chapter 3, “Board Support Package,” explains bootloader architecture fol- lowed by a discussion on the system memory map, both hardware and software memory maps. The second half of the chapter explains interrupt management, the PCI subsystem, timers, UART, and power management in detail. Chapter 4, “Embedded Storage,” explains the MTD subsystem architecture for accessing flash devices. The second half of the chapter discusses various embedded file systems such as RAMFS, CRAMFS, JFFS2, NFS, and so on. The chapter also discusses various methods for optimizing storage space in an embedded system, both kernel and user-space optimizations. A discussion of various applications designed for embedded Linux such as Busybox is given. Finally some steps for tuning the kernel memory are given. Chapter 5, “Embedded Drivers,” discusses in detail various embedded drivers such as the Serial driver, Ethernet driver, I2C subsystem, and USB gadgets.
  • 31. xxvi Embedded Linux System Design and Development Chapter 6, “Porting Applications,” discusses an application porting roadmap from a traditional RTOS to embedded Linux. The rest of the chapter explains the porting roadmap in detail. First a discussion on Linux pthreads is given, then the Operating System Porting Layer (OSPL), and finally a kernel API driver. Chapter 7, “Real-Time Linux,” discusses the real-time features in Linux. It explains the various latencies involved in the kernel such as interrupt and scheduling latency and efforts that are made to improve the kernel response time such as kernel preemption and O(1) scheduler. The core of the chapter is the discussion of POSIX.1b programming interfaces in Linux. The chapter explains various POSIX.1b real-time extensions such as real-time schedulers, memory locking, message queues, semaphores, and asynchronous I/O in detail. The last section explains in brief the hard real-time approach to Linux followed by a real-time programming model in RTAI. Chapter 8, “Building and Debugging,” is divided into three sections: build- ing, debugging, and profiling. The first section explains various mechanisms for building kernel and user-space applications. In the second section tools such as mtrace, dmalloc, and valgrind to debug memory problems are explained. Finally the last section discusses eProf, OProfile, and kernel function instrumentation profiling methods to profile user-space and kernel functions. Chapter 9, “Embedded Graphics,” explains in detail a generic frame buffer driver and how to write applications using the frame buffer interface. It also discusses in brief the X graphics subsystem and why it is not suitable for embedded devices. The last section explains the Nano-X windowing envi- ronment. Chapter 10, “uClinux,” explains the architecture and programming environ- ment in uClinux. The first half of the chapter explains the bFLT executable file format and how programs are loaded and executed in uClinux-based systems. Next a discussion about memory management, process creation, and shared libraries in uClinux is given. The final section explains XIP and how to port applications from standard Linux to uClinux. It also explains how to build applications for uClinux. Appendix A, “Booting Faster,” explains various techniques to reduce Linux boot-up time. Appendix B, “GPL and Embedded Linux,” discusses what GPL means to embedded Linux and how proprietary software can be kept safe with embed- ded Linux. Source code is available for downloading from http://www.crcpress.com/e_ products/downloads/download.asp?cat_no=AU0586
  • 32. xxvii About the Authors P. Raghavan has nine years of experience in embedded software develop- ment. He has worked on a variety of embedded products ranging from graphics displays and televisions to network equipment. Other than embedded Linux he has worked on a variety of commercial operating systems such as VxWorks and Nucleus. He understands the various issues related to the software development life cycle for embedded systems. He holds an electronics engi- neering degree from Bangalore University, India. Presently he is employed with Philips Software, Bangalore. Amol Lad is a computer science graduate from Motilal Nehru National Institute of Technology, Allahabad, India, one of the prestigious engineering colleges in the country. He first peeked into the Linux kernel sources in 1996 during his second year of engineering. It was his curiosity to understand how things work “under the hood” that attracted him to Linux. He started his career in 1999 as a device driver writer for satellite communication systems. His first exposure to embedded Linux was in the year 2001 when he wrote a BSP for a MIPS-based custom hardware platform. Presently he is employed by Verismo Networks as a Linux kernel engineer. He is responsible for designing systems based on embedded Linux for his company. If not busy reading kernel sources you can find him playing (or watching) cricket. He is also devoted to music. If he had not been a computer engineer he surely would have been a music composer. Sriram Neelakandan graduated with an electronics engineering degree and started his career as a Windows device driver programmer. He likes problems that require a soldering iron and an oscilloscope to solve rather than just the keyboard. He has worked on device drivers for various technologies including ISA, PCI, USB, PCMCIA, and CF+ across platforms such as Windows, VxWorks, and Linux. His embedded Linux experience started with porting a MIPS-based System-on-Chip (SoC) networking product. Working on the product gave him
  • 33. xxviii Embedded Linux System Design and Development the opportunity to understand various modules of Linux including the routing subsystem (fib, netlink), MTD drivers, and flash file systems (CRAMFS, JFFS2). Currently employed at Verismo Networks, India, he is part of the embedded Linux team responsible for media solutions.
  • 34. 1 Chapter 1 Introduction An embedded system is a special-purpose computer system that is designed to perform very small sets of designated activities. Embedded systems date back as early as the late 1960s where they used to control electromechanical telephone switches. The first recognizable embedded system was the Apollo guidance computer developed by Charles Draper and his team. Later they found their way into the military, medical sciences, and the aerospace and automobile industries. Today they are widely used to serve various purposes; some examples are the following. Network equipment such as firewall, router, switch, and so on Consumer equipment such as MP3 players, cell phones, PDAs, digital cameras, camcorders, home entertainment systems, and so on Household appliances such as microwaves, washing machines, televisions, and so on Mission-critical systems such as satellites and flight control Following are the key factors that differentiate an embedded system from a desktop computer. Embedded systems are usually cost sensitive. Most embedded systems have real-time constraints. There are multitudes of CPU architectures (such as ARM®, MIPS®, Pow- erPC™, etc.) that are used in embedded systems. Embedded systems employ application-specific processors. For example, the processor in your digital camera is specially tailored for image capturing and rendering. Embedded systems have (and require) very few resources in terms of RAM, ROM, or other I/O devices as compared to a desktop computer. Power management is an important aspect in most embedded systems.
  • 35. 2 Embedded Linux System Design and Development The development and debugging environment in an embedded system is very different from a desktop computer. Embedded systems generally have an inbuilt circuitry for debugging purposes. An embedded system is designed from both the hardware and software perspective, taking into account a specific application or set of applications. For example, your MP3 player may have a separate hardware MP3 decoder built inside it. In the early days effectively no operating system was used in embedded systems. There was in-house development of all the software that directly drives the hardware with almost no or very minimal multitasking and user interaction in place. But with the passage of time, more complex embedded systems started emerging and along with that a growing list of features that an embedded system should support. All of these requirements mandated use of an operating system in embedded systems that should at least provide multitasking/multithreading, process and memory management, interprocess communication, timers, and so on. So the companies started enhancing their in-house developed software so that they could have a minimal but a full- featured operating system running on their embedded platform. Various firms started efforts to provide an operating system aimed at embedded systems. Today we have a multitude of embedded operating systems. Apart from company in-house developed operating systems we have Wind River’s VxWorks®, Microsoft® Windows® CE, QNX® Neutrino®, Accelerated Technology®’s Nucleus™, Red Hat®’s eCos™, Sun Microsystems ChorusOS™, LynuxWorks™’s LynxOS®, and embedded Linux as primary embedded operating systems. 1.1 History of Embedded Linux Linus Benedict Torvalds at the University of Helsinki created the Linux® operating system in 1991. It was his mail in a minix development mailing list as shown in Listing 1.1 that is said to have started the Linux revolution. Since then Linux has never looked back. Its open source development model and GNU General Public License (GPL), under which Linux is released, attracted contributions from thousands of developers worldwide. This license allowed all the Linux kernel source code to be freely available for personal or commercial use. As the Linux kernel source code is freely available, it encouraged many developers to contribute to the Linux kernel. It is because of this global pool of developers that we have a highly reliable, robust, and powerful operating system. In early 1996 Linux saw its arrival in hard real-time embedded systems as a research project of Michael Barabanov and Victor Yodaiken. This RT-Linux research project was based on using a small real-time kernel along with Linux to provide hard real-time deadline guarantees. In 1997 the uClinux® project was started with the aim of using Linux in no-MMU processors. It was released for use in the year 1998. During the years 1999 to 2004 Linux was widely used in embedded systems. The following sections mention some of the major developments in embedded Linux during this period.
  • 36. Introduction 3 1.1.1 Year 1999 Linux started to develop its roots in the embedded systems area in the year 1999. Some of the major developments in this year were: At the Embedded Systems Conference (ESC) of September 1999 companies including Lineo, FSM Labs, MontaVista®, and Zentropix made announce- ments about embedded Linux support. Zentropix founded RealTimeLinux.org to discuss possibilities of real-time Linux solutions. Lineo announced an Embedded Advisory Board (EMLAB) for discussing the possibilities of using Linux in embedded areas. Rick Lehrbaum started an embedded Linux portal: Linuxdevices.com. RTAI was released by Paolo Mantegazza to add hard real-time support in Linux. BlueCat® Linux was announced by Lynx real-time systems (now Lynux- Works). It was the first commercial embedded Linux distribution. Listing 1.1 The Origin of Linux From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds) Newsgroups: comp.os.minix Subject: What would you like to see most in minix? Summary: small poll for my new operating system Message-ID: 1991Aug25.205708.9541@klaava.Helsinki.FI Date: 25 Aug 91 20:57:08 GMT Organization: University of Helsinki Hello everybody out there using minix – I’m doing a (free) operating system (just a hobby, won’t be big and Professional like gnu) for 386(486) AT clones. This has been brewing since april, and is starting to get ready. I’d like any feedback on things people like/dislike in minix, as my OS resembles it somewhat(same physical layout of the file-system (due to practical reasons)among other things). I’ve currently ported bash(1.08) and gcc(1.40), and things seem to work. This implies that I’ll get something practical within a few months, and I’d like to know what features most people would want. Any suggestions are welcome, but I won’t promise I’ll implement them :-) Linus (torvalds@kruuna.helsinki.fi) PS. Yes - it’s free of any minix code, and it has a multi threaded fs. It is NOT portable (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that’s all I have :-(.
  • 37. 4 Embedded Linux System Design and Development 1.1.2 Year 2000 In the year 2000 many companies adopted embedded Linux in their product lines. Samsung® launched Yopy, a PDA with Linux inside. Ericsson® launched HS210, a Linux-based cordless screen phone that combines wireless connectivity with Internet access, telephony, and e-mail functions. Atmel® announced a Linux-based single-chip Internet appliance, the AT75C310, that includes support for VoIP and audio. Agenda Computing demonstrated a Linux-based PDA at Linuxworld. This year also saw increased awareness about real-time support in Linux. TimeSys® Corporation announced Linux/RT™, an embedded Linux distri- bution aiming to provide predictable application response times by using resource reservation technology. MontaVista Software started a Linux Real-Time Characterization Project to provide developers with a set of open source tools for measuring real- time responsiveness of Linux systems. Red Hat released EL/IX version 1.1 specifications for adding real-time support in Linux. In this year many tools and utilities were released for use in embedded Linux. Busybox 0.43 was released. It was the first and most stable Busybox release. GoAhead® Software announced the GoAhead Web server for embedded Linux applications. Trolltech® launched Qt™/Embedded, a GUI application framework and windowing system for embedded Linux. ViewML® embedded browser was announced by Greg Haerr. ViewML is based on the Microwindows windowing system. In this year the Embedded Linux Consortium (ELC) was founded by Rick Lehrbaum with major corporations such as Intel® and IBM® as its members. The aim of this consortium was to facilitate the use of Linux and open source software in embedded areas. ELC promoted Linux as an effective, secure, and reliable operating system for embedded systems. OSDL (Open Source Development Lab) was also founded in this year by HP®, Intel, IBM, and NEC® with the goal of supporting enterprise Linux solutions. 1.1.3 Year 2001 The biggest announcement of the year 2001 was the release of Linux kernel 2.4, which was later adopted in many embedded Linux distributions. In this year Linux was also widely used in handheld devices and gadgets.
  • 38. Introduction 5 Sharp® Electronics introduced Linux-based PDAs. Trolltech and Lisa systems announced a wireless iPAQ solution for the Compaq iPAQ palmtop computer. NeoMagic® also announced a Linux-based SOC platform for smart handheld devices. Transmeta™ Corporation released “Midori” Linux, an open source distri- bution targeting small devices. Embedded Linux standardization efforts were also gaining pace in the year 2001. Japan Embedded Linux Consortium (EMBLIX) was founded by major corporations including Toshiba® and NEC with the aim of promoting, educating, and standardizing embedded Linux in Japan. TV Linux Alliance was formed to define a set of standards for using Linux in set-top boxes. Broadcom®, Motorola, and Sun Microsystems were some of its cofounders. The Free Standards Group (FSG) released Linux Standard Base (LSB) specification version 1.0. The goal of LSB was to develop a set of standards to increase compatibility among Linux distributions so that applications can run on any compliant Linux system. LSB is widely recognized by the enterprise Linux industry and is also considered useful for embedded Linux. In terms of tools and utilities the following also occurred. First major release of uClibc, uClibc 0.9.8, was made. uClibc now is an integral part of almost all embedded Linux distributions. Eclipse™ consortium was formed by major corporations including IBM, SuSE®, Red Hat, QNX Software Systems, Borland®, and Merant® to provide a development environment framework for embedded systems. Today companies such as TimeSys, LynuxWorks, MontaVista, and others are using the Eclipse framework to provide IDEs for embedded Linux development. 1.1.4 Year 2002 The year 2002 saw a major advancement of Linux in embedded markets with more and more companies adopting Linux in their product designs. Real-time support in Linux was also getting better. Kernel preemption patch from Robert Love, low latency patches by Andrew Morton, and the O(1) scheduler by Ingo Molnar found their ways into the Linux kernel. RTLinux® added hard real-time capability to user space. The ADEOS project announced the first release of ADEOS, a hardware abstraction layer allowing a real-time kernel and a general-purpose OS to co-exist. In terms of standardization efforts, the following occurred.
  • 39. 6 Embedded Linux System Design and Development ELC released the Embedded Linux Consortium Platform Specification (ELCPS). The ELCPS provided a standard for the API layer that increases reusability and portability of program code. The standard helps developers by decreasing time and cost to develop embedded applications in Linux. OSDL announced the Carrier Grade Linux (CGL) working group to promote and standardize the use of Linux in carrier grade systems. CGL released v1.x CGL requirements specifications in the same year. Free Standards Group announced the LSB 1.1 and LSB certification pro- gram. The aim of the LSB certification program was to employ an inde- pendent authority to verify that a Linux distribution or application adheres to LSB. In this year Linux saw more inroads in the digital entertainment industry. Intel announced a reference design for a home digital media adapter. Trace Strategies Inc. published a research report projecting Linux as a preferred OS in devices such as digital interactive TV (ITV), set-top boxes, and so on. In this year uClinux also gained shared library support from SnapGear® and Ridgerun. It later found its way into mainstream Linux kernel version 2.5.46. 1.1.5 Year 2003 In the year 2003 Linux saw its growth in the cell phone and SOHO markets. Motorola announced its A760 mobile phone handset that uses Linux as its embedded OS. Linux saw more penetration in gateway, routers, and wireless LANs for SOHO and consumer markets. In this year more stress was put on standardization. ELC added an extension to ELCPS to add support for power management, user interface, and real-time standards. OSDL announced CGL v2.0 with major advances in security, high avail- ability, and clustering. The Consumer Electronics Linux Forum (CELF) was formed in June 2003 to provide specifications for using Linux in CE devices and to maintain a Linux kernel source tree that has enhancements specifically for CE devices. CELF invites companies to contribute to the tree so that Linux can become a de facto operating system for CE devices. Matsushita™, Sony, Hitachi, NEC, Royal Philips® Electronics, Samsung, Sharp Corporation, and Toshiba Corporation were the founders of CELF. The year 2003 ended with the release of the Linux 2.6.0 kernel. 1.1.6 Year 2004 Some of the highlights of the year 2004 were as follows.
  • 40. Introduction 7 In this year LynuxWorks released the 2.6 Linux kernel-based BlueCat Linux distribution. It was the first commercial embedded Linux distribution based on the 2.6 Linux kernel. Sony Corporation introduced Linux-based devices for in-car navigation and infotainment systems in Japan. The devices feature 3-D map navigation technology, media players, hard drives, GPS, and PC connectivity. Trolltech announced a mobile phone application stack that delivers PDA- like features on smartphones. OSDL’s CGL specifications saw wide acceptance in the telecommunications industry. CELF released its first specification for using Linux in CE devices. The specification is also supported by a reference implementation in the form of a patched Linux kernel source tree supporting nine target boards. Free Standards Group (FSG) and OSDL released LSB 2.0. Today lots of companies are adopting embedded Linux for their new designs. More and more vendors are providing embedded Linux distribution for various hardware platforms. Today embedded Linux is a preferred oper- ating system for embedded systems. Silicon suppliers such as AMD®, ARM, TI, Motorola™, IBM, Intel, and so on all use Linux as a preferred hardware bring-up platform. CE devices OEMs such as Sony and NEC are deploying Linux in DVDs, DVRs, and digital handsets. 1.2 Why Embedded Linux? Any newcomer to the domain of embedded Linux is bound to be riddled with a question: “Why choose embedded Linux as an operating system in the target?” In this section we discuss some benefits of embedded Linux against proprietary embedded operating systems. 1.2.1 Vendor Independence Selecting a proprietary OS may lock you up with the same vendor for the lifetime of your product. Bad support from the vendor can result in increased time to market of your product. You may end up waiting days or even weeks for the solution to even small problems. Changing the vendor may mean restarting the whole product life cycle. Embedded Linux brings vendor independence. Vendors of all embedded Linux distributions have more or less the same business model. The distribu- tions are variations of the same theme. They all have the same and common basic components such as Linux kernel, libraries, basic utilities, and the like. If at some point you feel that your embedded Linux distribution vendor is not living up to your expectations, you can switch vendors at a relatively low cost. Above all you can also decide to have no embedded OS vendor at all
  • 41. 8 Embedded Linux System Design and Development for your product, as the source code of the Linux kernel and associated utilities are freely available. 1.2.2 Time to Market For embedded Linux, a rich set of toolsets and utilities is available. Most of the vendors provide preview kits for various hardware platforms that can be downloaded free of cost. It is highly likely that a Linux port for your hardware is already available. Consequently you will spend time only in writing appli- cations without worrying about the Linux port for the hardware or device driver for a high-performance I/O card that is part of your system. With an embedded Linux system a product can be rolled out very quickly. One advantage of using Linux in an embedded platform is reduced devel- opment time. By using a Linux-based host development environment, most of the applications that are to be run on the target hardware can be tested on a Linux host, reducing time to port applications. For example, if your target needs a DHCP client, you can very well take any open source DHCP client (meeting the size requirement for target), compile, and test on a Linux host. If it works on the host then the only effort required is to cross-compile it for your target. It should run on the target without any problems. 1.2.3 Varied Hardware Support With the arrival of large numbers of new high-end, low-cost, and much more sophisticated microprocessors and I/O devices it’s becoming increasingly difficult for the vendors of proprietary embedded OSs to support them in time. Even if the product demands high-end hardware, customers may not be able to use it because their proprietary embedded OS vendor may not support it. Linux support for many architectures and high-end I/O devices gives you the independence to choose appropriate hardware for your system. Linux is also a preferred OS for any hardware or software innovation. It is widely accepted in universities as a research and learning tool. Linux is also a preferred bring-up platform for hardware manufacturers. 1.2.4 Low Cost Embedded Linux brings minimal cost for development, training, and hiring needs. Development Cost A vendor of proprietary software may charge a huge amount for licenses of development tools. These are generally per-seat licenses and thus limit the number of users that can use the development environment. With embedded
  • 42. Introduction 9 Linux, all the tools and utilities such as compilers, linkers, libraries, shells, and the like that constitute its development environment can be downloaded for free. Good IDEs are also available at either very little cost or completely free of charge. GUI-based configuration environment and profiling tools are also available. Training and Hiring Costs New development environments are expensive. The manufacturing cost of your product significantly increases when your developers require retraining or if you decide to hire a specialist who understands the development process, API usage, optimization techniques, and so on in the particular proprietary OS. Linux has a UNIX®-based programming model, which is familiar to most engineers. Thus the learning curve for embedded Linux is very small. Runtime Royalty Finally, a runtime royalty of the proprietary embedded OS (or some other third-party component) adds to product cost. The embedded market is highly cost sensitive. These days a lot of effort is being paid to reduce the cost of the product that reaches the end user. Embedded Linux is royalty free. Most vendors of embedded Linux distribution charge no runtime royalties to their customers. Lack of runtime royalties reduces the BOM (Bill Of Materials) of the product. 1.2.5 Open Source One of the main reasons why Linux became so popular is its open source model of development. Linux has the following advantages because of open source. There are thousands of developers around the world who are contributing to and enhancing the Linux kernel and other applications. You are assured of global support during your development. There are separate mailing lists for almost all the Linux ports whether ARM, MIPS, or no-MMU. The mailing list archives might already contain answers to most of your questions. If not, a proper reply can be expected for a genuine question posted in these lists. It has a rich set of features with superior software and a rich talent pool across the world reviews every feature that goes in the kernel. This makes Linux robust and reliable. Availability of source code facilitates better understanding of what’s going under the hood, how to customize it for optimal designs, and how to fix bugs if they arise. The Linux kernel or some device driver can be tailored for achieving high performance for your platform. Even the tools, applications, and utilities that come with Linux have an open source nature, thus benefiting from the open source advantage.
  • 43. 10 Embedded Linux System Design and Development 1.2.6 Standards (POSIX®) Compliance The idea of POSIX is to improve the portability of software written for UNIX, thus making the job of a UNIX developer much easier. It aims at providing standards that define common interfaces and features for a UNIX-like operating system. The Linux kernel provides POSIX-compliant APIs for services such as memory management, process and thread creation, interprocess communica- tion, file systems, and TCP/IP. It’s because of these benefits that the current system software trend for an embedded system is shifting towards embedded Linux. From lower cost to rich toolset, these benefits are providing a big thrust for using Linux in embedded areas. 1.3 Embedded Linux Versus Desktop Linux Linux is used in a variety of hardware: right from huge SMP servers to the smallest of gadgets. But it is indeed a marvel that a single code base is used for the kernel irrespective of its final destination. This was achieved by implementing a high level of modularity within the kernel and making it easily configurable to be employed across a variety of hardware. However, some distributions do provide enhancements as patches to the standard Linux kernel to “suit” it for embedded systems. But truly speaking one can simply download a stable Linux kernel source, configure it as per system requirement, cross- compile, and it should be ready for use. Features such as real-time scheduling and kernel preemption, which are suited for embedded applications, are now part of the main kernel source tree. Following are some of the key differences. The way the Linux kernel is configured for embedded systems differs from its desktop counterpart. The set of device drivers and file systems that is needed differs in both. For example, an embedded system may need a flash driver and a flash file system (such as CRAMFS or JFFS2) whereas they are not needed in a desktop system. In embedded Linux more focus is paid to tools that are needed for development, debugging, and profiling. In embedded Linux focus is paid to a set of cross-development tools that allow developers to build appli- cations for their target on say x86-based host systems. On the other hand, in desktop Linux more focus is paid to a set of packages that are useful for users such as word processors, e-mail, newsreaders, and so on. The utilities that are part of an embedded Linux distribution are different from similar ones in desktop Linux. Ash, Tinylogin, and Busybox are considered to be requirements for using with embedded Linux. Even the application libraries such as uClibc are preferred for embedded applications as opposed to its Glibc desktop counterpart.1 Windowing and GUI environments that are used in embedded Linux differ from the desktop ones. The X window system, which is quite common
  • 44. Introduction 11 for desktop Linux, is not suited to embedded environments. For embedded Linux, Microwindows (nanoX) serves a similar purpose. Targets deploying embedded Linux mostly run in single-user mode with almost no system administration capabilities. On the other hand, system administration plays a very important role in desktop Linux. 1.4 Frequently Asked Questions In this section we try to answer some of the common questions regarding embedded Linux. 1.4.1 Is Linux Too Large? Generally one tends to think that as Linux was designed to run on desktop systems, it might be bulky and unsuitable for embedded systems. But contrary to all these speculations, Linux is highly modular and it has an excellent component selection mechanism. Based on system configuration, one can keep only the components needed. For example, if no network support is needed, just disable it at Linux kernel configuration time; no file systems, just disable them too. One may also ask about SDRAM and flash requirements of embedded Linux. A minimal working embedded Linux system with networking and file system support needs around 4 MB of SDRAM and 2 MB of flash. 16 MB or 32 MB of SDRAM and 4 MB of flash will enable one to add a rich set of applications to the platform with increased system performance Some of the small-footprint embedded Linux efforts include the following. uClinux, a Linux port for no-MMU platforms such as Motorola 68k, ARM7™, and so on has a full-featured version with minimum SDRAM and FLASH requirement. ELKS (Embedded Linux Kernel Subset) plans to put embedded Linux in the Palm Pilot. ThinLinux is yet another small-footprint distribution targeted at digital cameras, MP3 players, and similar embedded applications. 1.4.2 Is Linux Real-Time Enough? As Linux’s roots are in desktop computing, people question its usage in real- time systems. There is a lot of work going on in the embedded Linux area to enable it for real-time systems. The enhancements are either in the form of a preemptive kernel or real-time–capable scheduler. For hard real-time applications the dual kernel approach is used in which a real-time executive is responsible for handling time-critical jobs while preserving the Linux advan- tage. Today Linux is capable of satisfying the real-time needs of systems. We discuss more about Linux real-time capabilities in Chapter 7.
  • 45. 12 Embedded Linux System Design and Development 1.4.3 How Can I Protect My Proprietary Software? There is lot of concern regarding GPL licensing and proprietary software. GPL licensing is seldom a problem for embedded applications. Proprietary software can always be kept safe with embedded Linux. Please refer to Appendix B for a complete discussion on GPL and its use in embedded systems. 1.4.4 Should I Buy a Commercial Embedded Linux Distribution? This is one of the questions that you may come across when you decide to use embedded Linux for your target. With embedded Linux, it is not at all mandatory to go for any commercial distribution. You can always download free sources and then customize them for the target. But there are some disadvantages of the “on your own” approach. You may need to spend considerable time and resources to create a Linux port for your target. Even if a port is already available, lack of good support and enhanced development tools can delay the development cycle. The authors recommend using a commercial embedded Linux distribution, unless your company has sufficient expertise in embedded Linux. There are lots of very good open source distributions available. They can also be used if they fit your requirements. A commercial distribution comes with various advantages. Some of them are as follows. Support: This is one of the biggest advantages of going with a commercial distribution. Embedded Linux distribution firms generally have a well- trained staff and expertise in the area of system software. They can assist you with any part of your project and for a very low cost. Development tools and utilities: With commercial distribution comes a rich development environment. Most distributions have GUI-based installation, configuration, development, and debugging tools. Some provide special- ized tools for profiling. Others have very user-friendly tools for download- ing the image in the target. They all come with a rich set of utilities compiled for your platform. All this drastically reduces development time. Kernel enhancements: The commercial distribution generally provides some kernel enhancement either as a part of the kernel or as kernel modules. The enhancements include increased real-time response of the kernel, reduced kernel memory and flash footprint, drivers and utilities for supporting graph- ical or networking needs of embedded applications, and so on. In a nutshell, a commercial embedded Linux distribution reduces effort and development time, thus reducing time to market of your product. For a company that is moving to embedded Linux with no prior Linux experience, these benefits may ease the movement. 1.4.5 Which Embedded Linux Distribution Do I Choose? There are lots of embedded Linux distributions available. Choosing the right one is very important for the successful completion of your project. The following points should be considered before finalizing a distribution.
  • 46. Introduction 13 Package: Is the distribution providing all the software necessary for your project? For example, it may have tons of utilities and drivers, but does it really have all the drivers that are needed in your target? Does the package include development, debugging, and profiling tools? Documentation: The distribution should provide documentation and sam- ple programs for all the tools and utilities that are part of the package. It should accompany a proper reference manual explaining in detail mech- anisms such as how to build the binaries and load them in the target, how to profile the system, and so on. If a distribution is accompanied by any proprietary software then that too should be properly documented. Proprietary software: Some distributions ship proprietary software either in the form of some tools or some device driver in the form of “binary only” kernel modules. You should be very careful when choosing such a distribution. You should be totally convinced that such software from the distribution is really required and there are no other alternatives. Too much dependence on proprietary software nullifies the vendor independence aspect of embedded Linux. Also check if there is any runtime royalty associated with such software. Software upgrades: An embedded Linux distribution vendor keeps enhanc- ing the distribution either by adding more tools and utilities or using a higher version of the Linux kernel. Make sure whether they are available for free or there is extra cost involved. Flexibility: Is the distribution fitting well in short- or long-term company goals? Can you reuse the same software for the future version of your product? Can you use at least the tools provided, if not the kernel for some other product on similar lines? Support: Finally and most important is the support aspect. Do you need to sign any separate support contract? What is the cost involved? How good is the support, whether it be for some bug fixing or writing a whole new device driver? If possible, check with some existing customer of the vendor. Choosing the right distribution is very important for the successful com- pletion of your project. A vendor of an embedded Linux distribution should guide you in all your system software needs. But a word of caution: too much dependence on a vendor is also not recommended. A company should slowly build proper expertise in Linux. This will be a long-term benefit for the organization. 1.5 Embedded Linux Distributions In this section we discuss various commercial and open source embedded Linux distributions available today. The idea of this section is to give readers a brief description of various embedded Linux distributions to facilitate decision making for their platform. In this section we cover prominent distributions such as Cadenux®, Embed- ded Debian®, Denx, ELinOS®, RTLinux, BlueCat, Metrowerks™, MontaVista, and TimeSys. We compare distributions against the following points.
  • 47. 14 Embedded Linux System Design and Development Features: What are the kernel and toolchain features? Development environment: How user-friendly is the development environ- ment? Documentation: What documentation is provided with the distribution? Support: What is the support policy? The distributions are discussed in alphabetical order. 1.5.1 BlueCat Linux BlueCat Embedded Linux 5.0 from LynuxWorks (www.lynuxworks.com) is a commercial distribution based on the Linux 2.6 kernel. The distribution is targeted for use in embedded systems ranging from small consumer-type devices to large-scale, multi-CPU systems. Features BlueCat uses Linux kernel version 2.6 thus providing Kernel preemption Low-latency fixed-time scheduler Improved POSIX threading support; new POSIX threads implementation based on NPTL (New POSIX Thread Library) POSIX timers and real-time signals It also includes Enhanced GNU cross-development tools including GCC 3.2.2, GDB mul- tithreading debugging support, and kernel debuggers Target support for XScale™ micro architecture, PowerPC, IA-32, ARM, MIPS, and x86 PC-compatibles Utilities such as Busybox, Tinylogin, uClibc, and so on Zebra routing protocol and enhanced network management and security features Embedded target tools for footprint minimization and kernel configuration Development Environment LynuxWorks provides a range of development tools for speedy development. VisualLynux™: Windows-based IDE. VisualLynux is a plug-in for Microsoft Visual Studio™ .NET IDE that lets developers build BlueCat Linux appli- cations in a Windows host environment. The plug-in provides all the commands and standard GNU tools needed to streamline application development for BlueCat Linux targets in a Windows environment. CodeWarrior™: Linux- and Solaris®-based IDE. Combining an editor, code browser, compiler, linker, debugger, and intuitive GUI, the CodeWarrior
  • 48. Introduction 15 IDE speeds up Linux- and Solaris-based development for BlueCat Linux targets. Apart from the above IDEs, LynuxWorks provides the following debugging tools. TotalView: Provides advanced debugging across multiple processors, threads, and processes LynxInsure++: For runtime error detection and analysis SpyKer™ : To monitor all the events in a system environment when some application is running Documentation BlueCat Linux 5.0 comes with an extensive user guide that is also available for downloading from their site. Support LynuxWorks provides three support packages. BlueCat maintenance support: Mainly aimed at customers who need limited support. This is competitively priced support for OS development seats and tools. BlueCat priority support: Ideal if you require short response times, unlimited access, corrections to known or observed defects, and assistance at the implementation level. Block-of-time support: Apart from all the benefits of priority support, in block-of-time support purchased support hours may be used any time during a one-year period. 1.5.2 Cadenux Cadenux specializes in providing embedded Linux distributions for the no- MMU ARM7 and ARM9™ family of processors. Their distribution is also built around uClinux. Features Linux BSP: Cadenux provides prebuilt board support packages based on the 2.0, 2.4, and 2.6 Linux kernels for ARM7 (TI DSC21, DSC25, DM270, etc.) and ARM9 (TI DM310, OMAP1510, etc.). It also comes with useful drivers for the above BSPs. Shared library support: Cadenux provides shared library support for no- MMU platforms. Their XFLAT shared library technology allows applications to link dynamically to libraries.
  • 49. 16 Embedded Linux System Design and Development Compressed kernel support: The Linux kernel can be compressed and stored in flash, thus reducing the flash requirement. Real-time extensions: These include an interrupt latency measurement tool, preemptive kernel, and real-time schedulers. File mapping support: Cadenux has implemented file mapping support into its uClinux 2.4 kernel. File mapping support allows shared program text sections. This program is like Busybox, which is large and may have numerous copies running simultaneously. These capabilities were previ- ously available only with a file system that supports eXecute In Place (XIP) such as the ROMFS file system on a memory block driver. With file mapping, these capabilities are available using any file system or block driver. Microwindows support: This enables rich GUI applications to run on the target. Development Environment The Cadenux development environment consists of the GUI-based BSP con- figuration tool, memconfig. This is a one stop for building all the components of BSP such as the Linux kernel, bootloader, and file systems. Details such as target platform, SDRAM and flash types, kernel, root file system, and device details can all be configured with this tool. Cadenux BSPs ship with the rrload bootloader. Cadenux provides the uClinux toolchain modified to support XFLAT shared library support. Application libraries such as uClibc and pthreads are also provided. Documentation Cadenux provides extensive documentation. Some of the manuals are the following. Cadenux ARM board support package user’s guide RRload bootloader manual Cadenux board support package configuration tool XFLAT shared library support The documents are available for download from the Cadenux Web site (www.cadenux.com). These and other documents regarding device driver architecture and usage ship with Cadenux BSP. Support Cadenux provides support through e-mail or telephone. They offer porting services to get Linux running on your embedded hardware. They also provide other services such as driver porting, performance tuning, application devel- opment, and training for those new to embedded Linux.
  • 50. Random documents with unrelated content Scribd suggests to you:
  • 51. Helena pointed from her seat on Wocha, and a lilt of hope was eager in the tired voice: See—a ship—ahead there! They stared, and someone raised a ragged cheer. Over the black square-built houses of the inner city they could make out the metal nose of a freighter. Takahashi squinted. It's Denebian, I think, he said. Looks as if man isn't the only race which has suffered from these scum. All right, boys, said Helena. Let's go in and get it. They went down a long empty avenue which ran spear-straight for the center. The porticoed houses gaped with wells of blackness at their passage, looming in cracked and crazily leaning massiveness on either side, throwing back the hollow slam of their boots. Donovan heard the uneasy mutter of voices to his rear: Don't like this place.... Haunted.... They could be waiting anywhere for us.... The wind blew a whirl of snow across their path. Basil. Basil, my dear. Donovan's head jerked around, and he felt his throat tighten. Nothing. No movement, no sound, emptiness. Basil, I am calling you. No one else can hear. Why are you with these creatures, Basil? Why are you marching with the oppressors of your planet? We could free Ansa, Basil, given time to raise our armies. We could sweep the Terrans before us and hound them down the ways of night. And yet you march against us. Valduma, he whispered. Basil, you were very dear to me. You were something new and strong and of the future, come to our weary old world, and I think I loved you. I could still love you, Basil. I could hold you forever, if you would let me. Valduma—have done!
  • 52. A mocking ripple of laughter, sweet as rain in springtime, the gallantry of a race which was old and sick and doomed and could still know mirth. Donovan shook his head and stared rigidly before him. It was as if he had laid hands on that piece of his soul which had been lost, and she was trying to wrench it from him again. Only he wanted her to win. Go home, Basil. Go home with this female of yours. Breed your cubs, fill the house with brats, and try to think your little round of days means something. Strut about under the blue skies, growing fat and gray, bragging of what a great fellow you used to be and disapproving of the younger generation. As you like, Basil. But don't go out to space again. Don't look at the naked stars. You won't dare. No, he whispered. She laughed, a harsh bell of mockery ringing in his brain. You could have been a god—or a devil. But you would rather be a pot-bellied Imperial magistrate. Go home, Basil Donovan, take your female home, and when you are wakened at night by her—shall we say her breathing?—do not remember me. The Terrans slogged on down the street, filthy with dust and grease and blood, uncouth shamblers, apes in the somber ruin of the gods. Donovan thought he had a glimpse of Valduma standing on a roof- top, the clean lithe fire of her, silken flame of her hair and the green unhuman eyes which had lighted in the dark at his side. She had been a living blaze, an unending trumpet and challenge, and when she broke with him it had been quick and clean, no soddenness of age and custom and—and, damn it, all the little things which made humanness. All right, Valduma. We're monkeys. We're noisy and self-important, compromisers and trimmers and petty cheats, we huddle away from the greatness we could have, our edifices are laid brick by brick with endless futile squabbling over each one—and yet, Valduma, there is something in man which you don't have. There's something by which these men have fought their way through everything you
  • 53. could loose on them, helping each other, going forward under a ridiculous rag of colored cloth and singing as they went. Fine words, added his mind. Too bad you don't really believe them. He grew aware of Helena's anxious eyes on him. What's the matter, darling? she asked gently. You look ill. Tired, he said. But we can't have so very far to go now— Look out! Whirling, he saw the pillars of the house to the right buckle, saw the huge stone slabs of the roof come thundering over the top and streetward. For a blinding instant he saw Valduma, riding the slab down, yelling and laughing, and then she was gone and the stone struck. They were already running, dropping their burden of the hurt and fleeing for safety. Another house groaned and rumbled. The ground shook, flying shards stung Donovan's back, echoes rolled down the ways of Drogobych. Someone was screaming, far and faint under the grinding racket. Forward. Forward! Helena's voice whipped back to him, she led the rush while the city thundered about her. Then a veil of rising dust blotted her out, he groped ahead, stumbling over fallen pillars and cornices, hearing the boom around him, running and running. Valduma laughed, a red flame through the whirling dust. Her spear gleamed for his breast, he grabbed it with one hand and hacked at her with his sword. She was gone, and he raced ahead, not stopping to think, not daring. They came out on a great open plaza. Once there had been a park here, and carved fountains, but nothing remained save a few leafless trees and broken pieces. And the spaceships.
  • 54. The spaceships, a loom of metal against the dark stone beyond, half a dozen standing there and waiting—spaceships, spaceships, the most beautiful sight in the cosmos! Helena and Wocha were halted near a small fast Comet-class scoutboat. The surviving Terrans ran toward them. Few, thought Donovan sickly, few—perhaps a score left, bleeding from the cuts of flying stone, gray with dust and fear. The city had been a trap. Come on! yelled the woman. Over here and off this planet! The men of Drogobych were suddenly there, a ring about the ship and another about the whole plaza, crouched with their weapons and their cat's eyes aflame. A score of hurt starvelings and half a thousand un-men. A trumpet blew its high note into the dusking heavens. The Arzunians rested arms, expressionless. Donovan and the other humans continued their pace, forming a battle square.
  • 55. A trumpet blew its high note into the dusking heavens, and Valduma appeared above the battlers to give heart to the men of Drogobych. Morzach stood forth in front of the scout-ship. You have no further chance to escape, he called. But we want your services, not your lives, and the service will be well rewarded. Lay down your weapons. Wocha's arm straightened. His ax flew like a thunderbolt, and Morzach's head burst open. The Donarrian roared and went against the enemy line.
  • 56. They edged away, fearfully, and the Terrans followed him in a trotting wedge. Donovan moved up on Wocha's right side, sword hammering at the thrusts for his ribs. An Arzunian yelled an order which must have meant Stop them! Donovan saw the outer line break into a run, converging on the knot of struggle. No flying spears this time, he reflected in a moment's bleak satisfaction—tearing down those walls must have exhausted most of their directing energies. A native rushed at him, sword whistling from behind a black shield. Donovan caught the blow on his own plundered scute, feeling it ring in the bones of his arm, and hewed back. His blade screamed close to the white teeth-bared face, and he called a panting salutation: Try again, Davleka! I will! The blows rained on his shield, sang viciously low to cut at his legs, clattering and clanging, whistle of air and howl of iron under the westering sun. He backed up against Wocha's side, where the Donarrian and the woman smote against the airlock's defenders, and braced himself and struck out. Davleka snarled and hacked at Donovan's spread leg. The Ansan's glaive snaked forth against his unshielded neck. Davleka's sword clashed to earth and he sprawled against the human. Raising his bloody face, he drew a knife, lifted it, and tried to thrust upward. Donovan, already crossing blades with Uboda, stamped on his hand. Davleka grinned, a rueful crooked grin through the streaming blood, and died. Uboda pressed close, working up against Donovan's shield. He had none himself, but there was a dirk in his left hand. His sword locked with Donovan's, strained it aside, and his knife clattered swiftly for an opening. Helena turned about and struck from her seat. Uboda's head rolled against Donovan's shield and left a red splash down it. The man retched.
  • 57. Wocha, swinging one of his swords, pushed ahead into the Arzunians, crowding them aside by his sheer mass, beating down a guard and the helmet or armor beyond it. Clear! he bellowed. I got the way clear, lady! Helena sprang to the ground and into the lock. Takahashi, Cohen, Basil, Wang-ki, come in and help me start the engines. The rest of you hold them off. Don't give them time to exert what collective para power they have left and ruin something. Make them think! Think about their lives, huh? Wocha squared off in front of the airlock and raised his sword. All right, boys, here they come. Let 'em have what they want. Donovan halted in the airlock. Valduma was there, her fiery head whirling in the rush of black-clad warriors. He leaned over and grabbed a spaceman's arm. Ben Ali, go in and help start this crate. I have to stay here. But— Donovan shoved him in, stood beside Takahashi, and braced himself to meet the Arzunian charge. They rushed in, knowing that they had to kill the humans before there was an escape, swinging their weapons and howling. The shock of the assault threw men back, pressed them to the ship and jammed weapons close to breasts. The Terrans cursed and began to use fists and feet, clearing a space to fight in. Donovan's sword clashed against a shield, drove off another blade, stabbed for a face, and then it was all lost in the crazed maelstrom, hack and thrust and take the blows they give, hew, sword, hew! They raged against Wocha, careless now of their lives, thundering blows against his shield, slashing and stabbing and using their last wizard strength to fill the air with blades. He roared and stood his ground, the sword leaped in his hand, metal clove in thunder. The shield was crumpled, falling apart—he tossed it with rib-cracking
  • 58. force against the nearest Arzunian. His nicked and blunted sword burst against a helmet, and he drew the other. The ship trembled, thutter of engines warming up, the eager promise of sky and stars and green Terra again. Get in! bawled Donovan. Get in! We'll hold them! He stood by Wocha as the last crewmen entered, stood barring the airlock with a wall of blood and iron. Through a blurring vision, he saw Valduma approach. She smiled at him, one slim hand running through the copper hair, the other held out in sign of peace. Tall and gracious and lovely beyond his knowing, she moved up toward Donovan, and her clear voice rang in his darkening mind. Basil—you, at least, could stay. You could guide us out to the stars. You go away, groaned Wocha. The devil's rage flamed in her face. She yelled, and a lance whistled from the sky and buried itself in the great breast. Wocha! yelled Donovan. The Donarrian snarled and snapped off the shaft that stood between his ribs. He whirled it over his head, and Valduma's green eyes widened in fear. Donovan! roared Wocha, and let it fly. It smashed home, and the Ansan dropped his sword and swayed on his feet. He couldn't look on the broken thing which had been Valduma. Boss, you go home now. Wocha laid him in the airlock and slammed the outer valve shut. Turning, he faced the Arzunians. He couldn't see very well—one eye was gone, and there was a ragged darkness before the other. The sword felt heavy in his hand. But— Hooo! he roared and charged them.
  • 59. He spitted one and trampled another and tossed a third into the air. Whirling, he clove a head and smashed a rib-case with his fist and chopped another across. His sword broke, and he grabbed two Arzunians and cracked their skulls together. They ran, then, turned and fled from him. And he stood watching them go and laughed. His laughter filled the city, rolling from its walls, drowning the whistle of the ship's takeoff and bringing blood to his lips. He wiped his mouth with the back of one hand, spat, and lay down. We're clear, Basil. Helena clung to him, shivering in his arms, and he didn't know if it was a laugh or a sob in her throat. We're away, safe, we'll carry word back to Sol and they'll clear the Black Nebula for good. Yeah. He rubbed his eyes. Though I doubt the Navy will find anything. If those Arzunians have any sense, they'll project to various fringe planets, scatter, and try to pass as harmless humanoids. But it doesn't matter, I suppose. Their power is broken. And we'll go back to your home, Basil, and bring Ansa and Terra together and have a dozen children and— He nodded. Sure. Sure. But he wouldn't forget. In the winter nights, when the stars were sharp and cold in a sky of ringing crystal black, he would—go out and watch them? Or pull his roof over him and wait for dawn? He didn't know yet. Still—even if this was a long ways from being the best of all possible universes, it had enough in it to make a man glad of his day. He whistled softly, feeling the words run through his head: Lift your glasses high, kiss the girls good-bye, (Live well, my friend, live well, live you well) for we're riding,
  • 60. for we're riding for we're riding out to Terran sky! Terran sky! Terran sky! The thought came all at once that it could be a song of comradeship, too.
  • 61. *** END OF THE PROJECT GUTENBERG EBOOK SARGASSO OF LOST STARSHIPS *** Updated editions will replace the previous one—the old editions will be renamed. Creating the works from print editions not protected by U.S. copyright law means that no one owns a United States copyright in these works, so the Foundation (and you!) can copy and distribute it in the United States without permission and without paying copyright royalties. Special rules, set forth in the General Terms of Use part of this license, apply to copying and distributing Project Gutenberg™ electronic works to protect the PROJECT GUTENBERG™ concept and trademark. Project Gutenberg is a registered trademark, and may not be used if you charge for an eBook, except by following the terms of the trademark license, including paying royalties for use of the Project Gutenberg trademark. If you do not charge anything for copies of this eBook, complying with the trademark license is very easy. You may use this eBook for nearly any purpose such as creation of derivative works, reports, performances and research. Project Gutenberg eBooks may be modified and printed and given away—you may do practically ANYTHING in the United States with eBooks not protected by U.S. copyright law. Redistribution is subject to the trademark license, especially commercial redistribution. START: FULL LICENSE
  • 62. THE FULL PROJECT GUTENBERG LICENSE
  • 63. PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK To protect the Project Gutenberg™ mission of promoting the free distribution of electronic works, by using or distributing this work (or any other work associated in any way with the phrase “Project Gutenberg”), you agree to comply with all the terms of the Full Project Gutenberg™ License available with this file or online at www.gutenberg.org/license. Section 1. General Terms of Use and Redistributing Project Gutenberg™ electronic works 1.A. By reading or using any part of this Project Gutenberg™ electronic work, you indicate that you have read, understand, agree to and accept all the terms of this license and intellectual property (trademark/copyright) agreement. If you do not agree to abide by all the terms of this agreement, you must cease using and return or destroy all copies of Project Gutenberg™ electronic works in your possession. If you paid a fee for obtaining a copy of or access to a Project Gutenberg™ electronic work and you do not agree to be bound by the terms of this agreement, you may obtain a refund from the person or entity to whom you paid the fee as set forth in paragraph 1.E.8. 1.B. “Project Gutenberg” is a registered trademark. It may only be used on or associated in any way with an electronic work by people who agree to be bound by the terms of this agreement. There are a few things that you can do with most Project Gutenberg™ electronic works even without complying with the full terms of this agreement. See paragraph 1.C below. There are a lot of things you can do with Project Gutenberg™ electronic works if you follow the terms of this agreement and help preserve free future access to Project Gutenberg™ electronic works. See paragraph 1.E below.
  • 64. 1.C. The Project Gutenberg Literary Archive Foundation (“the Foundation” or PGLAF), owns a compilation copyright in the collection of Project Gutenberg™ electronic works. Nearly all the individual works in the collection are in the public domain in the United States. If an individual work is unprotected by copyright law in the United States and you are located in the United States, we do not claim a right to prevent you from copying, distributing, performing, displaying or creating derivative works based on the work as long as all references to Project Gutenberg are removed. Of course, we hope that you will support the Project Gutenberg™ mission of promoting free access to electronic works by freely sharing Project Gutenberg™ works in compliance with the terms of this agreement for keeping the Project Gutenberg™ name associated with the work. You can easily comply with the terms of this agreement by keeping this work in the same format with its attached full Project Gutenberg™ License when you share it without charge with others. 1.D. The copyright laws of the place where you are located also govern what you can do with this work. Copyright laws in most countries are in a constant state of change. If you are outside the United States, check the laws of your country in addition to the terms of this agreement before downloading, copying, displaying, performing, distributing or creating derivative works based on this work or any other Project Gutenberg™ work. The Foundation makes no representations concerning the copyright status of any work in any country other than the United States. 1.E. Unless you have removed all references to Project Gutenberg: 1.E.1. The following sentence, with active links to, or other immediate access to, the full Project Gutenberg™ License must appear prominently whenever any copy of a Project Gutenberg™ work (any work on which the phrase “Project
  • 65. Gutenberg” appears, or with which the phrase “Project Gutenberg” is associated) is accessed, displayed, performed, viewed, copied or distributed: This eBook is for the use of anyone anywhere in the United States and most other parts of the world at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this eBook or online at www.gutenberg.org. If you are not located in the United States, you will have to check the laws of the country where you are located before using this eBook. 1.E.2. If an individual Project Gutenberg™ electronic work is derived from texts not protected by U.S. copyright law (does not contain a notice indicating that it is posted with permission of the copyright holder), the work can be copied and distributed to anyone in the United States without paying any fees or charges. If you are redistributing or providing access to a work with the phrase “Project Gutenberg” associated with or appearing on the work, you must comply either with the requirements of paragraphs 1.E.1 through 1.E.7 or obtain permission for the use of the work and the Project Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9. 1.E.3. If an individual Project Gutenberg™ electronic work is posted with the permission of the copyright holder, your use and distribution must comply with both paragraphs 1.E.1 through 1.E.7 and any additional terms imposed by the copyright holder. Additional terms will be linked to the Project Gutenberg™ License for all works posted with the permission of the copyright holder found at the beginning of this work. 1.E.4. Do not unlink or detach or remove the full Project Gutenberg™ License terms from this work, or any files
  • 66. containing a part of this work or any other work associated with Project Gutenberg™. 1.E.5. Do not copy, display, perform, distribute or redistribute this electronic work, or any part of this electronic work, without prominently displaying the sentence set forth in paragraph 1.E.1 with active links or immediate access to the full terms of the Project Gutenberg™ License. 1.E.6. You may convert to and distribute this work in any binary, compressed, marked up, nonproprietary or proprietary form, including any word processing or hypertext form. However, if you provide access to or distribute copies of a Project Gutenberg™ work in a format other than “Plain Vanilla ASCII” or other format used in the official version posted on the official Project Gutenberg™ website (www.gutenberg.org), you must, at no additional cost, fee or expense to the user, provide a copy, a means of exporting a copy, or a means of obtaining a copy upon request, of the work in its original “Plain Vanilla ASCII” or other form. Any alternate format must include the full Project Gutenberg™ License as specified in paragraph 1.E.1. 1.E.7. Do not charge a fee for access to, viewing, displaying, performing, copying or distributing any Project Gutenberg™ works unless you comply with paragraph 1.E.8 or 1.E.9. 1.E.8. You may charge a reasonable fee for copies of or providing access to or distributing Project Gutenberg™ electronic works provided that: • You pay a royalty fee of 20% of the gross profits you derive from the use of Project Gutenberg™ works calculated using the method you already use to calculate your applicable taxes. The fee is owed to the owner of the Project Gutenberg™ trademark, but he has agreed to donate royalties under this paragraph to the Project Gutenberg Literary Archive Foundation. Royalty
  • 67. payments must be paid within 60 days following each date on which you prepare (or are legally required to prepare) your periodic tax returns. Royalty payments should be clearly marked as such and sent to the Project Gutenberg Literary Archive Foundation at the address specified in Section 4, “Information about donations to the Project Gutenberg Literary Archive Foundation.” • You provide a full refund of any money paid by a user who notifies you in writing (or by e-mail) within 30 days of receipt that s/he does not agree to the terms of the full Project Gutenberg™ License. You must require such a user to return or destroy all copies of the works possessed in a physical medium and discontinue all use of and all access to other copies of Project Gutenberg™ works. • You provide, in accordance with paragraph 1.F.3, a full refund of any money paid for a work or a replacement copy, if a defect in the electronic work is discovered and reported to you within 90 days of receipt of the work. • You comply with all other terms of this agreement for free distribution of Project Gutenberg™ works. 1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™ electronic work or group of works on different terms than are set forth in this agreement, you must obtain permission in writing from the Project Gutenberg Literary Archive Foundation, the manager of the Project Gutenberg™ trademark. Contact the Foundation as set forth in Section 3 below. 1.F. 1.F.1. Project Gutenberg volunteers and employees expend considerable effort to identify, do copyright research on, transcribe and proofread works not protected by U.S. copyright
  • 68. law in creating the Project Gutenberg™ collection. Despite these efforts, Project Gutenberg™ electronic works, and the medium on which they may be stored, may contain “Defects,” such as, but not limited to, incomplete, inaccurate or corrupt data, transcription errors, a copyright or other intellectual property infringement, a defective or damaged disk or other medium, a computer virus, or computer codes that damage or cannot be read by your equipment. 1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for the “Right of Replacement or Refund” described in paragraph 1.F.3, the Project Gutenberg Literary Archive Foundation, the owner of the Project Gutenberg™ trademark, and any other party distributing a Project Gutenberg™ electronic work under this agreement, disclaim all liability to you for damages, costs and expenses, including legal fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE. 1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you discover a defect in this electronic work within 90 days of receiving it, you can receive a refund of the money (if any) you paid for it by sending a written explanation to the person you received the work from. If you received the work on a physical medium, you must return the medium with your written explanation. The person or entity that provided you with the defective work may elect to provide a replacement copy in lieu of a refund. If you received the work electronically, the person or entity providing it to you may choose to give you a second opportunity to receive the work electronically in lieu of a refund.
  • 69. If the second copy is also defective, you may demand a refund in writing without further opportunities to fix the problem. 1.F.4. Except for the limited right of replacement or refund set forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PURPOSE. 1.F.5. Some states do not allow disclaimers of certain implied warranties or the exclusion or limitation of certain types of damages. If any disclaimer or limitation set forth in this agreement violates the law of the state applicable to this agreement, the agreement shall be interpreted to make the maximum disclaimer or limitation permitted by the applicable state law. The invalidity or unenforceability of any provision of this agreement shall not void the remaining provisions. 1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation, the trademark owner, any agent or employee of the Foundation, anyone providing copies of Project Gutenberg™ electronic works in accordance with this agreement, and any volunteers associated with the production, promotion and distribution of Project Gutenberg™ electronic works, harmless from all liability, costs and expenses, including legal fees, that arise directly or indirectly from any of the following which you do or cause to occur: (a) distribution of this or any Project Gutenberg™ work, (b) alteration, modification, or additions or deletions to any Project Gutenberg™ work, and (c) any Defect you cause. Section 2. Information about the Mission of Project Gutenberg™
  • 70. Project Gutenberg™ is synonymous with the free distribution of electronic works in formats readable by the widest variety of computers including obsolete, old, middle-aged and new computers. It exists because of the efforts of hundreds of volunteers and donations from people in all walks of life. Volunteers and financial support to provide volunteers with the assistance they need are critical to reaching Project Gutenberg™’s goals and ensuring that the Project Gutenberg™ collection will remain freely available for generations to come. In 2001, the Project Gutenberg Literary Archive Foundation was created to provide a secure and permanent future for Project Gutenberg™ and future generations. To learn more about the Project Gutenberg Literary Archive Foundation and how your efforts and donations can help, see Sections 3 and 4 and the Foundation information page at www.gutenberg.org. Section 3. Information about the Project Gutenberg Literary Archive Foundation The Project Gutenberg Literary Archive Foundation is a non- profit 501(c)(3) educational corporation organized under the laws of the state of Mississippi and granted tax exempt status by the Internal Revenue Service. The Foundation’s EIN or federal tax identification number is 64-6221541. Contributions to the Project Gutenberg Literary Archive Foundation are tax deductible to the full extent permitted by U.S. federal laws and your state’s laws. The Foundation’s business office is located at 809 North 1500 West, Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up to date contact information can be found at the Foundation’s website and official page at www.gutenberg.org/contact
  • 71. Section 4. Information about Donations to the Project Gutenberg Literary Archive Foundation Project Gutenberg™ depends upon and cannot survive without widespread public support and donations to carry out its mission of increasing the number of public domain and licensed works that can be freely distributed in machine-readable form accessible by the widest array of equipment including outdated equipment. Many small donations ($1 to $5,000) are particularly important to maintaining tax exempt status with the IRS. The Foundation is committed to complying with the laws regulating charities and charitable donations in all 50 states of the United States. Compliance requirements are not uniform and it takes a considerable effort, much paperwork and many fees to meet and keep up with these requirements. We do not solicit donations in locations where we have not received written confirmation of compliance. To SEND DONATIONS or determine the status of compliance for any particular state visit www.gutenberg.org/donate. While we cannot and do not solicit contributions from states where we have not met the solicitation requirements, we know of no prohibition against accepting unsolicited donations from donors in such states who approach us with offers to donate. International donations are gratefully accepted, but we cannot make any statements concerning tax treatment of donations received from outside the United States. U.S. laws alone swamp our small staff. Please check the Project Gutenberg web pages for current donation methods and addresses. Donations are accepted in a number of other ways including checks, online payments and
  • 72. credit card donations. To donate, please visit: www.gutenberg.org/donate. Section 5. General Information About Project Gutenberg™ electronic works Professor Michael S. Hart was the originator of the Project Gutenberg™ concept of a library of electronic works that could be freely shared with anyone. For forty years, he produced and distributed Project Gutenberg™ eBooks with only a loose network of volunteer support. Project Gutenberg™ eBooks are often created from several printed editions, all of which are confirmed as not protected by copyright in the U.S. unless a copyright notice is included. Thus, we do not necessarily keep eBooks in compliance with any particular paper edition. Most people start at our website which has the main PG search facility: www.gutenberg.org. This website includes information about Project Gutenberg™, including how to make donations to the Project Gutenberg Literary Archive Foundation, how to help produce our new eBooks, and how to subscribe to our email newsletter to hear about new eBooks.
  • 73. Welcome to our website – the ideal destination for book lovers and knowledge seekers. With a mission to inspire endlessly, we offer a vast collection of books, ranging from classic literary works to specialized publications, self-development books, and children's literature. Each book is a new journey of discovery, expanding knowledge and enriching the soul of the reade Our website is not just a platform for buying books, but a bridge connecting readers to the timeless values of culture and wisdom. With an elegant, user-friendly interface and an intelligent search system, we are committed to providing a quick and convenient shopping experience. Additionally, our special promotions and home delivery services ensure that you save time and fully enjoy the joy of reading. Let us accompany you on the journey of exploring knowledge and personal growth! ebookgate.com