Download complete Embedded Linux Hardware Software and Interfacing R Hardware Software and Interfacing Hollabaugh ebook PDF file all chapters
Download complete Embedded Linux Hardware Software and Interfacing R Hardware Software and Interfacing Hollabaugh ebook PDF file all chapters
https://ebookultra.com/download/pic-microcontroller-an-introduction-
to-software-and-hardware-interfacing-1st-edition-han-way-huang/
https://ebookultra.com/download/energy-efficient-hardware-software-co-
synthesis-using-reconfigurable-hardware-1st-edition-jingzhao-ou/
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/
https://ebookultra.com/download/dedicated-digital-processors-methods-
in-hardware-software-co-design-1st-edition-f-mayer-lindenberg/
https://ebookultra.com/download/analog-interfacing-to-embedded-
microprocessor-systems-2nd-ed-edition-stuart-ball/
Embedded
Linux:
Hardware,
Software, and
Interfacing
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
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
1 2 3 4 5 6 7 8 9 10—CRS—05 04 03 02
Introduction .................................................................................................1
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
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
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
Index 405
Foreword
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.
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’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.
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.
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
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
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 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 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.
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
4 Booting Linux
5 Debugging
This page intentionally left blank
1 IN THIS CHAPTER
Linux System?
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.
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.
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.
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.
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.
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.
• 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.
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.
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.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
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
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.
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
Ski race timing acquisition is addressed in Chapters 11, “Using Interrupts For
Timing.” Race results distribution is addressed in Chapter 12.
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).
Private
Network
Inputs Outputs
Temperature Input Temperature Display
Data Storage
Data Distribution
Public
Network
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
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:
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.
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.
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
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.
1. Getting started
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
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
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.
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.
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.
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.
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.
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.
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.
2. When asked to choose the host name, enter tbdev1 and press Enter.
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.
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.
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.
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.
7. When asked, “Do you want to use a PPP connection to install the system?”,
select No.
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:
5. When asked to select a country, select your country and press Enter.
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.
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.
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:
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.
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.
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,—
"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.
"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.
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.
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.
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.
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:—
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.
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.
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:—
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.
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.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.
• 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 comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
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.
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.
ebookultra.com