100% found this document useful (2 votes)
13 views

Download complete Embedded Linux Hardware Software and Interfacing R Hardware Software and Interfacing Hollabaugh ebook PDF file all chapters

The document provides links to download various ebooks related to embedded Linux and hardware interfacing, including titles by authors such as Craig Hollabaugh and Han-Way Huang. It includes information on the contents of the book 'Embedded Linux: Hardware, Software, and Interfacing' and outlines its structure, covering topics from system architecture to interfacing techniques. Additionally, it mentions the availability of other related ebooks on the same platform.

Uploaded by

murfzdzis
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
13 views

Download complete Embedded Linux Hardware Software and Interfacing R Hardware Software and Interfacing Hollabaugh ebook PDF file all chapters

The document provides links to download various ebooks related to embedded Linux and hardware interfacing, including titles by authors such as Craig Hollabaugh and Han-Way Huang. It includes information on the contents of the book 'Embedded Linux: Hardware, Software, and Interfacing' and outlines its structure, covering topics from system architecture to interfacing techniques. Additionally, it mentions the availability of other related ebooks on the same platform.

Uploaded by

murfzdzis
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 82

Visit https://ebookultra.

com to download the full version and


explore more ebooks

Embedded Linux Hardware Software and Interfacing


R Hardware Software and Interfacing Hollabaugh

_____ Click the link below to download _____


https://ebookultra.com/download/embedded-linux-
hardware-software-and-interfacing-r-hardware-software-
and-interfacing-hollabaugh/

Explore and download more ebooks at ebookultra.com


Here are some suggested products you might be interested in.
Click the link to download

PIC microcontroller an introduction to software and


hardware interfacing 1st Edition Han-Way Huang

https://ebookultra.com/download/pic-microcontroller-an-introduction-
to-software-and-hardware-interfacing-1st-edition-han-way-huang/

The Lab Manual to Accompany The 8088 and 8086


Microprocessors Programming Interfacing Software Hardware
and Applications 4th Edition Walter A. Triebel
https://ebookultra.com/download/the-lab-manual-to-accompany-
the-8088-and-8086-microprocessors-programming-interfacing-software-
hardware-and-applications-4th-edition-walter-a-triebel/

Energy Efficient Hardware Software Co Synthesis Using


Reconfigurable Hardware 1st Edition Jingzhao Ou

https://ebookultra.com/download/energy-efficient-hardware-software-co-
synthesis-using-reconfigurable-hardware-1st-edition-jingzhao-ou/

Hardware and computer organization the software


perspective Arnold S. Berger

https://ebookultra.com/download/hardware-and-computer-organization-
the-software-perspective-arnold-s-berger/
Make Arduino Bots and Gadgets Six Embedded Projects with
Open Source Hardware and Software 1st Edition Tero
Karvinen
https://ebookultra.com/download/make-arduino-bots-and-gadgets-six-
embedded-projects-with-open-source-hardware-and-software-1st-edition-
tero-karvinen/

Dedicated Digital Processors Methods in Hardware Software


Co Design 1st Edition F. Mayer-Lindenberg

https://ebookultra.com/download/dedicated-digital-processors-methods-
in-hardware-software-co-design-1st-edition-f-mayer-lindenberg/

Analog Interfacing to Embedded Microprocessor Systems 2nd


ed Edition Stuart Ball

https://ebookultra.com/download/analog-interfacing-to-embedded-
microprocessor-systems-2nd-ed-edition-stuart-ball/

So You Wanna Be an Embedded Engineer The Guide to Embedded


Engineering From Consultancy to the Corporate Ladder 1st
Edition Lewin Edwards Lewin Edwards Is An Embedded
Engineer With Over 15 Years Experience Designing Embedded
https://ebookultra.com/download/so-you-wanna-be-an-embedded-engineer-
Systems Hardware Firmware And Control Software
the-guide-to-embedded-engineering-from-consultancy-to-the-corporate-
ladder-1st-edition-lewin-edwards-lewin-edwards-is-an-embedded-
engineer-with-over-15-years-exper/

Debugging The Nine Indispensable Rules for Finding Even


the Most Elusive Software and Hardware Problems 1st
Edition David J. Agans
https://ebookultra.com/download/debugging-the-nine-indispensable-
rules-for-finding-even-the-most-elusive-software-and-hardware-
problems-1st-edition-david-j-agans/
Embedded Linux Hardware Software and Interfacing R
Hardware Software and Interfacing Hollabaugh Digital
Instant Download
Author(s): Hollabaugh, Craig
ISBN(s): 9780672322266, 0672322269
Edition: Nachdr.
File Details: PDF, 2.04 MB
Year: 2002
Language: english
Craig Hollabaugh, Ph.D.

Embedded
Linux:
Hardware,
Software, and
Interfacing

Boston • San Francisco • New York • Toronto • Montreal


London • Munich • Paris • Madrid
Capetown • Sydney • Tokyo • Singapore • Mexico City
Embedded Linux: Hardware, Software, and Associate Publisher
Jeff Koch
Interfacing
Many of the designations used by manufacturers and sellers to Acquisitions Editor
distinguish their products are claimed as trademarks. Where those Katie Purdum
designations appear in this book, and Addison-Wesley were aware
of a trademark claim, the designations have been printed in initial Development Editor
capital letters or in all capitals. Mark Cierzniak

The author and publisher have taken care in the preparation of Managing Editor
this book, but make no expressed or implied warranty of any kind Matt Purcell
and assume no responsibility for errors or omissions. No liability is
Project Editor
assumed for incidental or consequential damages in connection
Andrew Beaster
with or arising out of the use of the information or programs
contained herein.
Copy Editor
The publisher offers discounts on this book when ordered in quan- Kitty Wilson Jarrett
tity for special sales.
Indexer
For more information, please contact: Ken Johnson

Pearson Education Corporate Sales Division Proofreader


Juli Cook
201 W. 103rd Street

Indianapolis, IN 46290 Technical Editor


Rob Savoye
(800) 428-5331
Team Coordinator
corpsales@pearsoned.com
Denni Bannister
Visit AW on the Web: www.awl.com/cseng/
Interior Designer
Copyright © 2002 by Pearson Education Anne Jones

All rights reserved. No part of this publication may be reproduced, Cover Designer
stored in a retrieval system, or transmitted, in any form or by any Aren Howell
means, electronic, mechanical, photocopying, recording, or other-
wise, without the prior consent of the publisher. Printed in the Page Layout
United States of America. Published simultaneously in Canada. Mark Walchle
Ayanna Lacey
ISBN 0-672-32226-9
Michelle Mitchell
Library of Congress Catalog Card Number 2001089582

Text printed on recycled paper

1 2 3 4 5 6 7 8 9 10—CRS—05 04 03 02

First printing, March 2002


Contents at a Glance

Introduction .................................................................................................1

Part I Getting Started


1 Introducing Embedded Linux .....................................................................7
2 System Architecture ...................................................................................13
3 Selecting a Platform and Installing Tool Sets ...........................................21
4 Booting Linux ............................................................................................65
5 Debugging.................................................................................................121

Part II Interfacing
6 Asynchronous Serial Communication Interfacing .................................141
7 Parallel Port Interfacing............................................................................161
8 USB Interfacing .........................................................................................205
9 Memory I/O Interfacing ...........................................................................227
10 Synchronous Serial Communication Interfacing ...................................277
11 Using Interrupts for Timing .....................................................................321
12 System Integration ..................................................................................367
13 Final Thoughts..........................................................................................399
Index .........................................................................................................405
Table of Contents

Introduction 1

Part 1 Getting Started 5

1 Introducing Embedded Linux 7


Why Linux, Why Now? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
What Is an Embedded System? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
What Does Real-Time Mean? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Implications of Open Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Additional Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2 System Architecture 13
Introducing Project Trailblazer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
The Silverjack Resort Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Project Trailblazer Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Safety Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Operations Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Supplier Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
The Project Trailblazer System Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

3 Selecting a Platform and Installing Tool Sets 21


Sources of Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
The Project Trailblazer Strategic Direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Building tbdev1, the Embedded Linux Development Workstation . . . . . . . 24
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Installing the Linux Operating System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Installing the Native GNU Tool Chain and Other Applications . . . . 33
Building the GNU Tool Chain for Cross-Compiling . . . . . . . . . . . . . . . . . . . 33
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Additional Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
4 Booting Linux 65
The Target PBRs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
The Linux Boot Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
The Linux root Filesystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Required Files for init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Required Files for bash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
The root Filesystem Binary Files: Compile or Download? . . . . . . . . . . . 72
Creating the root Filesystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Deciding Which Package to Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
The Process for Building the root Filesystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Running buildrootfilesystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Installing the TFTP Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Installing minicom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Booting the Embedded Planet RPX-CLLF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Embedded Planet RPX-CLLF Target PBR Review . . . . . . . . . . . . . . . . . . . . . . 100
Booting the Brightstar Engineering MediaEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Brightstar Engineering MediaEngine Target PBR Review . . . . . . . . . . . . 106
Booting the Tri-M MZ104 and the COTS PC with a Flash IDE Drive . . . 109
Flash IDE Technology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Preparing the Tri-M MZ104 and the COTS PC . . . . . . . . . . . . . . . . . . . . . . . . . 109
Booting the Tri-M MZ104 Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Tri-M MZ104 Target Platform Boot Requirements Review . . . . . . . . . . 116
Boot Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Additional Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

5 Debugging 121
Introducing gdb . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Local Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Remote Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Network-Mounting the root Filesystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Configuring the NFS Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Configuring the Target Kernels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Additional Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
vi Embedded Linux: Hardware, Software, and Interfacing

Part II Interfacing 139

6 Asynchronous Serial Communication Interfacing 141


The Project Trailblazer Asynchronous Serial Hardware
Development Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Target EIA/TIA-232-E Compliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Linux Serial Communications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Setting the Serial Port Control Signals with setSerialSignal . . . . 144
Reading the Serial Port Control Signals with getSerialSignal . . 148
Providing Serial Communication for bash Scripts, Using
querySerial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Additional Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159

7 Parallel Port Interfacing 161


Control Using the Parallel Port . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Standard Parallel Port Control with Port I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
Monitoring Lift Operation Using Port I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Snow-Making Control Using Port I/O . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Standard Parallel Port Control Using ppdev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Developing a Custom Device Driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Understanding helloworld_proc_module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Compiling, Inserting, and Testing helloworld_proc_module
on the MediaEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Standard Parallel Port Control Using the Custom Device Driver
liftmon_snowcon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Enhancements to helloworld_proc_module to Create
liftmon_snowcon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Compiling, Inserting, and Testing liftmon_snowcon on
the MZ104 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Additional Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204

8 USB Interfacing 205


Learning About USB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Project Trailblazer USB Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
USB Audio: Yamaha YST-MS35D USB Speakers . . . . . . . . . . . . . . . . . . . . . . . . 208
USB Image Capture: Kensington VideoCAM Super-VGA
PC Camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
USB Mass Storage: SanDisk USB SmartMedia Card Reader . . . . . . . . . 220
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Additional Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Contents vii

9 Memory I/O Interfacing 227


The Hardware Design Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Developing Lift Monitoring and Snow-Making Control for the
MediaEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Designing the External Interface Hardware for the
MediaEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Finding Space in the Memory Map for the MediaEngine . . . . . . . . . . 232
Finding the Register Base Address for the MediaEngine . . . . . . . . . . . . 232
Configuring the Memory Controller for the MediaEngine . . . . . . . . . 232
Assigning the Output Module Enable Signal for the
MediaEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Configuring the I/O Port Controller for the MediaEngine . . . . . . . . . 233
Writing the helloworldbit Testing Device Driver for the
MediaEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Writing the liftmon_snowcon Device Driver for the
MediaEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Developing Lift Monitoring and Snow-Making Control for the
RPX-CLLF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Designing the External Interface Hardware for the RPX-CLLF . . . . 252
Finding Space in the Memory Map for the RPX-CLLF . . . . . . . . . . . . . . . 253
Finding the Register Base Address for the RPX-CLLF . . . . . . . . . . . . . . . . 255
Configuring the Memory Controller for the RPX-CLLF . . . . . . . . . . . . . 255
Assigning the Output Module Enable Signal for the
RPX-CLLF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Configuring the I/O Port Controller for the RPX-CLLF . . . . . . . . . . . . . 257
Writing the helloworldbit Testing Device Driver for the
RPX-CLLF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Writing the liftmon_snowcon Device Driver for the
RPX-CLLF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Additional Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275

10 Synchronous Serial Communication Interfacing 277


Temperature Sensing and Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
SPI Communication and the LM70 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Connecting the LM70 to the x86 Parallel Printer Port . . . . . . . . . . . . . . 280
Connecting the LM70 to the MediaEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
I2C Communication with the Philips Semiconductor SAA1064 . . . . . . . . . 298
Connecting the SAA1064 to the x86 Parallel Printer Port . . . . . . . . . . 299
Connecting the SAA1064 to the RPX-CLLF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Additional Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
viii Embedded Linux: Hardware, Software, and Interfacing

