Embedded Linux Hardware Software and Interfacing R Hardware Software and Interfacing Hollabaugh - The ebook in PDF and DOCX formats is ready for download now
Embedded Linux Hardware Software and Interfacing R Hardware Software and Interfacing Hollabaugh - The ebook in PDF and DOCX formats is ready for download now
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?
“I will tell you just what is the matter with us,” said Jonas. “We have
not got a rabbit’s foot between us.”
“Now did anybody ever hear of such luck?” said Jonas, in disgust. “I
have a rabbit’s foot and so have you; and by leaving them at home
is what has beaten us. We will go down there to-morrow or next day
and see what luck we shall have.”
“Do you reckon that Nat has one of them!” repeated Caleb, who was
greatly relieved to know what it was that had brought them such ill
luck. “Of course he had, or he never could have called upon them
ghosts to help him.”
“Dog-gone such luck,” repeated Jonas, who kept turning this matter
over in his mind. “He wouldn’t go away and leave his rabbit’s foot
behind when he was engaged in such business, would he? I tell you
I am going to keep it in my pocket wherever I go. It ain’t safe to be
without it.”
It was a long way by the road to the place where they had left their
horse, and every step of the way they looked at the bushes fearful
that Nat would come out at them accompanied by one or more of
the ghosts. When they reached the wagon Jonas climbed in without
any words, leaving Caleb to turn the horse around, and to take care
of his rifle which he hastily handed to him.
“I think I will drive going back,” said he, “He is going toward home
now, and perhaps I can make him step pearter than you did.”
Caleb saw through his father’s little trick, but he gave in to it without
saying a word. He was going to have the handling of the rifle now,
and he breathed a good deal easier as he clutched the weapon and
seated himself on the seat beside Jonas. He did not care if Nat had
three or four ghosts to back him up. He was a sure shot with a gun,
and he was certain that there would be one ghost less in the country
should one show himself.
The old horse stepped out wonderfully under the new driver, and it
was not long before Jonas’s courage all came back to him and he
could talk about what happened there in Mr. Nickerson’s dooryard
without shouting himself hoarse.
“That there is what’s the matter with us, Caleb,” said he, turning on
his seat and greeting him with an approving wink. “It beats the
world, as long as I have lived in this country, that I did not think of
that rabbit’s foot before I left home. But we will try them again some
day—”
“It has got to be pretty soon too, pap,” interrupted Caleb. “Nat has
seen that money already. He has got it hidden somewhere else.”
“I believe you are right,” said Jonas, “or else how come that dirt on
his spade? And to think we had to give it up just on account of not
having that rabbit’s foot! These little things sometimes make big
changes in our affairs, Caleb?”
Caleb must have thought of this matter all the way home, but he
breathed a little easier when the ancestral roof came in sight. His
mother was there and she came down to the bars to lower them. As
the tired old horse entered the yard she looked at Jonas, but the
latter shook his head in a most discouraging manner.
“And just on account of leaving that rabbit’s foot behind,” said Caleb.
“I noticed them, and I had a good notion to holler at you and tell
you to take them with you,” said Mrs. Keeler. “But I supposed that
you knew what you were doing.”
None of the family said anything more until they had got to the barn
and turned the horse out, and fed him with a handful of grass, and
then Jonas seated himself on a bucket, which he turned upside
down, and gave his wife a full history of the events that had
happened to them since they went away in the morning; that is he
had the groundwork of truth for its foundation, but there was many
a little item which he put in that occurred to him as he went along.
Whenever he touched upon anything which his wife found it hard to
believe, he always appealed to Caleb, and the latter never failed to
corroborate all he said.
“And do you think that he got those spirits to help him when he
went into the bushes?” asked Mrs. Keeler.
“He did; else why didn’t he make some noise while he was going
through them?” asked Jonas, in reply. “He went along as still as a
bird on the wing. It was of no use for anybody to try to follow him.
Well, that is once we failed, but the next time we will fight him with
his own weapons. Caleb, don’t you forget those two rabbits’ feet the
next time we go.”
“Here goes,” said Nat, to himself. “If I fail they can’t any more than
whip me, and if I get away—”
Nat did not wait to finish all the sentence that was in his mind. He
bounded from his place as if he had been set upon springs, a short
skirmish with Caleb who was overturned as easily as a child, and he
was safe in the bushes which closed up behind him, and the twigs in
his path seemed to give away before him on their own accord. He
ran down the path with all the speed he could command, jumped as
far to the left as he could and stretched himself out flat on the
ground and waited to see what was going to happen. By the merest
accident he lay down not ten feet from his camp, and consequently
he was within full hearing of their voices while they remained there.
“He has got my shoes,” said Nat to himself, and it was all that he
could do to refrain from speaking the words outright. “Give him a
few good licks to pay him for that.”
But we know that Jonas did not use the switch upon Caleb, but
talked with him about other matters. He knew when they examined
the spade again to find the dirt upon it, but all thoughts that they
would pursue him were turned into another channel by Caleb’s
request: “Let us go home. This is no place for us.” But there was
another fear that came over him just then. They were going home,
but they intended to remove everything there was in his camp,
provisions and all, and leave Nat to get along as best he could.
“Never mind; I’ve got my money in my hat,” said Nat, pulling off the
article in question and feeling of his roll of bills. “And even if he robs
me, what harm will it do? I have some more money stowed away,
and it is where nobody can find it.”
Nat lay there in his concealment and waited patiently for Jonas and
Caleb to get through with picking up the articles they wanted to take
with them and leave the camp. He knew they would not come back
through the bushes, but would go across the field and so steer clear
of them. He drew a long breath of relief, and finally raised himself
upon his knees as they passed out of the ravine, but still he did not
think it wise to show himself until the creaking of wheels, loudly
proclaiming their need of wagon grease, was heard, slowly at first,
then increasing in volume as the horse responded to the whip, and
when it had died away entirely he got upon his feet and made his
way back to the camp. Everything that could have been of use to
him had disappeared.
“Now the next thing will be something else and what shall it be?”
said Nat, throwing himself upon his bed of boughs and turning the
matter over in his mind. “I can’t live without something to eat—that
is plain enough to be seen; and I don’t know about going down to
Manchester for more grub. Of course somebody there saw Jonas
when he came through, and what kind of an excuse will I make for
coming back there after more provisions! I have told so many lies
lately that I want to keep out of it now, if I can.”
For ten minutes Nat laid there trying to make up his mind what to
do, and then got up prepared for action. He wanted to see where he
had left his money, and then he would go on to Manchester and be
governed by circumstances. If Jonas had not stopped there to
converse upon his object of going to old man Nickerson’s fields, well
and good. He would purchase some new clothes, the first he had
ever owned, enough crackers and cheese to last him on his way to
St Louis, come back to his camp after dark, secure his money, and
then the place which had known him so long would know him no
more forever. When be was away among strangers and nobody
knew who he was, he would be ready to begin his life over again.
“That is what I will do,” said Nat, wending his way up the hill. “My
first thing must be to get some new clothes, or when I come to put
that money in the bank they will think right away that I have stolen
it, and there will be more trouble for me. I should not dare to send
for anyone here to prove who I am, for they would turn me out the
biggest rascal upon earth, so that they could get the money; so
what should I do? By George! I am not out of trouble yet.”
In a few minutes Nat arrived beside the log under which he had
buried Mr. Nickerson’s money, or rather he called it his own money
now, and everything looked just as it did when he left there. No one
had been near it. He threw some more bushes over the place, kicked
some leaves around it and then set out for Manchester. He felt his
responsibility and it is not right to say that he carried a light heart
beneath his jacket, for he did not. He began to see that there was a
big difference in wishing for money and having it. He found that it
was some trouble to take care of his treasure.
He shortly reached the road near the spot where Jonas and Caleb
had left their horse, but there was no one in sight. He climbed over
the fence and kept on his way, looking neither to the right hand nor
the left, so impatient was he to reach his journey’s end, and finally
he stood in the store where he had been several times before; but
he did not know what those two men in the back part of the store
were talking about. They looked up as Nat entered, and instantly a
smile overspread their faces and one of them hastened forward to
greet him.
“Well, if here ain’t that smart looking boy again I don’t want a cent,”
said he, and he was so pleased to see Nat that he laughed all over.
“Say, Jonas and Caleb have just been here, and I would like to know
what made them leave in such a hurry. They did not see any ghosts,
did they!”
“No,” said Nat, in disgust. “Have you been treating them to some
stories, too? They left some work to do back at home, and went
there to attend to it. You scared one fellow out but you can’t scare
me out.”
“I never was so sorry for anything in my life,” said the man. “I saw
that Peleg could be easily frightened, and so I started that ghost
story on him.”
“Have you got anything to eat in the store?” asked Nat, who did not
want to talk about the ghosts any more. “They took away all the
provisions I had.”
“Of course we have,” said the man briskly. “What do you want? Say.
Did you find that money you were looking for?”
“See here, Nat,” whispered the man, putting his face close to the
boy’s ear and holding his arm, “if you will tell me where that money
is—”
“I tell you I don’t know anything about it,” declared Nat, pulling
away from the man’s grasp. “If you don’t want to sell me some grub,
I will go elsewhere.”
“Say what you have got to say right here,” said Nat. “There is no
secret about it. I dug up no money while I was there, and I don’t
care who knows it.”
At this moment the door opened and the customer came in. He, too,
was in the plot if such it could be called, for he evinced no surprise
at what he saw.
“Is the way all clear?” asked the storekeeper.
“We’ll take him back in the storeroom and shut him up there,” was
the answer. “What do you think of that, my boy? There you will wait
until you are ready to reply to such questions as I ask you, with a
big bull dog to keep an eye on you. If you try to get out there won’t
be anything left of you in the morning.”
While the man was talking in this way he was dragging rather than
leading Nat toward the back part of the store, and at last halted in
front of a door where he released him, and began searching in his
pockets to find the key. It was dark in there, owing to the fact that
there were no windows to let in light upon the scene, and when he
found the key and inserted it into the lock, a growl followed by a
deep-toned bark came from the inside. The animal that uttered it
must have been fierce; that was easy enough to be seen.
“Now you see what you’ll get if you try to get away,” said the
storekeeper, throwing open the door. “I reckon you will think twice
before you come any of your tricks on Benny; hey, old dog.”
“I tell you I don’t know anything about that money,” said Nat, who
was quite alarmed at the idea of being shut in that room over night
with such a dog for a companion. “I will go up there with you and
help you dig for it; that is if you think it is in the ground.”
“Very well; then you can stay here until you find out,” said the man,
fiercely. “When you get so hungry and thirsty that you can’t stand it
any longer, you just yell and I will be around. Will you tell us?”
“Well, good-by,” said the man, moving toward the door. “We are
going up right now to look for it, and when we come back, perhaps
we will tell you how much we have made. Watch him, Benny. Keep
an eye on him, and if he goes near that window, just take him down
and serve him the way you did that burglar that got into the store
last week.”
With this parting advice to his dog the storekeeper went out
followed by his customer, and Nat heard the key as it grated harshly
in the lock. He sat perfectly still, he was afraid to do otherwise, for,
now that his eyes became somewhat accustomed to the darkness,
he could see that the dog kept his position beside the door, and
seemed to be awaiting some move on his part. Once or twice he
licked his huge jaw as if he were tired of waiting.
“Well, sir, I am in for it now,” said Nat, running his eye along the wall
as if he were looking for that window of which the storekeeper had
spoken. “I would not be safer if I were shut up in jail. That dog—
Whew! I don’t want anything to do with him.”
The dog evidently knew what opinion Nat cherished toward him, for
after waiting in vain for him to make some advances, he came over
to Nat and laid his chin upon his knee. Nat could hardly keep from
yelling when he saw the dog advancing toward him, but when he
reached the boy and worked his nose as if he were trying to place
his hand upon his head, his heart gave a thrill of delight.
Nat had never been more astonished in his life. The dog’s
appearance was against him; but that was as far as it went. He was
a good, honest dog in reality, and seemed to sympathize with Nat in
his trouble.
“Benny, good Benny; I believe you are a good dog yet,” said Nat,
reaching down and patting the animal on the side. Benny not only
submitted to it, but when he saw that Nat was about to stop he
worked his nose again as if he meant him to continue. “I believe
now that I will try that window,” said Nat, a bright idea striking him.
“Since Benny is all right if I sit here, he will be all right if I move
around.”
Nat had by this time located the window, and he arose from his box
and moved toward it as though he had a perfect right there. Benny
moved with him, and did not raise any objections when Nat seized
the staple with which the window was fastened and exerted his
strength to open it. It was a heavy window, and was doubtless used
for passing in and out bulky goods that would take up too much
room in the store; but it yielded to Nat’s muscle at last, and by
pushing it open a little way he let a flood of light into his prison and
could also see what there was outside. He found that the opening
gave entrance into a kind of stable yard, bounded by a shed on one
side, and by pushing it open a little more, he saw that on the other
side it ran down to the street. His escape was now only the question
of a few minutes had he cared to leave at this time.
Nat now felt at ease. He pulled off his hat, felt of his roll of bills and
then began to pat the dog and talk to him. He had certainly
determined on one thing and that was to take the dog with him. He
had some money, how much he did not know, and it would be the
source of immense relief to him to know that he had someone
whose looks would help him through.
“I will bet that there won’t be anybody pitch into me to see what I
have got with me, if he only takes one look at you,” said Nat,
stroking the dog’s head. “I never had a dog take up with me this
way before. I tell you, Benny, you came in just right.”
It must have been two o’clock by the time Nat was shut up in that
room, so he had six or seven hours of waiting to go through before
the storekeeper would come around again to see how he felt over
telling him where he had left that money. There was one thing about
it: He would not tell him; he would die first He kept repeating this
resolution over and over again until the sun went down, and it
began to grow so dark in his prison that he could not see his hand
before him. An hour passed, and then a key rattled in the lock, the
dog gave one of his tremendous barks and took his stand in front of
the door, which presently opened admitting somebody, it was so
dark that he could not see a single feature on him. But it was the
storekeeper. He knew him as soon as he spoke.
CHAPTER XV.
Nat Wood, Gentleman.
“I could not possibly think of it,” said the man, with a laugh. “You
think you are smart, don’t you! We know where that money was
hidden, and we have been up there and got it.”
It was lucky for Nat that the storekeeper had come in there without
a light, for the way these words were spoken fairly took his breath
away. This was something that he had not bargained for. He settled
back on his box trying to find something to lean against, and could
not say anything to save his life.
“What do you say to that, my boy?” asked the man. “You did not
know that we could find that money without asking you, did you?”
“Oh, we found it under a tree where the old man had left it,” said
the storekeeper, carelessly. “I tell you he must have gone down
deep, for we dug a trench there that was as deep as we were.”
“Well, you have done more than I could do,” said he, after thinking a
moment. “You have the money—How much did you get?”
“Oh, about fifteen or twenty thousand dollars,” replied the man. “We
were in such a hurry that we didn’t stop to count it. But we have
enough to keep us without work as long as we live.”
“I forgot to speak about that to my pardner,” said the man, who was
taken all aback by this proposition. “And he has gone away and I
shan’t see him for a week.”
“We might as well. You see we don’t want you to go up and tell
Jonas and Caleb about this thing, for they might make us trouble.”
“I’ll promise you that I shall not go near Jonas and Caleb. I want to
get as far away from Manchester as I can. You might give me
something to eat, any way.”
“Well, I will see what my pardner says about it. If you keep still—”
“I mean when he comes back. It won’t take you long to stay here a
week. Now if you keep still—”
“Are you going to keep me a whole week without anything to eat?”
asked Nat, in surprise. “I can’t possibly live as long as that.”
“Maybe my pardner has not gone yet, and I can speak to him. Now
if you keep still, that dog would not pester you; but if you get up
and go to roaming around, he’ll pin you. Then you won’t tell me
where the money is—humph!”
This was another evidence that the man had not been near the
place where the money was supposed to be hidden. He came pretty
near letting the cat out of the bag that time. Nat did not say a word
in reply. He wanted the man to believe that he put faith in his story.
“What have I got to say? You have found the money, and what more
do you want?”
The man muttered something under his breath that sounded a good
deal like an oath by the time it got to Nat’s ears, turned on his heel
and walked out, slamming the door after him. Nat waited until the
sound of his footsteps had died away, then threw himself back on his
box and laughed silently to himself.
The time now seemed longer to Nat than it did before. He felt at his
ease, and he longed to be up and doing. Every minute that he
lingered in his prison-pen was just so much taken away from the
enjoyment of his money; and he fretted and chafed over it. He
wanted to get up and pace the room in order to make the time pass
more rapidly away, but was checked by the thought that the
storekeeper might come back there and listen at the door to see
what he was doing, and thus put it out of his power to escape by
the window.
“If he hears me walking about he will know that Benny and me are
all right,” said Nat, “and that will arouse his suspicions so that he will
put me somewhere else. I reckon I had best sit down here on my
box and wait for the hours to go by.”
This happened two or three times, and on each occasion Nat was
sure that he was being watched; but every time the watcher went
away without hearing or seeing anything suspicious. At last Nat
heard some sounds coming from the store which indicated that the
proprietor was going to shut up for the night; and then his heart
began to beat more rapidly. The time for action was fast
approaching. He heard the banging of shutters, the goods which had
been outside for inspection during the day, were brought in and
stood up beside the counter, and finally the storekeeper’s tread was
heard outside the door. He tried the lock and found that it was safe.
“As tight as you please,” answered Nat; “but in half an hour more I
will be down the road,” he added, to himself.
“You don’t know anything about that money yet, I suppose?” said
the man.
“How can I know anything about it when you have got it?” asked
Nat. “You have hidden it away somewhere. The best thing you can
do is to take it up and clear yourself before I get out.”
“You are going to make trouble for me, are you?” said the voice,
angrily. “Well, if you get tired of waiting for grub just let me know.
Good-by.”
“Good-by. And it will be a long time before you see me again,” said
Nat mentally.
Nat knew when the storekeeper went out and locked the door
behind him, and then he heard him go down the street. He knew
that he did not sleep in the building but his house lay at some
distance from the store, so the coast was clear at last. He resolved
to make the attempt at once, being satisfied if he were well on the
street it would take a better man than the storekeeper to overhaul
him. It was but the work of a few seconds to go to the window and
remove the hasp with which it was confined. As the shutter swung
loose he found that the moon was shining brightly and that the ten
miles that lay between him and Pond Post Office could be made
easily as it could by broad daylight.
“Come along, Benny,” said Nat placing both hands upon the sill and
springing up so that all he had to do was to drop his legs outside.
“But maybe you don’t want to go.”
While Nat was talking about it he was free; and he afterward said
that he never felt anything so good as he did when he found the
solid earth under his feet once more. The dog made three attempts
to follow him, but the window was rather high and all he could do
was to get his fore feet upon the sill and each time he fell back
making more noise than was agreeable to Nat. The next time he
tried it Nat seized him by the thin skin on the back of his neck, and
in a moment more he was standing by Nat’s side on the ground. We
say he was standing by Nat’s side; but if the truth must be told, he
was prancing around all over the ground as if he were overjoyed at
finding himself at liberty once more.
“I will tell you what’s the matter with you,” said Nat, after he had
looked carefully around him and had drawn a bee-line for the bars
that led him out into the street. “You have been shut up and
deprived of your freedom so long that you don’t know what to do
with yourself when you are let out. Well, you stick to me and I will
see that you are not shut up any more.”
Nat’s first impulse, when he found himself outside the bars, was to
strike up a whistle; but before the first note had fairly left his lips he
caught his breath and looked all around to see if there was anybody
within hearing. The street was silent and deserted; but that was no
sign that there was not somebody stirring in the houses by which he
passed so rapidly. He felt of his roll of bills to make sure that he had
it, and settled down into a good fast walk, turning his head
occasionally to be certain that he was not followed. There was one
thing that Nat kept saying to himself: “I have had a struggle for this
fortune, and now that it is fairly within my grasp, nobody need think
that I am going to give it up. If I don’t enjoy it, the money can stay
there until it rots.”
The next thing that Nat had to decide upon was, as he expressed it,
something else. He was free but his money was not free. The way to
get his fortune to St. Louis was what troubled him; and he thought
about it until he arrived within sight of Pond Post Office. He began to
feel sleepy, too. It was then about two o’clock, so that he had to
wait for five long hours before the single store of which the village
could boast would be open and ready for business. So he climbed
the fence, followed by the dog, found himself a comfortable place
under the protection of a beech tree and stretched himself out and
prepared to go into the land of dreams. That would have been
considered a hard couch by some lads who are raised in the city, but
Nat had so long been accustomed to hard things that he did not
mind it. He slept until the sun was well up, and his dog kept watch
over him.
“Now the next thing will be something to eat, Benny,” said Nat,
pausing for a while in his operations of smoothing down his hair to
pat the dog on the head. “I think you could eat a good breakfast,
don’t you? I tell you what we will do: If they don’t have anything at
the store worth eating, we will go to someone’s house and ask for a
meal. I’ve got money to pay for it.”
Nat’s next duty was to take out his roll of bills and select enough to
pay for his clothes and have a little left over for a bite to eat. When
this had been done he put the balance of the roll back again, and
the rest into his pocket where it would come handy. Then he climbed
the fence and started for Pond Post Office again. He found very few
people stirring there but the groceryman was up, and to him Nat at
once addressed himself.
“You look as though you had something to eat here,” said he.
“Well, yes; that’s our business,” said the man, smiling upon Nat.
“Gracious! What a horrid looking dog. Will he bite?”
“Not while I am around,” said Nat. “Have you got a suit of clothes!
You see I need one badly enough.”
“Well, I should say you did. I was looking at your clothes when you
came up. How big a priced one do you want! We have some for
$5.00 and some as high as $20.00.”
Nat had never bought any clothes before, and consequently he was
rather awkward about it. As far as he could see the clothes were
well made (the man took his measure around the chest and of the
length of his leg to make sure that they would fit him) the price
suited him and he took them on the spot. Then he needed a couple
of shirts, two pairs of stockings and a pair of shoes and a hat; all of
which he took upon the man’s recommendation, and so his trading
was quickly done.
“Now I wish to get a couple of valises to put them into,” said Nat,
looking around the store and trying to select the articles in question.
“One’s going to be enough for you,” said the man. “Now here is a
valise—”
“That is not the kind I want,” said Nat. “I want some old-fashioned
carpet things, with a mouth like a catfish. You see I have lots of
things to carry with me.”
“Are you going to walk?” asked the storekeeper, still more amazed.
“Why, it must be as much as one hundred and fifty miles.”
“I don’t care how far it is, I have got to go there, unless I can find
some person who is kind enough to give me a lift.”
“You can do that, of course; but I was just thinking that your legs
will ache before you get there. Now you hold on a minute. I have
two old carpet sacks in my garret that are doing no good to
anybody, and if you will wait a minute I will bring them down to
you.”
The man went to his drawer, put away the money that Nat had given
him and went out, leaving him for the next ten minutes there alone
in the store. What a chance it would have been for Nat to steal
something; but the thought never came into his head. He was
leaning back against the counter when the man left, and that was
the way he was standing when he came back.
“Those are just the things,” said he, taking the carpet sacks and
turning them over to see that there were no holes in them. “How
much apiece for them?”
“Oh, a quarter; or, as you were raised in this country, two bits,” said
the storekeeper, smiling at Nat. “How do I know that you were
raised in this country? I know it by your looks. I was raised in New
York. Now do you want something to eat? Well, come here. I don’t
know whether I have anything that dog will eat or not. Where did
you get that fellow? He would be just the one to guard a fellow’s
melon patch, wouldn’t he? There, take your pick. It’s my treat.”
Nat knew enough about the ways of the country to know that the
storekeeper was going to give him his provisions for nothing because
of the dry goods he had purchased. The only things he could find
were some crackers and cheese. He took enough of them as he
thought to last him to Manchester and back, and then the
groceryman excused himself once more and went into the back
room with a huge knife in his hand. When he returned he brought
with him a piece of fresh meat which he handed to the dog.
“I did some butchering yesterday, and I think that if that dog won’t
eat anything else, he will eat fresh meat,” said he. “See him take it
down.”
The dog did “take it down” and devoured his meal as if he were
almost starved. It was no wonder that he wanted Nat for a master
when he was going to get such good living as this. He put all the
things he had purchased into one of his valises, bade the proprietor
good-by and took his way back toward Manchester, feeling much
lighter hearted than he did when he came down. But he did not go
very far before he began looking up and down the road to see if
anyone was watching him; and having satisfied his mind on this
score he once more climbed the fence into the woods, and when he
was safe from everybody’s view he stopped, and lowered his bundles
to the ground.
“Now when I put these things down I am Nat, the tramp; and when
I put on my other clothes, I am something else,” said he, taking his
suit out and unfolding it before him. “Let us see how it looks to be
dressed up as a white man.”
This was Nat’s object in getting so far away from the road so that he
could make a change in his appearance. To take off the clothes he
then had on did not require a second’s time, but it took more time
than it did to put on the others. In fifteen minutes he was all
dressed, and then he wished he had a looking glass to view himself.
He certainly did look like a different person; and it is doubtful if any
one who was acquainted with him had met him on the road, if he
would have recognized him. His first care was to put what remained
of his roll of bills safe in his vest pocket. There were no holes in the
vest for the bills to work out, and when Nat tucked them away he
felt that he was somebody.
Having put away his old clothing in one of the valises—it is true the
clothes were old but they might be of some assistance to him some
day—he took a carpet sack in each hand and kept on his way toward
Manchester. The dog did not know hardly what to make of it. He
looked at Nat closely; for several minutes before he would follow
him, and then he seemed to think it was all right and ran on as
freely as he did before.
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.
ebookultra.com