11 Using Interrupts For Timing 321


Linux Timing Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
Measuring Interrupt Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Measuring Interrupt Latency on the MZ104 . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
Measuring Interrupt Latency on the MediaEngine . . . . . . . . . . . . . . . . . . . 331
Measuring Interrupt Latency on the RPX-CLLF . . . . . . . . . . . . . . . . . . . . . . . 339
Interrupt Latency Test Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
Implementing the Race Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Race Timer Interrupt Processing Using Tasklets . . . . . . . . . . . . . . . . . . . . . . . 349
Race Timer Status Display Using System Timers . . . . . . . . . . . . . . . . . . . . . . 350
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
Additional Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365

12 System Integration 367


Integration Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367
Installing the System Integration Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
Creating and Testing the Project Trailblazer Database . . . . . . . . . . . . . . . . . . . . . . . 373
Developing the Target and CGI Integration Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . 378
Collecting and Distributing Temperature Data . . . . . . . . . . . . . . . . . . . . . . . . 378
Collecting and Distributing Image Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Collecting Guest Pass Identification and Allowing Lift Access . . . . 392
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Additional Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397

13 Final Thoughts 399


GUI Development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Real-time Capabilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
The Embedded Linux Vendor Offerings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Project Trailblazer Hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Additional Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403

Index 405
Foreword

Embedded systems, the once-sleepy backwater of information technology, are now


emerging as a multibillion-dollar industry that is already pervading our everyday
existences and changing our lives. Around the world, “smart devices” are insinuating
themselves into everyone’s daily routine: You drive to work in your electronically
controlled car or ride a digitally guided commuter train, take a call on your mobile
phone, make copies at the office, sit in on a digital conference call, and then go
home and watch a movie from your cable box or DVD player. If you look around
you, you’ll realize that 50 to 100 embedded computers touch your life every day.

Linux is taking this world of embedded and pervasive computing by storm. Once
dominated by proprietary and obscure operating systems, tools, and applications,
embedded designs today benefit from the transparency and functionality of open-
source software, especially Linux. Even conservative estimates show embedded Linux
garnering up to half of all new embedded designs by the end of 2002.

In my role at MontaVista Software, I have the pleasure of talking to thousands of


embedded developers and of sneaking glimpses into their varied projects. In this
context I first met Dr. Craig Hollabaugh at LinuxWorld in New York in 2001. In the
course of his writing this book, I had the pleasure of his company several more times
and numerous chats by phone.

I find Craig’s approach both sensible and comprehensive. His choice of an applica-
tion to run the fabled Silverjack winter resort both recalls the “meat and potatoes” of
the embedded applications space (control and instrumentation) and launches into
today’s hot new areas of pervasive computing (embedded Web interfacing, multi-
media, and messaging). His survey of available embedded hardware and key interface
technologies and his step-by-step account of the embedded Linux development
process provide invaluable signposts for aspiring system designers.

Craig’s team of trailblazing engineers confronted the daunting task of acquiring and
using embedded Linux development tools and deployment components. The
Silverjack scenario and the details of the engineering effort mirror the experiences of
many developers facing their first embedded Linux project. The slope is steep, but
the rewards are very great. Books like Embedded Linux; organizations like the
Embedded Linux Consortium, EMBLIX, and LinuxDevices; and the efforts of embed-
ded Linux platform vendors clear a path to successful development and deployment
of the next generation of smart, Linux-based devices.

William Weinberg
Director of Strategic Marketing/Embedded Linux Evangelist
MontaVista Software
San Jose, CA
January 2002
About the Author

Craig Hollabaugh has been fascinated by electronics since he bought an AM radio


in elementary school. He was first exposed to Unix during a cross-country talk
session in 1985. Later, he administered networked Sun and DEC workstations while
pursuing a doctoral degree in electrical engineering at Georgia Institute of
Technology.

Craig’s first embedded SCADA (supervisory control and data acquisition) design, the
PacMeister, remotely monitored the gasoline additive injection process and earned
him a U.S. patent. His next embedded design, the Titan PAC-3, based on Intel x86
architecture, controlled this injection process, using a home-growth multitasking
operating system written in C++, complete with boot code, communications ability,
and field-downloadable application code.

In 1995 Craig co-founded Wireless Scientific, where he developed 20 spread-


spectrum 900MHz ISM industrial telemetry products. Craig worked with more than
200 developers, systems integrators, and equipment manufacturers to incorporate
wireless telemetry within their SCADA applications or product lines. In 1996
Wireless Scientific’s Global Data Management project used Linux as a development
platform to remotely monitor and control additive tank levels.

In 1997 Lanier Corporation charged Craig with architecting its next-generation


VoiceWriter, a medical digital dictation and transcription system with revenues
beyond $100 million. His responsibilities included ensuring that product develop-
ment followed current/future technological trends, adhered to technical/medical
information standards, and incorporated Lanier’s legacy products.

Craig consults from his home in Ouray, Colorado. He developed the firmware for
Antec’s flagship cable distribution product, the Proteus Scalable Node. At Clifton,
Weiss and Associates, Craig is a member of a carrier-class telecommunications
network design team. His current responsibilities involve designing and analyzing
wired and wireless voice and data networks for Dallas Area Rapid Transit, Metro
North Railroad, New York City Transit, and Pittsburgh Area Transit. He’s also design-
ing FM, MP3, and Bluetooth headset electronics for Arriva.

The Ouray community benefits through Craig’s system administration support of


Ouraynet and his adult education classes in electronics and programming. Most
recently, Craig co-founded The Silverjack Baking Company, where he will bake and
sell scrumptious delights from a horse-drawn bakery wagon on Ouray’s Main Street
during the summer months. If there’s snow flying, you’ll most likely find him snow-
boarding at Telluride.
Dedication

For my support staff, the Spuds: Kathy and Chris Anderson, Caela
and Steve Bova, Melanie and Scott Clemmons, Pam and Robert
Cort, Tina Dittmar, Jonathan Fulford, Tanya and Kevin Hansel,
Margaret Hollabaugh, Maureen and Steve Jett, Scott Kidner, Brian
Kopp, Teresa Loconte, Michelle and Brad Lohrding, Darla and
Alfred Lorber, Venita and Craig Lujan, Jean and John McLennan,
Marce Miller, Lisa and Jim Olwine, Katie Purdum, Anna and
Mike Sadler, Jennifer and Fritz Siegrist, Karen and John Totten,
Karyn Young, and especially Melanie Kline.
Acknowledgments

The enthusiasm toward this book has been simply phenomenal. Everyone I mention
it to has supported my efforts in some way. I’d like to start by thanking a few people
who helped me to see my greatness: Katie Purdum, Angelo d’Amelio, Roger Smith,
Gerri Spina, Eva Montibello, and Teresa Loconte. These day-to-day supporters then
took over and continued the push: Melanie Kline, Josh Kline, Mouse and Harry
Durgin, Paul Vallejos, Ben Blouse, Scott Kidner, Brian Kopp, and my little baby sister,
Karen Totten. I attribute the book’s readability to my editing team: John Hollabaugh,
Rob Savoye, Kitty Jarrett, and Mark Cierzniak. A special thanks to Rick Lehrbaum, for
his comprehensive embedded Linux Web site, linuxdevices.com. I want to thank
these individuals at companies that offered their products and technical support for
the book’s examples: Doug Stead at Tri-M Systems, Stuart Adams at Brightstar
Engineering, Ken Applebaum, John Havre, and Matt Hoover at Embedded Planet,
Eugene Feng at Silicon Storage Technology, Juan Vazquez at ESPTech, Tom Barnum
at VersaLogic, and Bill Weinburg at MontaVista Software. The work of these individ-
uals also contributed to the examples: Thomas Oehser, Erik Mouw, Ori Pomerantz,
Alessandro Rubini, Jonathan Corbet, Tim Waugh, Jan Axelson, Craig Peacock, Riku
Saikkonen, Jens Gecius, Detlef Fliegl, Brad Hards, Mark Pilon, Daniel Smolik, Markus
Schlup, Michael Hipp, David Beal, Wolfgang Denk, Mark Hatle, Dan Malek, Larry
Doolittle, and Jim Ready. These open-source developers deserve a tremendous
acknowledgement for their activities: all the kernel programmers, Debian, Apache
Software Foundation, MySQL, and GNU. This book exists because of your contribu-
tions, support, and encouragement. I thank you.
Introduction

This is an exciting time. The proliferation of Internet technology has transformed


our concept of information. 24 hours per day, people rely on network devices for
business and personal use. Over time, this dependence will grow further. Today’s
network devices, such as servers, routers, and desktop computers, form the Internet’s
infrastructure. Tomorrow’s devices will control your home’s temperature, maintain
inventory levels at your business, and monitor automobile traffic patterns. Only a
handful of the billions of processors produced each year go into desktop or server
computers. The remaining processors monitor and control other facets of the world.

Individuals and businesses want smart, network-connected, devices to improve their


lives, their efficiency, and their bottom dollar. These devices must be simple to
operate, reliable, and inexpensive. This is where Linux comes in. Advances in tech-
nology accompanied by competitive pricing allow Linux to move from the desktop
and server environment to embedded devices. Linux offers reliability, features, open-
source code, and a proven track record; these features make it perfectly suited for
embedded system designs. In this book, you will find information to create an
embedded Linux foundation. You can then extend this foundation in your own
designs.

Benefits of This Book


When I first started researching material for this book, I assumed that online embed-
ded Linux information was like other Linux information—plentiful and well docu-
mented. I quickly discovered that my assumption was wrong. I found embedded
Linux documentation to be sparse, scattered, incomplete, and sometimes dated. This
was discouraging and invigorating at the same time. Although I worried about being
able to find adequate information, I was further convinced of the need for this book.
People are designing embedded products with Linux, so the information and knowl-
edge are out there; it just hasn’t all been in one place until now.

As an instructor, I have determined that students best understand and retain theoret-
ical concepts and ideas when accompanied by examples. When students see a
concept in action—whether it is a robotic arm movement, a voltmeter reading, or an
oscilloscope waveform—they’re most likely to later apply that concept to solve their
own problems. That’s why this book is full of step-by-step examples. You will learn
through the example and be able to apply that knowledge to your own designs.
2 Embedded Linux: Hardware, Software, and Interfacing

What This Book Covers


This book includes a complete series of real-world interfacing examples designed to
introduce embedded Linux from hardware and software perspectives. After you
create an embedded Linux development environment, you will step through hard-
ware and software interfacing examples, using asynchronous serial communication,
the PC parallel port, USB, memory I/O, synchronous serial communication, and
interrupts. All interfacing examples are then tied together using system integration.
All this material is presented by using a winter resort automation project called
Project Trailblazer. You can find the book’s source code and scripts at www.
embeddedlinuxinterfacing.com.

The following text briefly summarizes each chapter.

Chapter 1, “Introducing Embedded Linux,” describes the brief history of Linux as an


embedded operating system and the implications of using open-source software in
product design.

Chapter 2, “System Architecture,” introduces a winter resort automation project


called Project Trailblazer and develops a series of project requirements. Project
Trailblazer and its requirements form the basis for the book’s interfacing examples.

Chapter 3, “Selecting a Platform and Installing Tool Sets,” describes the process of
platform selection. Four target boards—which use x86, StrongARM, and PowerPC
processors—are selected for Project Trailblazer. This chapter then describes the
creation of an embedded Linux development workstation called tbdev1. All the
development tools are either installed or compiled, including the cross-compiled tool
chain for the StrongARM and PowerPC processors.

Chapter 4, “Booting Linux,” describes the Linux boot process, from power-on to the
bash prompt. Using a minimum root filesystem, each target board is booted using
Linux version 2.4.

Chapter 5, “Debugging,” configures gdb and gdbserver for target board debugging
over the Ethernet network. A cross-compiled version of helloworld is remotely
executed and debugged.

Chapter 6, “Asynchronous Serial Communication Interfacing,” describes the Linux


serial port device driver for control of port signals and buffers. An RFID tag reader, an
LCD display, and control circuitry are interfaced to the Linux serial port.

Chapter 7, “Parallel Port Interfacing,” describes interfacing AC circuits to an x86


target board’s parallel printer port. A custom device driver called
helloworld_proc_module that uses a /proc directory entry is introduced.

Chapter 8, “USB Interfacing,” describes connecting a camera and speakers for visual
input and audio output to a target board’s USB port.
Introduction 3

Chapter 9, “Memory I/O Interfacing,” describes interfacing AC circuits to the


StrongARM and PowerPC target boards’ CPU buses.

Chapter 10, “Synchronous Serial Communication Interfacing,” describes SPI and I2C
connections and communications. A low-cost SPI temperature sensor and I2C LED
display driver are interfaced to the target boards.

Chapter 11, “Using Interrupts for Timing,” describes Linux timing sources and the
measurement of each target board’s average interrupt latency. An event timer with
1ms accuracy is developed to measure race times.

Chapter 12, “System Integration,” describes the creation of the Project Trailblazer
database. Target and server bash scripts are developed, using this database for collec-
tion and distribution of temperature, image, and authentication data.

Chapter 13, “Final Thoughts,” summarizes the interfacing projects and discusses
embedded Linux topics that are not addressed elsewhere in the book.

Who This Book Is For


If you are a hardware engineer, software developer, system integrator, or product
manager who’s begun exploring embedded Linux for interfacing applications, then
this book is for you. The book’s comprehensive interfacing examples are simple,
requiring only a basic understanding of digital logic design, C and bash program-
ming, and Linux system administration.

Conventions Used in This Book


This book uses several common conventions to help teach embedded Linux.

The typographical conventions used in this book include the following:

• Commands and computer output appear in a monospaced computer font.

• Commands you type appear in a boldfaced computer font.

• Italics are used to introduce you to new terms.

In addition to typographical conventions, this book includes tips, which look like
this:

TIP
Information that offers shortcuts and solutions to common problems is highlighted as a tip.
This page intentionally left blank
PART I
Getting Started

IN THIS PART
1 Introducing Embedded Linux

2 System Architecture

3 Selecting a Platform and Installing Tool Sets

4 Booting Linux

5 Debugging
This page intentionally left blank
1 IN THIS CHAPTER

• Why Linux, Why Now?


Introducing Embedded • What Is an Embedded

Linux System?

• What Does Real-Time Mean?

• Implications of Open Source


So you want to use Linux in your next embedded system • Additional Reading
design? Great! You’re not alone: Thousands of developers
worldwide are doing the same thing. Like you, they want
to take advantage of countless hours of code creation to
make their products reliable, feature packed, robust, and
quick to market. Embedded Linux—using Linux as an oper-
ating system in embedded devices—is now commonplace.
In 1999 not many developers considered Linux an option
for embedded designs. Today, however, Linux is well
poised to become the market leader for embedded operat-
ing systems.

In a couple years, it’s likely that a fair percentage of the


billions of processors produced every year will run Linux.
The massive Internet adoption of Linux, combined with
technology advances and price reductions in hardware
(CPUs) and memory (both flash and RAM), finally make
embedding Linux a viable option. Since 1999 use of
embedded Linux has gone from zero adoption to taking
second place, in terms of market share, behind Wind
1
River. Experts estimate that embedded Linux will take over
the number-one market share position by the end of
1
2002 . This is very interesting, considering that Linux actu-
ally started as student project so many years ago. Linux
can become number one, through the adoption of embed-
ded Linux for designs that become products.

Why Linux, Why Now?


Microprocessor industry advances form the foundation for
using Linux as an embedded operating system. Gone are
the days of embedded designs that use 4- or 8-bit micro-
processors; today it is just as easy and cost competitive to
8 CHAPTER 1 Introducing Embedded Linux

use 32-bit microprocessors with several megabytes of memory. The ever-changing


pace of hardware innovation and obsolescence presents an enormous development
challenge for real-time operating system (RTOS) vendors. With limited resources,
these RTOS vendors make business decisions that often leave many developers
unsupported. Developers always want the latest and greatest hardware and software
for their new embedded designs while also requiring high reliability. Desktop operat-
ing systems provide the latest in software but lack reliability and require more
memory and CPU resources. RTOS vendors offer reliability but struggle with software
development in the ever-changing world of technology. This is where Linux comes in.

Linux offers reliability and efficiency, with a proven track record. Open-source code
availability has spawned countless improvements, enhancements, and additions in
terms of performance, functionality, driver development, and porting activities.
Designers of embedded systems like open-source software because they often modify
subsystem code for their designs. Linux supports Portable Operations System
Interface (POSIX), which allows developers to easily port existing code. Linux is
successfully ported to several microprocessors, including x86, SPARC, ARM,
PowerPC, MIPS, and SuperH.

Initially, developers were apprehensive about considering Linux as an embedded


operating system option because of its distributed development approach and a
perceived lack of support structure. The support structure for embedded Linux has
changed dramatically since 1999, thanks largely to the Embedded Linux Consortium
(ELC), which was founded with 50 members in May 2000 and now has membership
exceeding 125 companies. This consortium works toward standardizing and promot-
ing Linux for use in embedded applications. In addition, several companies were
founded solely for embedded Linux. These companies don’t merely repackage distri-
butions and sell CDs. They have a wide range of embedded Linux products as well as
design and support services. Using embedded Linux, developers can design high-
reliability products, using the latest and greatest hardware and software.

What Is an Embedded System?


If you ask a dozen engineers to define embedded system, you’ll get a dozen different
answers. Most embedded systems perform specific tasks. Let’s assume that the
simplest embedded system contains input and output capability, as well as control
logic. This system performs some type of functionality, based on its configuration.
Using these criteria, a discrete logic circuit that contains a 74123 counter that imple-
ments control logic with a state machine could be considered an embedded system.
You might add that this system needs to be programmable, via software, and stored
in the system firmware. This new definition for an embedded system consists of
input/output (I/O) and control logic stored in system firmware. A desktop computer
What Does Real-Time Mean? 9

with a mouse, a keyboard, a network connection, and a multitasking operating


system running a graphical user interface (GUI) fulfills these requirements, but is it
considered an embedded system?

If you don’t consider a desktop machine an embedded system, then what about
handheld devices? They have I/O capability and can run control logic that’s stored in
firmware. Some say that desktop computers and handhelds are general-purpose
computing devices that are capable of running software to perform many different
tasks. An embedded system, on the other hand, is primarily designed for a specific
task—for example, a dishwasher controller or flight navigation system. This specific
functionality defines the sole purpose of the embedded design. If that’s the case, why
are some embedded systems designed with additional capability, such as program
storage in nonvolatile memory and the capability of running multitasking operating
systems that are capable of executing additional tasks beyond the original design?

In the past, it was much easier to distinguish an embedded system from a general-
purpose computer than it is today. For example, you can easily tell that an 8051-
based T1 framing card is an embedded system from a Sun Unix workstation. Today,
in terms of functionality, a Sun workstation is hard to distinguish from a set-top box
that contains a PowerPC with 32MB of memory and 16MB of Flash memory, that
runs a multitasking operating system to control a set-top box with a GUI, that is
field upgradable, that simultaneously runs multiple programs (such as a video
controller, a digital VCR, and the Java Virtual Machine), and that makes secure
Internet transactions. It’s hard to say whether this set-top box is an embedded
system. Clearly, the increase in hardware performance and the lower cost of that
hardware has blurred the line between general-purpose computers and embedded
systems. Technology advances have therefore made it hard to say what is embedded.

What Does Real-Time Mean?


If you ask engineers what real-time means, you’ll get a number of different answers,
filled with terms such as guarantees, hard, soft, deterministic, preemptive, priority inver-
sion, latency, interrupts, and scheduling. Rick Lehrbaum of linuxdevices.com posed
3
that question to seven experts. These experts somewhat agreed that a hard real-time
system guarantees a deterministic response to an event and that a late response is
considered a system failure. They also somewhat agreed that soft real-time systems
attempt to minimize event response time and don’t consider late responses a system
failure. The experts’ opinions diverged when addressing real-time implementation
and system performance characterization.
One performance aspect of Linux is clear: Stock Linux allows the kernel and device
4
drivers to disable interrupts. This could seriously affect a system’s responsiveness.
Fortunately, open-source code availability has allowed solutions to be developed to
10 CHAPTER 1 Introducing Embedded Linux

overcome this limitation. These solutions follow two approaches: Improve the Linux
scheduler by making the kernel preemptive and run Linux as a thread within a small
RTOS. Naturally, each approach has advantages, disadvantages, supporters, and
opponents.

Implications of Open Source


Open-source software—with its accessibility, reliability, and means of support—
clearly threaten the commercial software vendors who provide proprietary solutions.
Using Linux for embedded development threatens the future market share for
companies such as Microsoft and Wind River. It’s in their best business interests to
5,6
spread fear, uncertainty, and doubt within the embedded industry. For many years,
Microsoft didn’t consider Linux a threat in the desktop, server, or embedded arenas.
That situation has changed, as Microsoft has stated that Linux is now its number-
7
one target. Microsoft’s attention to Linux further enhances Linux’s position as a
viable option for embedded development. Many developers see open source as a
building block to create powerful products. Microsoft sees Linux as a threat to its
future dominance of the embedded operating systems.

Use of open-source software has specific implications. In the context of using Linux
for embedded design, open-source software has to do with a particular licensing
8
model called the General Public License (GPL). (The entire GPL is not covered here,
but we will address some GPL requirements that affect you and your embedded
Linux design.)

Linus Torvalds originally released the Linux kernel source under GPL. This means
that you are free to use and redistribute Linux without royalty or licensing fees, but
you must make the Linux source code available to your customers. You can’t sell
Linux, but you can sell any distribution media or enhancements that you develop.
For example, when you purchase a Red Hat Linux product, you aren’t buying Linux
from Red Hat; you’re buying Red Hat’s enhancements to Linux. Red Hat’s enhance-
ments include a program that simplifies the installation process and some other
goodies. GPL states that all “derived work” must also be released under GPL. This
means that if you modify some piece of Linux kernel code, your modification is also
covered under GPL. If you distribute a product based on your modified kernel code,
you must make available not only the original kernel source but also your modifica-
tions to it, in source form. At this point, you may be asking, “If I never touch the
kernel source code but just use Linux for a product, how does GPL affect me? Do I
really have to make my product available in source form?” The answer depends on
how your product is linked and what it is linked to.

Let’s assume, for example, that your embedded product contains a device driver or
kernel module that you developed. You have an option to include that device driver
in the kernel binary code at compile time or deploy the driver as a loadable module.
Summary 11

If you build and distribute a kernel that includes your device driver, then your device
driver code is automatically included under the GPL and you must make its source
code available to your customers. Device drivers or modules that load dynamically
after the kernel boot process are not included under the GPL, and you don’t have to
distribute your source code.

NOTE
Designing products with Linux and other open-source software doesn’t mean you have to
make your software open source. Use of loadable modules and LGPL libraries protects your
intellectual property.

If an embedded product executes solely in the user space (that is, it has no kernel
code or device drivers), it is not affected by the Linux kernel source code GPL. An
embedded product running an application in the user space can be affected through
linking to libraries that are included under the GPL or another licensing model,
called LGPL. Originally called the Library General Public License, LGPL now stands
for Lesser General Public License. This licensing model allows developers to link to
code, such as libraries, without having their code automatically included under the
9
GPL. GNU released glibc under LGPL. If an embedded application statically or
dynamically links to glibc for functionality, the application is not included under
the GPL or LGPL, and you do not have to release your source code.

Use of open-source software promotes creativity and allows developers to quickly


design embedded applications that are reliable and robust. Basing your embedded
design on open source software doesn’t automatically mean that you have to release
your intellectual property in source form. It’s quite possible that you can develop
device drivers and kernel modules that load after the kernel boot process and your
user space application code links to LGPL libraries.

Summary
Linux was created more than a decade ago. Since then, countless programmers have
enhanced it, given it more features, and made it efficient, reliable, and robust. Today,
thousands of businesses rely on Linux for daily client and server operations. Linux
has a proven track record. Commodity pricing of microprocessors and memory
devices will make future embedded designs using 32-bit architectures commonplace.
Linux is already ported to these architectures and embedded Linux products exist in
the marketplace. Embedded system designers adopting Linux enjoy open-source code
availability, POSIX compliance, solid reliability, a large application base, and no
licensing fees. These benefits, combined with commodity pricing, make Linux an
excellent solution for an embedded operating system.
12 CHAPTER 1 Introducing Embedded Linux

Additional Reading
1. “Developer interest in Embedded Linux skyrockets,” www.linuxdevices.com/
news/NS2083407450.html, 2001.

2. Fernando Ribeiro Corrêa, “Intelligent devices: A new arena for Linux,”


www.olinux.com.br/artigos/279/1.html, 2001.

3. Rick Lehrbaum, “Real-time Linux—What is it, why do you want it, how do you
do it?” www.linuxdevices.com/articles/AT9837719278.html, 2000.

4. Kevin Dankwardt, “Fundamentals of real-time Linux software design,”


www.linuxdevices.com/articles/AT5709748392.html, 2000.

5. Mike Downing, “Revision 3.0 of open-source GPL stirs concern in embedded


space,” http://icd.pennnet.com/Articles/Article_Display.
cfm?Section=Articles&Subsection=Display&ARTICLE_ID=92350&KEYWORD=down
ing, 2001.

6. Microsoft Corporation, “Prepared text of remarks by Craig Mundie, Microsoft


senior vice president: The commercial software model,” www.microsoft.com/
presspass/exec/craig/05-03sharedsource.asp, 2001.

7. Paula Rooney, “Ballmer: Linux is top threat to Windows,” www.techweb.com/


wire/story/TWB20010110S0006, 2001.

8. “GNU General Public License,” http://www.gnu.org/copyleft/gpl.html, 1991.

9. “GNU Lesser General Public License,” http://www.gnu.org/copyleft/


lesser.html, 1999.
2 IN THIS CHAPTER

• Introducing Project Trailblazer


System Architecture • The Silverjack Resort Layout

• Project Trailblazer
Requirements
A group of devices forming a network to distribute func- • The Project Trailblazer System
tionality that serve a common purpose defines a system.
The initial system design phase creates a framework called Architecture
the system architecture. The system architecture specifies, at
a block level, the system components and their intercon-
nection interfaces. Developers work within the system
architecture, which provides a structure and an overall
understanding of the project or product. System architec-
tures provide the big picture. Furthermore, a set of high-
level system requirements help to define the system
architecture. Also, a system architecture does not address
technical details of its blocks. Details, such as component
specification and selection, are determined during a block’s
design phase.

This chapter introduces Project Trailblazer, a winter resort


automation project. This project starts with the formation
of the high-level system requirements, which will develop
into a system architecture consisting of functional blocks
and their interfaces. This chapter does not address any
technical details concerning the functional block; it merely
defines the Project Trailblazer system architecture. This
book follows the Project Trailblazer development and the
design and implementation of its functional blocks using
embedded Linux.

Introducing Project Trailblazer


Silverjack Resort, located somewhere in the Rocky
Mountains, is booming with activity. Guests from around
the world travel to Silverjack to enjoy winter activities in a
scenic location. Thanks to abundant natural and manufac-
tured snow, the sporting season extends from November
through April. Silverjack’s 10 lifts offer guests access to a
14 CHAPTER 2 System Architecture

wide variety of terrain, whether they’re skiers, snowboarders, or snowshoers. All


these factors make Silverjack an attractive winter resort destination. Revenues have
continually increased since the initial opening season, making the board of directors
and investors happy. The forward-thinking Resort board members know that applica-
tion of technology can make the mountain safer, the operations more efficient, and
the guests’ experience more enjoyable. They know that cutting-edge technology can
help attract customers to Silverjack.

The board allocated funds for Project Trailblazer, which is a data acquisition and
control system serving all of the Silverjack Resort. The board wants this information
system to be reliable, robust, and low cost; to use off-the-shelf hardware; and to be
designed, deployed, and tested within six months.

The Silverjack Engineering Department, with input from the Operations


Department, developed a set of high-level requirements in three areas: safety, opera-
tions, and suppliers. These requirements don’t contain any specific technical details.
Rather, they offer guidelines to what needs to be developed. The board reviewed and
approved these high-level requirements. They gave the Engineering Department a
green light to start Project Trailblazer.

With great enthusiasm, the Engineering Department started designing Project


Trailblazer. It quickly discovered that Project Trailblazer was basically a giant integra-
tion project with a short development timeframe. The department needs a flexible
and reliable solution that connects serial, parallel, input/output (I/O) port, and
universal serial bus (USB) devices to the operations center. After the department
attended a conference on embedded systems, the answer was clear: It needed to use
embedded Linux.

The Silverjack Resort Layout


Silverjack Resort consists of 10 lifts serving three mountain peaks, a racecourse, and
an aerial acrobatic area called the AirPark. Snow-making equipment exists along Lifts
4, 5, and 10. Guests have access to Lifts 4, 7, and 10 from the village. The Operations
Control Center (OCC) in the village houses the Operations, Information Technology
(IT), and Engineering Departments. A hybrid fiber/copper network provides 10BaseT
connectivity to all resort areas and facilities. All networking and computer equip-
ment reside behind a firewall that uses private Class C addresses. The IT Department
allocated the private Class C subnet 192.168.2.0 for Project Trailblazer’s field equip-
ment.

Figure 2.1 shows Silverjack’s physical layout, which includes the OCC, 10 lifts, and
Project Trailblazer’s data acquisition and control electronics.
The Silverjack Resort Layout 15

S ilverjack Resort
Physical Layout
TI, VI
TI, VI

TI, VI
Lift 6
TI, VI
TI, VI
SM Lift 8

ourse
TI, TD, VI SM
GA, GM, LM

Race C
Lift 9 Lift 3
Lift 5
RT, RR TI, VI
TI, VI SM TI, TD, VI SM
TI, TD, VI
SM GA, GM, LM TI, VI GA, GM, LM SM
MP SM
TI, TD, VI TI, VI SM TI, TD, VI SM

Ai
GA, GM, LM TI, VI

r
GA, GM, LM

Pa
Lift 2

r
Lift 4

k
Lift 10
SM
Lift 1 TI, TD, VI
SM GA, GM, LM SM
Lift 7 SM
TI, TD, VI
TI, TD, VI GA, GM, LM SM
TI, TD, VI
Legend
GA, GM, LM
TI, TD, VI Village GA, GM, LM TI - Temperature Input
GA, GM, LM OCC MP,GM
TD - Temperature Display
VI - Visual Input
GA - Guest Authentication
GM - Guest Messaging
MP - Music Playback
SC - Snowmaking Control
LM - Lift Monitoring
RT - Race Timing
RR - Race Results

FIGURE 2.1 Silverjack’s physical layout.

Figure 2.2 shows the Silverjack network. This hybrid copper/fiber network provides
connectivity to the bottom and top of all lifts, the racecourse, the AirPark, and the
village. This network provides Project Trailblazer field equipment with full 10BaseT
connectivity and ample Internet Protocol (IP) address space.

Figure 2.3 details Silverjack’s OCC, which is located in the village. The Silverjack
router contains three interface cards that make connections to the Internet,
Trailblazer mountain equipment, the Silverjack server, and the Engineering
Department. The subnet and host addresses are shown in Figure 2.3.

You should examine these figures while reviewing the Project Trailblazer require-
ments in the following section.
16 CHAPTER 2 System Architecture

S ilverjack Resort
Data Network

Lift 6

Lift 8

ourse
Race C
Lift 9 Lift 3
Lift 5

Ai
r
Pa
Lift 4 Lift 2

r k
Lift 1 Lift 10

Lift 7

OCC
Village

FIGURE 2.2 Silverjack’s data network.

Operation Engineering tbdev1


Control 192.168.1.11
9600

Center
tbdevarm tbdevmz
9600

192.168.1.21 192.168.1.23
tbdevppc tbdevcots
192.168.1.22 192.168.1.24

IT Department SJ Server
192.168.1.1

Internet Mountain
SJ Firewall SJ Router
Connection Network
192.168.2.0

FIGURE 2.3 Silverjack’s OCC.

Project Trailblazer Requirements


Project Trailblazer’s high-level requirements are divided into three categories: safety,
operations, and suppliers. Each requirement discussed here has a short title, a narra-
tive describing the purpose of the requirement, and a reference to the chapter where
the requirement is implemented.
Project Trailblazer Requirements 17

TIP
Defining high-level requirements and then forming the project’s system architecture helps
developers and programmers understand the big picture. The requirements help answer the
why questions and the architecture answers how a project is connected together.

Safety Requirements
Safety is a prime concern at Silverjack. Quickly changing weather conditions could
pose a serious health threat to guests and employees. The mountain peaks’ tempera-
tures and visibilities always differ from those of the village. Project Trailblazer will
collect and display various resort temperatures and visibilities.

Safety Requirement 1: Temperature Information


The temperature differential between the mountain base and peaks routinely exceeds
30 degrees. This differential could affect the health of guests, especially those who
are inexperienced or unprepared. Project Trailblazer should collect and store the
current temperatures for all key mountain locations. Project Trailblazer should
display current temperature readings at the bottom of each lift. Project Trailblazer
should provide a Web page displaying all the current temperatures.

Temperature information collection and display is addressed in Chapter 10,


“Synchronous Serial Communication Interfacing.” Web integration is addressed in
Chapter 12, “System Integration.”

Safety Requirement 2: Visual Information


Mountaintop visibility could affect the health of inexperienced or unprepared guests.
Project Trailblazer should collect and store current visibility information in the form
of still images for all key mountaintop locations. Project Trailblazer should provide
Web pages that display recent still images.
Visual information collection is addressed in Chapter 8, “USB Interfacing.” Visual
information distribution is addressed in Chapter 12.

Operations Requirements
The Operations Department manages and maintains Silverjack’s equipment.
Operations seeks high efficiency at a low cost and achieves this through the effective
use of manpower and low-cost equipment. Project Trailblazer addresses operations
requirements in these areas: guest activities, snow-making control, lift monitoring,
race timing, and music playback.
18 CHAPTER 2 System Architecture

Operations Requirement 1: Guest Authentication


Project Trailblazer should allow lift access to guests who have proper authentication.
Project Trailblazer must interface with the ticket office’s point-of-sale system. Project
Trailblazer should give the lift operator and guest a visual indication of proper
authentication.

Guest authentication acquisition and permission are addressed in Chapter 6,


“Asynchronous Serial Communication Interfacing.”

Operations Requirement 2: Guest Messaging


Project Trailblazer should provide a mechanism to deliver personalized messages—of
a personal or an emergency nature—to individual guests. A message should be deliv-
ered prior lift access. Project Trailblazer should have the capability to require the
guest to acknowledge receipt of a message.

Patron messaging distribution and acknowledgement are addressed in Chapter 12.

Operations Requirement 3: Guest Tracking


Project Trailblazer should provide a mechanism to track guest movement. Operations
will use this data in trend analysis for strategic planning. Guests might use this data
for curiosity purposes.

Guest tracking distribution is addressed in Chapter 12.

Operations Requirement 4: Snow-Making Control


Project Trailblazer should provide a mechanism to control the snow-making equip-
ment from the OCC. Primarily, this implies remote control of mountaintop-located
water valves.

Snow-making control is addressed in Chapter 7, “Parallel Port Interfacing” and


Chapter 9, “Memory I/O Interfacing.”

Operations Requirement 5: Lift Monitoring


Project Trailblazer should monitor the operation of each lift and should provide
instantaneous and historical lift operation data in a graphical form.
Lift monitoring acquisition is addressed in Chapters 7 and 9. Lift monitoring infor-
mation distribution is addressed in Chapter 12.

Operations Requirement 6: Race Timing


Project Trailblazer should record and store race times, to 1-millisecond accuracy.
Project Trailblazer should display intermediate and final race times at the racecourse
finish line. Project Trailblazer should distribute race results through a Web interface.
The Project Trailblazer System Architecture 19

Ski race timing acquisition is addressed in Chapters 11, “Using Interrupts For
Timing.” Race results distribution is addressed in Chapter 12.

Operations Requirement 7: Music Playback


Project Trailblazer should provide music playback functionality for the AirPark and
the village. The OCC should control song selection and deliver songs to the music
playback equipment via the network.

Music playback is addressed in Chapter 8 and song control is addressed in Chapter 12.

Supplier Requirements
Project Trailblazer can take two approaches to ensure lower equipment expenditures:
Use no single-source supplier of equipment and do not design any complex circuit
boards (that is, it should use low-cost commercial off-the-shelf hardware).

Supplier Requirement 1: No Single-Source Suppliers


Project Trailblazer should be designed with hardware and software that’s available
from multiple sources. Use of single-source suppliers results in loss of competitive
pricing and alternative selection.

Supplier selection is addressed in Chapter 3, “Selecting a Platform and Installing Tool


Sets.”

Supplier Requirement 2: Low-cost Commercial Off-the-Shelf Hardware


Project Trailblazer should be designed with hardware that’s available as part of a
manufacturer’s standard product line. No custom CPU boards should be designed.

Hardware selection is addressed in Chapter 3.

The Project Trailblazer System Architecture


The Project Trailblazer system architecture consists of functional blocks that acquire
data (inputs), control equipment (outputs), store data, and distribute data. Figure 2.4
shows these blocks and their interconnection. Project Trailblazer’s input, output, and
data storage blocks exist on a private network to protect access to them. The data
distribution block provides access to the stored data from a public network.
Remember that a system architecture only specifies functional blocks and their inter-
connection. The design phase addresses implementation details, such as component
specifications and selection. The Project Trailblazer architecture, although simple,
provides the framework for design activities and shows the big picture for the
project.
20 CHAPTER 2 System Architecture

Private
Network
Inputs Outputs
Temperature Input Temperature Display

Visual Input Music Playback

Guest Authentication Guest Messaging

Lift Monitoring Snowmaking Control

Race Timing Race Results

Data Storage

Data Distribution

Public
Network

FIGURE 2.4 The Project Trailblazer system architecture.

Summary
This chapter introduced Project Trailblazer and the Silverjack Resort layout. The
Engineering Department worked with the Operations Department to develop a set of
high-level requirements. These requirements formed the basis for the Project
Trailblazer system architecture. At this point, the Engineering Department under-
stood the project from a block-level perspective. The functionality of the blocks was
defined and their interconnection was established. The engineers are now ready to
enter the design phase of Project Trailblazer and begin to specify components.
3 IN THIS CHAPTER

• Sources of Information
Selecting a Platform and • The Project Trailblazer

Installing Tool Sets Strategic Direction

• Building tbdev1, the


Embedded Linux
Development Workstation
P roject Trailblazer commenced. The board of directors
• Additional Reading
approved the project requirements and allocated funding.
However, the engineers didn’t know what hardware to
choose, what software to use, what level of support would
be needed, or even some of the performance requirements.
They did know that embedded Linux would serve as the
development platform because of its performance, reliabil-
ity, open source, low cost, and support. They also know
that Project Trailblazer’s aggressive timeframe requires fast
action. The engineers needed to choose a CPU architec-
ture, off-the-shelf hardware, a kernel version, development
tools, and a host development environment as soon as
possible. There’s a lot of work to do before the snow flies.
In this chapter, we’ll follow the engineers’ progress in
choosing and ordering hardware and building an embed-
ded Linux workstation for multiprocessor development.

Sources of Information
The engineers started the hardware selection process by
searching the Web for case studies, examples, and Web
sites that discuss actual projects using hardware for embed-
ded Linux applications. They wanted to select target hard-
ware with which someone else had had success when
using embedded Linux. Their first search returned a wealth
of information, much of which was contained in the
following Web sites:

• The Embedded Linux Consortium (ELC;


www.embedded-linux.org) is a “nonprofit, vendor-
neutral trade association whose goal is the advance-
ment and promotion of Linux throughout the
embedded, applied and appliance computing
22 CHAPTER 3 Selecting a Platform and Installing Tool Sets

markets.” The ELC, which has more than 125 member companies, actively
1
promotes embedded Linux and endorses the ELC platform specification. In
the future, a developer using an ELC-certified embedded Linux product will be
ensured of a common development application programming interface (API).
Use of certified products reduces development time, lowers costs, and acceler-
ates the use of Linux in embedded applications. The engineers decided to do
business with ELC member companies if possible. These companies are active
and support the embedded Linux movement.

• Linux Devices (www.linuxdevices.com), which is created and maintained by


Rick Lehrbaum, is an embedded Linux Portal that contains daily news updates
on embedded Linux, a complete series of quick reference guides, numerous
articles written by key developers, a “Cool Devices” section, numerous links to
other Linux sites, and an interactive discussion forum. The engineers find this
site to be unbelievable in terms of content coverage, variety, and depth. The
2
quick reference guides “Embedded Linux: An Introduction and Overview,”
“Embedded Distributions,” “Real-time Linux Software,” and “Linux-friendly
3
Embedded Single Board Computers” provide invaluable information for
Project Trailblazer.

• Embedded Linux Journal (ELJ; embedded.linuxjournal.com) focuses on Linux


and other open-source software for use in embedded systems. ELJ offers
complimentary bimonthly subscriptions. The Web site contains the magazine’s
complete article archive. Industry leaders write excellent, thorough, and perti-
nent articles on embedded Linux for ELJ.

ELC, Linux Devices, and ELJ (and their links to other sites) provide comprehensive
information on practically all aspects of embedded Linux. This encouraged the engi-
neers, but the amount of information and the huge number of options in architec-
tures, single-board computers, software distributions, and tools was overwhelming.
The engineers were now educated, but they still didn’t know where to start in the
hardware selection process. They summarized their research and then formulated a
strategic direction, as discussed in the following section.

The Project Trailblazer Strategic Direction


The engineers’ research exposed them to kernel ports, tool chain ports, develop-
ment/product single-board computers, various ongoing embedded Linuxprojects,
software repositories, commercial and open-source embedded Linux distributions,
and the advantages of using kernel version 2.4. The engineers were able to summa-
rize all their research and develop a strategic direction consisting of three areas:
kernel porting, source code, and kernel version.
The Project Trailblazer Strategic Direction 23

Kernel ports must exist for all CPU architectures under consideration. The Trailblazer
engineers don’t have the expertise or time to port the kernel to a new architecture.
Several architectures’ ports exist and can be found within the kernel source tree.
Checking the kernel version 2.4.0 source, the engineers found port information in
the arch directory for the following processors: Alpha, ARM, i386, IA-64, m68k,
MIPS, MIPS64, PA-RISC, PowerPC, S390, SuperH, SPARC, and SPARC64.

Wherever possible, the engineers wanted to use and compile open-source codefor the
kernel, applications, and tools. Embedded Linux is a new industry. In the coming
years, the current landscape will change due to mergers, buyouts, and failures.
Adopting a product or distribution introduces a potential risk if support becomes
unavailable in the future. By learning how to compile the tools, the kernel, and the
applications from their open-source code repositories, the developer and projects
become immune to changes in the industry. Compiling open-source code promotes a
better understanding of Linux—including its kernel, the boot process, necessary
applications, and library interaction.

NOTE
Learning to compile open-source code protects your projects from changes in the embedded
Linux industry.

Linux kernel version 2.4.0, released in January 2001, represents a major technologi-
4,5
cal leap forward. Developers are pushing Linux into new areas and concentrating
their efforts on 2.4 code. No reason exists to consider using an older kernel version.
Project Trailblazer requires the following version 2.4 technologies: improved process
scheduler, memory technology devices (support for ROM and Flash memory
devices), and universal serial bus (USB) support.

Developing this three-area strategic direction allowed the engineers to take a couple
steps toward choosing hardware. They required off-the-shelf boards with processors
that have kernel 2.4.x or greater ports. They also required open-source code availabil-
ity for the kernel, applications, and tools. Hardware and software selection remained
wide open for the engineers. Should they select the popular x86 or look at other
processors, such as ARM, PowerPC, or MIPS? Should they use a commercial open-
source product, a noncommercial open-source embedded Linux distribution, or
downloaded source code? Should they buy a support package? These were tough
questions, each of which had answers that imply different levels of risk, develop-
ment time, and cost. Time was ticking away.

After much research and thought, as well as conversations with board suppliers and
software distribution suppliers, the engineers decided on architecture, boards, and
software.
24 CHAPTER 3 Selecting a Platform and Installing Tool Sets

The engineers chose the following hardware architectures and vendors/boards:

• x86—Standard desktop 586 CPU with a Flash memory Integrated Drive


Electronics (IDE) drive (that is, no moving parts)

• x86—Tri-M MZ104 with MachZ embedded PC-on-a-chip 486 microprocessor


with Flash memory IDE drive

• PowerPC—Embedded Planet RPX-CLLF with Motorola MPC860 microproces-


sor and 16MB Flash memory

• ARM—Brightstar Engineering MediaEngine with Intel SA-1110 microprocessor


and 16MB Flash memory

For the software kernel, the engineers chose Version 2.4 or greater. They decided to
go with the GNU Tool chain, including the compiler, assembler, libraries, debugger,
and utilities.

While waiting for their hardware to arrive, the engineers constructed their develop-
ment workstation, called tbdev1. They planned to use this workstation to compile
the tools, kernel, and applications for the x86, PowerPC, and ARM processors.

The remaining sections of this chapter address tbdev1 configuration for x86 compil-
ing and PowerPC and ARM processor cross-compiling. The engineers want to use
tbdev1 to compile the kernel, applications, and libraries for the Trailblazer target
platforms. Chapter 4, “Booting Linux,” addresses unique configuration and booting
of the target platforms. Chapter 5, “Debugging,” covers remote debugging of
helloworld on each board.

Building tbdev1, the Embedded Linux Development


Workstation
The Silverjack engineers decided to consolidate all the Project Trailblazer develop-
ment tools in a single place. They devoted a single computer to act as a development
workstation, hosting all the compilers, cross-compilers, debuggers, libraries, and
kernel and application source code. This consolidation simplified the development
activities because the engineers didn’t have to spend time configuring each engi-
neer’s workstation for cross-development. This section outlines the steps for building
tbdev1, the Project Trailblazer development workstation:

1. Getting started

2. Installing the Linux operating system

3. Installing the native GNU tool chain and other applications

4. Building the GNU tool chain for cross-compiling


Building tbdev1, the Embedded Linux Development Workstation 25

After these four steps have been completed, tbdev1 will be capable of compiling C
code for the x86 using gcc. Cross-compilers for PowerPC (powerpc-linux-gcc), and
ARM (arm-linux-gcc) processor will also be created. All the examples in subsequent
chapters utilize the tbdev1 workstation. The remaining sections in this chapter help
you to create your own tbdev1 workstation that’s identical to Project Trailblazer’s
tbdev1.

TIP
Creating a cross-development environment generates a set of libraries for another CPU archi-
tecture, such as PowerPC or ARM. During the installation process, you have an opportunity to
overwrite the existing x86 libraries with a PowerPC or ARM version. Devoting a computer to
act as the cross-development workstation eliminates the possibility of destroying your personal
desktop workstation x86 libraries.

Getting Started
In this section we’ll build the tbdev1 development workstation, using the Debian
distribution potato, which is Debian version 2.2r5 (kernel 2.2.19). You can download
potato and install it on tbdev1 using a LAN Internet connection and three floppy
disks. The resultant workstation will contain only the software required to build the
cross-development environment. Other programs, such as sendmail, Web servers,
and X Windows, will not be installed, thus lowering hardware requirements for
tbdev1. Here’s what you need to get started:

• An x86 computer with 32MB RAM and 1.5GB or larger drive, with a master
drive on the primary IDE controller and an Ethernet card

• Three 1.44 floppy disks

• A LAN Internet connection

• A keyboard and a monitor

To start, you need to download three floppy image files from the Debian Web site
(www.debian.org). At this point, you might not have a Linux machine running.
Therefore, Microsoft Windows instructions are included here, but only to the point
where you get Linux up and running. After that, only Linux instructions are given
because Project Trailblazer is, after all, a Linux project.

You need to download three images files, using your browser, FTP, wget, or lynx. You
should download the files into a temporary directory called /tmp or c:\tmp, which
you might need to create. Here’s the base URL for the image files:

http://ftp.us.debian.org/debian/dists/stable/
➥main/disks-i386/current/images-1.44/idepci/
26 CHAPTER 3 Selecting a Platform and Installing Tool Sets

Download these three image files: rescue.bin, root.bin, and driver-1.bin.

If you are a Windows user, you need to also download a program called
rawrite2.exe from ftp://ftp.debian.org/debian/tools.

Now you need to create the installation disks. To do so, Unix users should use the
following commands:

holla@taylor[501]: cd /tmp
holla@taylor[502]: dd if=rescue.bin of=/dev/fd0 bs=1024 conv=sync ; sync
holla@taylor[503]: dd if=root.bin of=/dev/fd0 bs=1024 conv=sync ; sync
holla@taylor[504]: dd if=driver-1.bin of=/dev/fd0 bs=1024 conv=sync ; sync

Windows users should open a DOS window by choosing Run from the Start menu,
entering command and pressing Enter. Then in the DOS window enter following:

C:\> cd c:\tmp
C:\tmp> rawrite2 -f rescue.bin -d a:
C:\tmp> rawrite2 -f root.bin -d a:
C:\tmp> rawrite2 -f driver-1.bin -d a:

Label the disks “rescue,” “root,” and “drivers.” You are now ready to start the potato
installation on tbdev1.

Installing the Linux Operating System


The instructions in the following sections step through the potato network installa-
tion process. The steps include a portion of what you’ll see on your installation
screen and the action you should take. The intention here isn’t to teach you about
the Debian installation; please read Debian’s detailed install guides at
www.debian.org/releases/stable/#new-inst for more information. In this section
you’ll quickly build a Linux workstation to compile the cross-compiler and libraries.
The numbered lines in the steps below match what you should see on your worksta-
tion monitor during the Debian installation process.

Step 1: Boot tbdev1


In this step, you boot your workstation, using the floppy disks that you just created.
The rescue disk contains the Linux kernel. The root disk contains a compressed
filesystem that this kernel uses during the installation process. Follow these steps:

1. Insert the floppy disk marked rescue and turn on your workstation.

2. The Welcome screen should appear, with a boot: prompt. Press Enter.

3. The Linux kernel on the rescue disk loads into memory and begins executing.
You should see about 50 lines showing the status of the boot process. The boot
Building tbdev1, the Embedded Linux Development Workstation 27

process stops when the kernel needs access to the root filesystem. You see this:
VFS: Insert root floppy to be loaded into RAM disk and press ENTER:.
Remove the rescue disk and insert the root floppy and press Enter.

4. The Release Notes Screen appears. Read through the notes if you want, and
then press Enter.

Step 2: Partition the Hard Disk


In this step, you remove the existing partitions on the master drive on your primary
IDE controller. Then you create a swap and root partition on that drive. This opera-
tion destroys all the information on that disk. Make sure that you have the correct
disk installed, and then follow these steps:

TIP
If you have multiple drives in your computer, you might want to disconnect all of them
except the one you’re installing Linux on. This ensures that you don’t accidentally install Linux
on the wrong drive.

1. The Debian installation screen has an option Partition a Hard Disk. Use the
arrow keys to highlight this option and then press Enter.

2. The Select Hard Drive screen allows you to select a hard disk drive to partition.
Select /dev/hda and press Enter.

3. The LILO Limitations screen appears. Read about the limitations and then press
Enter.

4. At this point you’re about to repartition the master drive on your primary
controller. Make sure you have the correct disk installed. The cfdisk screen
presents you with a list of current partitions and a menu along the bottom. Use
the up and down arrows to select from the partition list. Use the right and left
arrows to select a menu item. Select the first partition, and then select Delete
and press Enter. Continue until you have deleted all the drive partitions.

5. Make a new 64MB swap partition by first selecting the New menu and pressing
Enter. Then select Primary and press Enter, set the size to 64 and press Enter,
and select Beginning and press Enter.

6. The partition list should now have an hda1 entry. With it selected, select the
Type menu and set the type to 82 (Linux Swap). At this point, the partition list
should show a 64MB swap partition called hda1.

7. Select Free Space from the partition list.


28 CHAPTER 3 Selecting a Platform and Installing Tool Sets

8. Make new partition by first selecting the New menu and then selecting
Primary. Set the size to use the remainder of the drive space, and then select
Beginning.

9. The partition list should now have an hda2 entry. With it selected, select the
Type menu and set the type to 83 (Linux). At this point, the partition list
should show a 64MB swap partition called hda1 and another partition with
filesystem, FS type, Linux.

10. Select hda2 from the partition list, and then make hda2 bootable by selecting
the Bootable menu.

11. Finalize this partitioning by selecting Write and confirm the write operation
with by typing yes.

12. Exit from the cfdisk screen by selecting Quit.

Step 3: Configure the Keyboard and Activate the Partitions


In step 3 you configure and activate the hda1 and hda2 partitions you just created.
Remember that hda1 is the 64MB swap partition. Follow these steps:

1. Select the Configure Keyboard menu and press Enter. Select the keyboard that
best fits your situation and press Enter.

2. Activate the swap partition by selecting the Initialize and Activate a Swap
Partition menu, and then select /dev/hda1. When you’re asked to skip the scan
for bad blocks, select No. When you’re asked whether you are sure, confirm by
selecting Yes.

3. Activate the Linux partition by selecting the Initialize a Linux Partition menu,
and then select /dev/hda2. When asked about Pre-2.2 Linux kernel compatibil-
ity, select No. When asked to skip the scan for bad blocks, select No. When
asked whether you are sure, confirm by selecting Yes.

4. Finalize the activation by mounting /dev/hda2 as the root file system. When
asked “Mount As Root Filesystem?” select Yes.

Step 4: Install the Operating System Kernel and Modules


Now that the hard disk is partitioned, initialized, and mounted, it’s time to copy the
Linux kernel and modules. To do so, follow these steps:

1. Start copying by selecting the Install Operating System Kernel and Modules
menu.

2. At the Select Installation Medium screen, select /dev/fd0 and press Enter.
Building tbdev1, the Embedded Linux Development Workstation 29

3. Insert the rescue disk and then select Continue. The installation program
copies the kernel file contained on the rescue disk to the hard disk.

4. When asked to insert Driver Disk 1, remove the rescue disk and insert the
drivers disk and then select Continue. The drivers are then copied to the hard
disk.

5. Select Configure Device Driver Modules from the main menu.

6. When asked about skipping the additional drivers floppy, select Yes.

7. Configure the workstation’s Ethernet card. The driver’s floppy disk contains
Ethernet drivers for a wide variety of Ethernet cards. Start by selecting Net:
Drivers for Network Interface Cards and Network Protocols.

TIP
Drivers for these Ethernet cards—3COM, Western Digital/SMC, Racal-Interlan, AMD PCnet32,
DECchip Tulip, EtherExpressPro/100, PCI NE2000, and VIA Rhine—are already built in to the
6
potato kernel. If you have one of these cards, you can skip to the section “Step 5: Configure
the Network.”

8. Select your Ethernet card from the list. For example, select ne for a NE2000
compatible. Select OK by pressing Enter.

9. When asked to install this module in the kernel, confirm by selecting Yes.

10. Some Ethernet cards require additional configuration. When asked to enter
command-line arguments, enter your Ethernet card’s I/O address and IRQ if
necessary. For this example, you might enter io=0x300 irq=5.

11. The installation program loads the Ethernet driver, and the driver attempts to
find the Ethernet card. If the driver finds the card, a screen announces success-
ful loading of the driver. If the card is not found, you have the option to restart
and correct the Ethernet card configurations. Your ethernet card needs to be
functioning correctly to complete the installation.

12. Exit the module configuration by selecting Exit from the Select Net Modules
menu, and then select Exit from the Category menu.

Step 5: Configure the Network


Now that the kernel is installed and the Ethernet driver has found the Ethernet card,
it is time to configure the network. Later, you’ll need the network to install the
various applications that you download from the Debian Web site. Follow these steps
to configure the network:
30 CHAPTER 3 Selecting a Platform and Installing Tool Sets

1. Select Configure Network from the main menu.

2. When asked to choose the host name, enter tbdev1 and press Enter.

3. When asked about automatic network configuration, select No. No DHCP or


BOOTP server exists. You are going use static IP addressing.

4. When asked to choose the IP address, type 192.168.1.11 and press Enter.

5. When asked to choose the network mask, type 255.255.255.0 and press Enter.

6. When asked what your IP gateway address is, type 192.168.1.254 or your
network gateway address and press Enter.

7. When asked to choose the domain name, leave the name blank and press
Enter.

8. When asked to choose the DNS name addresses, enter 192.168.1.1 or your
DNS server address and press Enter.

9. Next, you need to install a collection of programs called the base system. Select
Install Base System and press Enter.

10. You will be downloading the base system from the Debian Web site. Select
Network: Retrieve from Network and press Enter.

11. The installation program announces that it is about to fetch the base2_2.tgz
installation over the network using HTTP. Select Continue.

12. At the Select installation server screen, use the Tab key to select OK, and then
press Enter.

13. The installation program downloads the 16MB Base2_2.tgz file from the
Debian Web site. This is a perfect time to take a break.

Step 6: Configure the Base System


The installation program finishes the download of Base2_2.tgz, decompresses it,
and installs various applications and files on your hard disk. There’s not much
involved in configuring the base system other than setting the time zone. Follow
these steps:

1. Select Configure Base System from the main menu and press Enter.

2. Scan through the list and select your time zone. Then use the Tab key to
select OK.

3. When asked to set your clock to GMT, select Yes.


Building tbdev1, the Embedded Linux Development Workstation 31

Step 7: Make Linux Bootable Directly from the Hard Disk


With the kernel, device drivers, and base system installed, one more step remains:
making Linux bootable directly from the hard disk. In this step, you write the Linux
Loader (LILO) bootloader to the hard disk’s master boot record (MBR). When the
computer boots, the bootloader code executes first and loads the Linux kernel from
the hard disk to memory. Then the kernel executes. Follow these steps:

1. At the main menu, select Make Linux Bootable Directly From Hard Disk and
press Enter.

2. Choose /dev/hda from the Where Should the LILO Bootloader Be Installed?
menu and press Enter.

3. Select Reboot the System at the main menu and confirm by selecting Yes. Eject
the disk. The computer reboots from the hard disk and the installation process
continues.

Step 8: Set Passwords, Accounts, and PPP


After rebooting, the installation process continues: You configure passwords,
accounts, and point-to-point protocol options. To do so, follow these steps:

1. When asked “Shall I enable MD5 Passwords?”, select No.

2. When asked “Shall I install shadow passwords?”, select No.

3. When prompted “Enter a password for root”, type p or something you’ll


remember and press Enter.

4. When prompted to re-enter password to verify, retype the password you just
entered and press Enter.

5. When asked, “Shall I create a normal user account?”, select No. You can add
user accounts later, with the adduser command.

6. When asked, “Shall I remove pcmcia packages?”, select Yes.

7. When asked, “Do you want to use a PPP connection to install the system?”,
select No.

Step 9: Configure apt


All major Linux distributions support a software package management system that
ensures clean and easy software installations through dependency and conflict
checking. The Debian package system, apt, works with packages called debs, and
its command-line interface program is called apt-get. System administrators use
32 CHAPTER 3 Selecting a Platform and Installing Tool Sets

apt-get to install and remove software packages. The apt package management
system requires updated package lists. In this step, you use the installation program
to configure apt and download the current package lists from the Debian Web site:

1. At the Apt Configuration menu, select http and press Enter.

2. When asked, “Use non-US software?”, select Yes.

3. When asked, “Use non-free software?”, select Yes.

4. When asked, “Use contrib software?”, select Yes.

5. When asked to select a country, select your country and press Enter.

6. When asked to choose the Debian mirror to use, select http.us.debian.org or


the mirror closest to you.

7. When asked to enter http proxy information, leave a blank or fill in your HTTP
proxy information.

8. At this point, the install program downloads apt package information from the
Debian site.

9. When asked to add another apt source, select No.

10. When asked, “How do you want to choose additional software to install?”,
select Advanced and then select OK.

11. A program called dselect starts. Don’t install any software with dselect at this
time. At the Start dselect screen, select OK.

12. Exit from dselect by selecting Quit.

Step 10: Have Fun!


The potato installation is now complete. Follow these steps:
1. The installation program instructs you to have fun. So select OK and start
having some fun!

2. You now get a tbdev1 login prompt. Log in as root, with the password you set
earlier. This logs you in to tbdev1 as root, running the bash shell.

3. Check the disk filesystem space usage with the df command. This shows the
hard disk space requirement for a clean potato installation. Here’s a sample of
df output:

Filesystem 1k-blocks Used Available Use% Mounted on


/dev/hda2 4854520 67496 4540428 1% /

You have now completed the potato installation. Next, you need to use apt-get to
install a few packages that are required to build the GNU tool chain.
Another Random Scribd Document
with Unrelated Content
Then, with cries of joy, the hungry birds were fed, the motherly wings
folded over them, and all seemed to sleep in the poor nest they had found.

All night the rain pattered on my old roof, but not a drop went through;
all night the chilly wind crept round my windows, and breathed in at every
broken pane, but the old carpet kept the sleepers warm, and weariness was a
sure lullaby. How pleased and proud I felt that I could still be useful, and
how eagerly I waited for day to see yet more of my new tenants! I knew
they would go soon and leave me to my loneliness, so I longed to see and
hear all I could.

The first words the mother said, as she sat upon the step in the warm
April sun, pleased me immensely, for they were of me.

"Yes, Hans, it will be well to stay here a day at least, if we may, for Lina
is worn out and poor Gretchen so tired she can go no more. You shall guard
them while they sleep, and I will go again for food, and may get work. It is
better out here in the sun than in some poor place in the city, and I like it
well, this friendly old carriage that sheltered us when most we needed it."

So the poor woman trudged away, like a true mother-bird, to find food
for the ever-hungry brood, and Hans, a stout lad of twelve, set about doing
his part manfully.

When he heard the workmen stirring in the great factory, he took


courage, and, going in, told his sad tale of the little tired sisters sleeping in
the old omnibus, the mother seeking work, the father lately dead, and he
(the young lad) left to guard and help the family. He asked for nothing but
leave to use the bit of carpet, and for any little job whereby he might earn a
penny.

The good fellows had fatherly hearts under their rough jackets, and lent a
helping hand with the readiness the poor so often show in lightening one
another's burdens. Each did what he could; and when the mother came
back, she found the children fed and warmed, cheered by kind words and
the promise of help.
Ah! it was a happy day for me when the Schmidts came wandering by
and found my door ajar! A yet happier one for them, since the workmen and
their master befriended the poor souls so well that in a week the houseless
family had a home, and work whereby to earn their bread.

They had taken a fancy to me, and I was their home; for they were a
hardy set and loved the sun and air. Clever Hans and his mother made me as
neat and cosy as possible, stowing away their few possessions as if on
shipboard. The shed was given to mother Schmidt for a wash-house, and a
gypsy fire built on the ground, with an old kettle slung over it, in which to
boil the clothes she washed for such of the men as had no wives. Hans and
Gretchen soon found work selling chips and shavings from the factory, and
bringing home the broken food they begged by the way. Baby Lina was a
universal pet, and many a sixpence found its way into her little hand from
the pockets of the kindly men, who took it out in kisses, or the pretty songs
she sang them.

All that summer my family prospered, and I was a happy old 'bus. A
proud one, too; for the dear people loved me well, and, in return for the
shelter I gave them, they beautified me by all the humble means in their
power. Some one gave Gretchen a few scarlet beans, and these she planted
among the dandelions and green grass that had grown about my wheels.
The gay runners climbed fast, and when they reached the roof, Hans made a
trellis of old barrel hoops, over which they spread their broad leaves and
bright flowers till Lina had a green little bower up aloft, where she sat, as
happy as a queen, with the poor toys which her baby fancy changed to
playthings of the loveliest sort.

Mother Schmidt washed and ironed busily all day in her shed, cooked
the soup over her gypsy fire, and when the daily work was done sat in the
shadow of the old omnibus with her children round her, a grateful and
contented woman. If any one asked her what she would do when our bitter
winter came, the smile on her placid face grew graver, but did not vanish, as
she laid her worn hands together and answered, with simple faith,—

"The good Gott who gave us this home and raised up these friends will
not forget us, for He has such as we in His especial charge."
She was right; for the master of the great factory was a kind man, and
something in the honest, hard-working family interested him so much that
he could not let them suffer, but took such friendly thought for them that he
wrought one of the pleasant miracles which keep a rich man's memory
green in grateful hearts, though the world may never know of it.

When autumn came and the pretty bower began to fade, the old omnibus
to be cold at night, and the shed too gusty even for the hardy German
laundress, a great surprise was planned and gayly carried out. On the
master's birthday the men had a holiday, and bade the Schmidts be ready to
take part in the festival, for all the factory people were to have a dinner in
one of the long rooms.

A jovial time they had; and when the last bone had been polished off, the
last health drunk, and three rousing cheers for the master given with a will,
the great joke took place. First the Schmidts were told to go and see what
had been left for them in the 'bus, and off they ran, little dreaming what was
to come. I knew all about it, and was in a great twitter, for I bore a grand
part in it.

The dear unsuspecting family piled in, and were so busy having raptures
over certain bundles of warm clothes found there that they did not mind
what went on without. A dozen of the stoutest men quietly harnessed
themselves to the rope fastened to my pole, and at a signal trotted away
with me at a great pace, while the rest, with their wives and children, came
laughing and shouting after.

Imagine the amazement of the good Schmidts at this sudden start, their
emotions during that triumphal progress, and their unspeakable surprise and
joy when their carriage stopped at the door of a tidy little house in a lane
not far away, and they were handed out to find the master waiting to
welcome them home.

Dear heart, how beautiful it all was! I cannot describe it, but I would not
have missed it for the world, because it was one of the scenes that do
everybody so much good and leave such a pleasant memory behind.
That was my last trip, for the joyful agitation of that day was too much
for me, and no sooner was I safely landed in the field behind the little house
than one of my old wheels fell all to pieces, and I should have tumbled over,
like a decrepit old creature, if the men had not propped me up. But I did not
care; my travelling days were past, and I was quite content to stand there
under the apple-trees, watching my family safe and busy in their new home.

I was not forgotten, I assure you; for Germans have much sentiment, and
they still loved the old omnibus that sheltered them when most forlorn.
Even when Hans was a worker in the factory he found time to mend me up
and keep me tidy; pretty Gretchen, in spite of much help given to the hard-
working mother, never forgot to plant some common flower to beautify and
cheer her old friend; and little Lina, bless her heart! made me her baby-
house. She played there day after day, a tiny matron, with her dolls, her
kitten and her bits of furniture, as happy a child as ever sang "Bye-low" to a
dirty-faced rag-darling. She is my greatest comfort and delight; and the
proudest moment of my life was when Hans painted her little name on my
door and gave me to her for her own.

Here my story ends; for nothing now remains to me but to crumble


slowly to ruin and go where the good 'busses go; very slowly, I am sure, for
my little mistress takes great care of me, and I shall never suffer from rough
usage any more. I am quite happy and contented as I stand here under the
trees that scatter their white petals on my rusty roof each spring; and well I
may be, for after my busy life I am at rest; the sun shines kindly on me, the
grass grows greenly round me, good friends cherish me in my old age, and
a little child nestles in my heart, keeping it tender to the last.

XI.

RED TULIPS.
"Please ma'am, will you give me one of them red tulips?"

The eager voice woke Helen from her reverie, and, looking up, she saw a
little colored girl holding on to the iron railing with one hand, while the
other pointed to a bed of splendid red and yellow tulips waving in the
sunshine.

"I can't give you one, child, for they don't belong to me," answered
Helen, arrested by the wistful face, over which her words brought a shadow
of disappointment.

"I thought maybe you lived in this house, or knew the folks, and I do
want one of them flowers dreadful bad," said the girl, regarding the gay
tulips with a look of intense desire.

"I wish I could give you one, but it would be stealing, you know. Perhaps
if you go and ask, the owner may let you have one, there are so many."

And having offered all the consolation in her power, Helen went on,
busy with a certain disappointment of her own, which just then weighed
very heavily on her girlish heart.

Half an hour later, as she came down the street on the opposite side, she
saw the same girl sitting on a door-step, still gazing at the tulips with
hopeless admiration.

The child looked up as she approached, and recognizing the pretty young
lady who had spoken kindly to her, smiled and nodded so confidingly, that
Helen could not resist stopping to say,—

"Did you ask over there?"

"Yes, ma'am, but the girl said, 'No,' and told me to clear out; so I come
over here to set and look at the pretties, since I can't have none," she
answered, with a patient sigh.

"You shall have some!" cried Helen, remembering how easily she could
gratify the innocent longing of the poor child, and feeling a curious
sympathy with all disappointed people. "Come with me, dear; there is a
flower shop round the corner, and you shall have a posy of some sort."

Such wonder, gratitude and delight shone in Betty's face, that Helen felt
rejoiced for her small kindness. As they walked, she questioned her about
herself, and quite won her heart by the friendly interest expressed in Betty's
mother, Betty's kitten, and Betty's affairs generally.

When they came to the flower shop little Bet felt as if she had got into a
fairy tale; and when Helen gave her a pot with a blue hyacinth and a rosy
tulip blooming prettily together, she felt as if a lovely fairy had granted all
her wishes in the good old way.

"It's just splendid! and I don't know how to thank you, miss. But mother
takes in washing, and she'll love to do yours, and plait the ruffles elegant
—'cause you done this for me!" cried Betty, embracing the flower-pot with
one hand, and squeezing Miss Helen's with the other.

Helen promised to come and see her new friend, and when they parted,
kept turning round to watch the little figure trotting up the hill, often
pausing to turn, and show her a beaming black face, all smiles and delight,
as Betty threw her kisses and hugged the dear red tulip like a treasure of
great price.

When she vanished, Helen said to herself, with a smile and a sigh,—

"There, I feel better for that little job; and it is a comfort to know that
some one has got what she wants, though it is not I."

Some weeks later, when Helen was preparing to go into the country for
the summer, and wanted certain delicate muslins done up, she remembered
what Betty had said about her mother, and had a fancy to see how the child
and her flowers prospered.

She found them in a small, poor room, hot and close, and full of wash-
tubs and flat-irons. The mother was busy at her work, and Betty sat by the
one window, listlessly picking out ruffles.
When she saw the face at the door, she jumped up and clapped her
hands, crying, delightedly, "O mammy, it's my lady; my dear, pretty lady
truly come at last!"

Such a welcome made friends of the three at once, and Mrs. Simms
gladly undertook the work Helen offered.

"And how are the posies?" asked the young lady, as she rose to go.

"Only leaves now, miss; but I take real good care of 'em, and mammy
says they will blow again next spring," answered Betty, showing her poor
little garden, which consisted of the hyacinth, tulip, and one stout
dandelion, blooming bravely in an old teapot.

"That will be a long time to wait, won't it?"

"Yes'm; but I go and take peeks at them flowers in the shop, and once the
man gave me a pink that hadn't no stem. Maybe he will again, and so I'll get
along," said Betty, softly touching her cheerful dandelion as if it were a
friend.

"I wish you would come and see my garden, little Betty. You should pick
as many flowers as you liked, and play there all day long. I suppose your
mother couldn't spare you for a visit, could she?"

Betty's face shone at the blissful thought, then the smile faded, and she
shook her head, saying, steadily, "No, miss, I guess she couldn't, for she
gets so tired, I like to help her by carrying home the clothes. Some day,
maybe, I can come."

Something in the patient little face touched Helen, and made her feel as
if she had been too busy thinking of her own burden to help others bear
theirs. She longed to do something, but did not know how till Mrs. Simms
showed her the way, by saying, as she stroked the frizzly little head that
leaned against her,—

"Betty thinks a heap of flowers, and 'pears to git lots of comfort out of
'em. She's a good child, and some day we are going to see the country, soon
as ever we can afford it."

"Meantime the country must come to you," said Helen, with a happy
thought shining in her face. "If you are willing, I will make a nice little plan
with Betty, so she can have a posy all the time. I shall come in town twice a
week to take my German lessons, and if Betty will be at the corner of the
Park, by the deer, every Wednesday and Saturday morning at ten o'clock, I'll
have a nice nosegay for her."

If she had proposed to present the child with all the sweeties in
Copeland's delightful shop, it would not have given greater joy. Betty could
only dance a jig of rapture among the wash-tubs, and Mrs. Simms thank
Helen with tears in her eyes.

"Ain't she just like a good fairy, mammy?" said Betty, settling down in
an empty clothes-basket to brood over the joyful prospects.

"No, honey, she's an angel," answered mammy, folding her tired hands
for a moment's rest, when her guest had gone.

Helen heard both question and answer, and sighed to herself, "I wish
somebody else thought so."

When the first Wednesday came, Betty was at the trysting-place half an
hour too soon, and had time to tell the mild-eyed deer all about it, before
Miss Helen came.

That meeting was a pretty sight, though only a fawn and an old apple-
woman saw it. Helen was half-hidden behind a great nosegay of June roses,
lilies of the valley, sweet jonquils and narcissus, sprays of tender green, and
white lilac plumes. Betty gave one cry of rapture, as she clutched it in both
hands, trembling with delight, for never had she dreamed of owning such a
treasure as this.

"All for me! all for me!" she said, as if it was hard to believe. "Oh, what
will mammy say?"
"Run home and see. Never mind thanks. Get your posy into water as
soon as you can, and come again Saturday," said Helen, as she went on,
with a nod and a smile, while Betty raced home to fill every cup and plate
they owned, and make a garden of the poor little room, where mammy
worked all day.

All through the summer, rain or shine, these two friends kept tryst, and
though Helen seemed no nearer getting her wish, this little flower-mission
of hers helped her to wait.

Strangers watched the pretty girl with her nosegays, and felt refreshed by
the winsome sight. Friends joked her about her black Flora, and would-be
lovers pleaded in vain for one bud from her bouquets.

She found real happiness in this small duty, and did it faithfully for its
own sake, little dreaming that some one was tracking her by the flowers she
left behind her in the byways of her life.

For, seeing how much these fragrant messengers were to Betty and her
mother, Helen fell into the way of taking flowers to others also, and never
went to town without a handful to leave here and there, by some sick-bed,
in a child's hand, on a needle-woman's table, or dropped in the gutter, for
dear, dirty babies to find and crow over.

And, all unconsciously, these glimpses of poverty, pain, neglect, and


loneliness, taught her lessons she had never learned before,—a sweeter
language than German, a nobler music than any Herr Pedalstrum could give
her, and a more winning charm than either youth or beauty could confer,—
for the gay girl was discovering that life was not all a summer day, and she
was something better than a butterfly.

When autumn came, and she returned to her city home, her young
friends discovered that Helen's quiet season had improved her wonderfully,
for behind the belle, they found a tender-hearted woman.

She took up her old life where she laid it down, apparently; but to those
who knew her best, there was a difference now, for, in many unsuspected
ways, pretty Helen was unconsciously fitting herself for the happiness that
was coming to her very soon.

Betty helped to bring it, though she never guessed that her measles were
a blessing to her dear lady. When Dr. Strong, finding a hot-house bouquet
beside her bed, very naturally asked where it came from, Betty told all
about Miss Helen, from the time of the red tulips to the fine tea-roses in her
hand.

"She has lots of bunches like these sent to her, and she gives 'em to us
poor folks. This one was for her to take to a splendid ball, but she kept it all
fresh, and came herself to fetch it to me. Ain't she kind?"

"Very, to you; but rather cruel to the gentlemen who hope to see her wear
their gifts, for one evening at least," answered the doctor, examining the
bouquet, with an odd smile.

"Oh, she does keep some, when they are from folks she likes. I was there
one day when some violets come in with a book, and she wouldn't give me
one. But I didn't care a mite, for I had two great posies, all red geranium and
pinks, instead."

"She likes violets, then?" and the doctor gently patted Betty's head, as if
he had grown suddenly fond of her.

"I guess she does, for when I went the next week, that very bunch was in
the vase on her table, all dead and yeller, and she wouldn't let me fling it
away, when I wanted to put in a rose from the bush she gave me."

"You are a grateful little girl, my dear, and a very observing child. Now
keep warm and quiet, and we'll have you trotting off to Miss Helen's in a
week or so."

The doctor stole a sprig of rose geranium out of Betty's last bouquet, and
went away, looking as if he had found something even sweeter than that in
the dingy room where his patient lay.
Next day Miss Helen had fresh violets in the vase on her table, and fresh
roses blooming on her cheeks. Dr. Strong advised her not to visit Betty, as
there was fever in the neighborhood, but kindly called every day or two, to
let Helen know how her little friend was getting on.

After one of these calls, the doctor went away, saying to himself, with an
air of tender pride and satisfaction,—

"I was mistaken, and judged too hastily last year. Helen is not what I
thought her, a frivolous, fashionable beauty, but a sweet, sensible girl, who
is tired of that empty life, and quietly tries to make it beautiful and useful in
the best and truest way. I hope I read the blue eyes right; and I think I may
venture to say now what I dared not say last year."

After that same visit, Helen sat thinking to herself, with a face full of
happiness and humility,—"He finds me improved, so I have not waited in
vain, and I believe that I shall not be disappointed after all."

It is evident that the doctor did venture, and that Helen was not
disappointed; for, on the first day of June, Betty and her mother, all in their
best, went to a certain church, and were shown to the best seat in the
gallery, where several other humble friends were gathered to see their dear
Miss Helen married.

Betty was in high feather, with a pink dress, blue sack, yellow ribbons in
her hat, and lighted up the seat like an animated rainbow. Full of delight and
importance, was Miss Betty, for she had been in the midst of the festive
preparations, and told glowing tales to her interested listeners, while they
waited for the bride.

When the music sounded, Betty held her breath, and rolled up her eyes
in a pious rapture. When a general stir announced the grand arrival, she
leaned so far over the gallery, that she would have gone head first if her
mother had not caught her striped legs, and when the misty, white figure
passed up the aisle, Betty audibly remarked,—

"If she had wings she'd look like an out-and-out angel, wouldn't she,
mammy?"
She sat like a little ebony statue all through the service; but she had
something on her mind, and the moment the bridal couple turned to go out,
Betty was off, scrambling down stairs, dodging under people's arms,
hopping over ladies' skirts, and steadily making her way to the carriage
waiting for the happy pair.

The door had just closed, and Dr. Strong was about to draw down the
curtain, when a little black face, with a yellow hat surrounding it like a
glory, appeared at the window, an arm was thrust in offering a bunch of
flowers, and a breathless voice cried, resolutely,—

"Oh, please, do let me give 'em to my lady! They bloomed a-purpose for
her, and she must have 'em."

Those outside saw a sweet face bend to kiss the little black one, but they
did not see what happened afterward, for Helen, remembering a year ago,
said smiling,—

"Patient waiters are no losers. The poor child has red tulips all her own at
last!"

"And I have mine," answered the happy doctor, gently kissing his young
wife, as the carriage rolled away, leaving Betty to retire in triumph.

XII.

A HAPPY BIRTHDAY.

A certain fine old lady was seventy-three on the 8th of October. The day
was always celebrated with splendor by her children and grand-children;
but on this occasion they felt that something unusually interesting and
festive should be done, because grandma had lately been so very ill that no
one thought she would ever see another birthday. It pleased God to spare
her, however, and here she was, almost as well and gay as ever.

Some families do not celebrate these days, and so miss a great deal of
pleasure, I think. But the people of whom I write always made a great deal
of such occasions, and often got up very funny amusements, as you will
see.

As grandma was not very strong, some quiet fun must be devised this
time, and the surprises sprinkled along through the day, lest they should be
too much for her if they all burst upon her at once.

The morning was fine and clear, and the first thing that happened was
the appearance of two little ghosts, "all in white," who came prancing into
the old lady's room, while she lay placidly watching the sun rise, and
thinking of the many years she had seen.

"A happy birthday, gramma!" cried the little ghosts, scrambling up to


kiss the smiling old face in the ruffled night-cap.

There was a great laughing, and cuddling, and nestling among the
pillows, before the small arms and legs subsided, and two round, rosy faces
appeared, listening attentively to the stories grandma told them till it was
time to dress.

Now you must know that there were only two grandchildren in this
family, but they were equal to half a dozen, being lively, droll little chaps,
full of all manner of pranks, and considered by their relatives the most
remarkable boys alive.

These two fellows were quite bursting with the great secrets of the day,
and had to rush out as soon as breakfast was done, in order to keep from
"letting the cat out of the bag."

A fine dinner was cooked, and grandma's favorite niece came to eat it
with her, bringing a bag full of goodies, and a heart full of love and kind
wishes, to the old lady.
All the afternoon, friends and presents kept coming, and Madam, in her
best gown and most imposing cap, sat in state to receive them. A poet came
with some lovely flowers; the doctor brought a fine picture; one neighbor
sent her a basket of grapes; another took her a drive; and some poor
children, whom grandma had clothed and helped, sent her some nuts they
had picked all themselves, while their grateful mother brought a bottle of
cream and a dozen eggs.

It was very pleasant, and the bright autumn day was a little harvest time
for the old lady, who had sowed love and charity broadcast with no thought
of any reward.

The tea-table was ornamented with a splendid cake, white as snow


outside, but rich and plummy inside, with a gay posy stuck atop of the little
Mont Blanc. Mrs. Trot, the housekeeper, made and presented it, and it was
so pretty all voted not to cut it till evening, for the table was full of other
good things.

Grandma's tea was extra strong, and tasted unusually nice with Mrs.
Hosy's rich cream in it. She felt that she needed this refreshment to prepare
her for the grand surprise to come; for the family gifts were not yet given.

The boys vanished directly after tea, and shouts of laughter were heard
from Aunt Tribulation's room. What larks as they had up there no one knew;
but every one was sure they were preparing some fun in honor of the
occasion.

Grandma was not allowed to go into the study, and much tacking and
rummaging went on for a time. Then all the lamps were collected there,
leaving grandma and grandpa to sit in the parlor, talking tenderly together
by the soft glimmer of fire-light, as they used to do forty years ago.

Presently something scarlet and gold, feathery and strange, flitted by the
door and vanished in the study. Queer little yells and the sound of dancing
feet were heard. Then there was a hunt for the cat; next, Mrs. Trot was
called from the kitchen, and all but the boys came to escort grandma to the
scene of glory.
Leaning on grandpa's arm, she marched first; then came Mrs. Coobiddy,
the mother of the boys, bearing Aunt Carmine's picture; for this auntie was
over the water and could not come, so, at grandma's desire, her portrait was
borne in the procession.

Aunt Trib followed, escorted by Thomas Pib, the great cat, with his best
red bow on. Mrs. Trot and Belinda, the little maid, brought up the rear. A
music-box in the hall played the "Grand March" from "Norma;" and, with
great dignity, all filed into the study to behold an imposing spectacle.

A fire burned brightly on the hearth, making the old-fashioned andirons


shine like gold. All the lamps illuminated the room, which was trimmed
with scarlet and yellow leaves. An arch of red woodbine, evergreen and
ferns from the White Mountains was made over the recess which held the
journals, letters and books of the family; for their name was Penn, and they
all wrote so much that blots were found everywhere about the house, and a
flock of geese lived in the back yard, all ready to have their quills tweaked
out at a minute's notice.

Before this recess stood a great arm-chair, in which the father of


grandma had been laid, a new-born baby, and nearly smothered by being sat
upon by the fat nurse. This thrilling fact gave it a peculiar interest to the
boys; for, if great-grandpa had been smashed, where would they have been?

In front of this ancient seat stood a round table loaded with gifts, and on
each side stood an Indian chief in full costume, bearing lighted Chinese
lanterns on the ends of their spears, and war-clubs on their shoulders.

The arranging of these costumes had caused much labor and fun; for the
splendid crowns, a foot high, were made of hen's feathers, carefully
collected and sewed on to paper by Aunt Trib; the red shirts were fringed
and bedecked with odd devices; leather leggings went above the warriors'
knees, and all the family breast-pins were stuck about them.

Daggers, hatchets, clubs, and spears were made by the lads themselves,
and red army blankets hung gracefully from their shoulders. They had
planned to paint their faces blue and red, like the Feejee Islanders at
Barnum's show; but Mrs. Coobiddy would not consent to have her
handsome boys disfigure themselves; so the only paint they wore was
nature's red in their cheeks, and heaven's blue in their eyes, as they stood by
grandma's throne, smiling like a pair of very mild and happy little chiefs.

It really was a fine sight, I assure you, and grandma was quite overcome
by the spectacle. So she was introduced to her gifts as quickly as possible,
to divert her mind from the tender thought that all these fond and foolish
adornments were to please her.

Every gift had a poem attached, and as the presents were of every
description, the verses possessed an agreeable variety. Here are a few as a
sample. A small tea-kettle was one gift, and this pleasing verse seemed to be
bubbling out of its spout:—

"A little kettle, fat and fair,


To sit on grandma's stove,
To simmer softly, and to sing
A song of Freddie's love."

Another was this brief warning tucked into a match-box:—

"On this you scratch


Your little match.
When the spark flies
Look out for your eyes!
When the lucifer goes
Look out for your nose!
Little Jack gives you this
With a birthday kiss."

A third was rather sentimental, from Mrs. Coobiddy:—

"Within doth lie


A silken tie,
Your dress to deck;
Soft and warm
As daughter's arm
Round mother's neck."

Mr. Pib presented a mouse-trap all set; and in order to explain his poem,
I must relate an incident in his varied career.

Pib had long been one of the family, and was much respected and
beloved by them all. In fact, he was so petted and stuffed that he grew as fat
and big as a small dog, and so clumsy that he could no longer catch the
mice who dodged about among the dishes in the kitchen closets.

In vain had Mrs. Trot shut him up there; in vain had Aunt Trib told him it
was his duty to clear the cupboards of such small deer. Poor fat Pib only
bounced about, broke the china, rattled down the pans, to come out with
empty paws, while the saucy mice squeaked scornfully, and pranced about
under his very nose.

One day Trib saw Pib catch a squirrel, and having eaten it he brought the
tail to her as a trophy of his skill. This displeased his mistress, and she gave
him away, after a good scolding for killing squirrels and letting mice, his
lawful prey, go free.

Pib was so depressed that he went into the bag without a mew or a
scratch, and was borne away to his new home in another part of the town.

But he had no intention of staying; and after a day under the sofa, passed
in deep thought, and without food or drink, he made up his mind to go
home. Slipping out, he travelled all night, and appeared next morning,
joyfully waving his tail, and purring like a small organ.

Aunt Trib was glad to see him, and when he had explained that he really
did do his best about the mice, she forgave him, and got the trap for him to
give grandma, that she might no longer be annoyed by having her private
stores nibbled at.
"Dear madam, with respect
My offering I bring;
The hooks all baited well,
And ready for a spring.
No more the cunning mice
Your biscuits shall abuse,
Nor put their babes to sleep
Within your fur-lined shoes.
The trap my work must do;
Forgive your portly cat,
For he, like you, has grown
For lively work too fat.
All larger, fiercer game
I gallantly defy,
And squirrel, rat and mole
Beneath my paw shall die.
So, with this solemn vow,
T. Pib his gift presents,
And sprawling at your feet
Purrs forth his compliments."

Which he actually did, and then sat bolt upright on the rug, surveying the
scene with the dignity of a judge and the gravity of an owl.

Such funny presents! A wood-box and a water-carrier; a blue and gold


gruel-bowl, and a black silk apron; a new diary, and a pound of remarkably
choice tea; a pretty letter on birch bark, sealed with a tiny red leaf; and a
bust of the wisest man in America, were some of them.

How the dear old lady did enjoy it all, and how grateful she was for the
smallest trifle! An old friend sent her a lock of her mother's hair, and the
sight of the little brown curl made her forget how white her own was, as she
went back to the time when she last kissed that tender little mother fifty
years ago.

Fearing that tears would follow the smiles too soon, Aunt Trib
announced that the famous Indian chiefs, Chingchangpopocattepattle and
Pockeyhockeyclutteryar, would now give a war-dance and other striking
performances to represent Indian customs.

Then all sat round, and the warriors leaped into the middle of the room
with a war-whoop that caused Mr. Pib to leave precipitately. It was a most
exciting spectacle; for after the dance came a fight, and one chief
tomahawked, scalped, and buried the other in the space of two minutes.

But the ladies mourned so for the blond little Pockeyhockeyclutteryar


that he had to come alive and join in a hunting expedition, during which
they shot all the chairs for buffaloes and deer, and came home to roast a
sofa pillow over their fire, and feast thereupon with the relish of hungry
hunters.

These exploits were brought to an end by the arrival of more friends,


with more gifts, and the introduction of the birthday cake. This was cut by
the queen of the fête, and the panting chiefs handed it round with much
scuffling of big moccasins and tripping over disarranged blankets.

Then all filled their glasses with water, and drank the toast, "Grandma,
God bless her!" After which the entire company took hands and danced
about the big chair, singing in chorus:—

"Long may she wave, and may we all


Her dear face live to see,
As bright and well at seventy-four
As now at seventy-three."

The clock struck ten, and every one went home, leaving the family to
end the day as they began it, round grandma's bed, with good-night kisses
and the sound of her last words in their ears:—

"It has been a beautiful and happy day, my dears, and if I never see
another you may always remember that I thought this one my best and
brightest birthday."
Cambridge: Press of John Wilson & Son.
*** END OF THE PROJECT GUTENBERG EBOOK AUNT JO'S SCRAP-
BAG, VOLUME 4 ***

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
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!

ebookultra.com

You might also like