100% found this document useful (1 vote)
25 views

Embedded Linux Hardware Software and Interfacing R Hardware Software and Interfacing Hollabaugh - The ebook in PDF and DOCX formats is ready for download now

The document provides links to download various ebooks and textbooks related to embedded Linux and hardware interfacing. It includes titles such as 'Embedded Linux: Hardware, Software, and Interfacing' by Craig Hollabaugh and other recommended readings on microcontrollers and debugging. The document also outlines the structure and contents of the main book, detailing topics like system architecture, interfacing, and booting Linux.

Uploaded by

kuhtaantuza
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
25 views

Embedded Linux Hardware Software and Interfacing R Hardware Software and Interfacing Hollabaugh - The ebook in PDF and DOCX formats is ready for download now

The document provides links to download various ebooks and textbooks related to embedded Linux and hardware interfacing. It includes titles such as 'Embedded Linux: Hardware, Software, and Interfacing' by Craig Hollabaugh and other recommended readings on microcontrollers and debugging. The document also outlines the structure and contents of the main book, detailing topics like system architecture, interfacing, and booting Linux.

Uploaded by

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

Visit https://ebookultra.

com to download the full version and


explore more ebooks or textbooks

Embedded Linux Hardware Software and Interfacing R


Hardware Software and Interfacing Hollabaugh

_____ Click the link below to download _____


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

Explore and download more ebooks or textbooks at ebookultra.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

PIC microcontroller an introduction to software and


hardware interfacing 1st Edition Han-Way Huang

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

The Lab Manual to Accompany The 8088 and 8086


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

Energy Efficient Hardware Software Co Synthesis Using


Reconfigurable Hardware 1st Edition Jingzhao Ou

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

Hardware and computer organization the software


perspective Arnold S. Berger

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

Dedicated Digital Processors Methods in Hardware Software


Co Design 1st Edition F. Mayer-Lindenberg

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

Analog Interfacing to Embedded Microprocessor Systems 2nd


ed Edition Stuart Ball

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

So You Wanna Be an Embedded Engineer The Guide to Embedded


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

Debugging The Nine Indispensable Rules for Finding Even


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

Embedded
Linux:
Hardware,
Software, and
Interfacing

Boston • San Francisco • New York • Toronto • Montreal


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

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

Pearson Education Corporate Sales Division Proofreader


Juli Cook
201 W. 103rd Street

Indianapolis, IN 46290 Technical Editor


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

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

Text printed on recycled paper

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

First printing, March 2002


Contents at a Glance

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

Part I Getting Started


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

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

Introduction 1

Part 1 Getting Started 5

1 Introducing Embedded Linux 7


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

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

3 Selecting a Platform and Installing Tool Sets 21


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

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

Part II Interfacing 139

6 Asynchronous Serial Communication Interfacing 141


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

7 Parallel Port Interfacing 161


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

8 USB Interfacing 205


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

9 Memory I/O Interfacing 227


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

10 Synchronous Serial Communication Interfacing 277


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

11 Using Interrupts For Timing 321


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

12 System Integration 367


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

13 Final Thoughts 399


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

Index 405
Foreword

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


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

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

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


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

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

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

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

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


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

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

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


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

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


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

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

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


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

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

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

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


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

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


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

Benefits of This Book


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

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

What This Book Covers


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

The following text briefly summarizes each chapter.

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


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

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


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

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

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

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

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


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

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


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

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

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


StrongARM and PowerPC target boards’ CPU buses.

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

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

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

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

Who This Book Is For


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

Conventions Used in This Book


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

The typographical conventions used in this book include the following:

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

• Commands you type appear in a boldfaced computer font.

• Italics are used to introduce you to new terms.

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

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

IN THIS PART
1 Introducing Embedded Linux

2 System Architecture

3 Selecting a Platform and Installing Tool Sets

4 Booting Linux

5 Debugging
This page intentionally left blank
1 IN THIS CHAPTER

• Why Linux, Why Now?


Introducing Embedded • What Is an Embedded

Linux System?

• What Does Real-Time Mean?

• Implications of Open Source


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

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


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

Why Linux, Why Now?


Microprocessor industry advances form the foundation for
using Linux as an embedded operating system. Gone are
the days of embedded designs that use 4- or 8-bit micro-
processors; today it is just as easy and cost competitive to
Other documents randomly have
different content
beat a hasty retreat from the camp, following the course that Peleg
had pursued when he was there on a former occasion. They reached
the bars, stopping now and then to cast furtive glances behind
them, and when they got fairly into the road their courage began to
return to them.

“I will tell you just what is the matter with us,” said Jonas. “We have
not got a rabbit’s foot between us.”

“I do think in my soul that that’s what’s the matter,” said Caleb,


stopping short and looking at his father. “Do you reckon that Nat has
one of them?”

Now a rabbit’s foot is something that is held in high esteem by the


negroes at the South, and by some of the white people, too.
Whenever you kill a rabbit, take one of the feet off and put it into
your pocket; or, if you are already provided for in that respect, take
the foot and give it to some one who has not got any. Thus
equipped you are free from every danger. Ghosts can not disturb
you, and if you have to pass a graveyard or a house that is haunted
after dark, it will see you safely through. Beyond a doubt this was
what was the matter with Jonas and his son. They had thought of
their rabbit’s feet when it was too late to be of service to them. They
were kept at home on the mantle piece, snugly stowed away so that
they could be seized at a moment’s warning, and they had come
away and never thought a word about them.

“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.

“I just knew how it would be,” said she.

“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.”

“You bet I won’t,” replied Caleb.


CHAPTER XIV.
The Storekeeper in Action.

N AT’S heart was in his month because he did not believe he


could escape from Jonas, and Caleb so easily. The noise he
necessarily made in running through the bushes would naturally
guide them in the pursuit, and Jonas was noted for his lightness of
foot, and Caleb also, for that matter. But it was now or never. The
switch was being prepared for him, and in a few minutes more he
would feel the full weight of Jonas’s arm; and that it would fall by all
his strength, Nat did not doubt in the least.

“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.

“By gum!” said Caleb, slowly, as he picked himself up from the


bushes into which he had been thrown. “Pap, he has got away.”
He heard Jonas when he came around the trees and knew when he
raised the switch intending to use it on Caleb for not keeping guard
over Nat. He listened in the hope that Caleb would feel the full force
of that switch, for he had a long account against him and he did not
think that any blow he could have received would have been amiss.

“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?”

“What money?” asked Nat, in surprise.


“Oh, come Nat, there is no use of your trying to play off on us in
that style,” said the storekeeper; and there was just a shade that
darkened his brow as if he were getting angry. “You went up there
to dig up some money, didn’t you, now?”

“I wish you would give me those provisions and let me go along


back,” said Nat, who did not much like the way the man eyed him. “I
don’t know anything about any money.”

“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.”

“Come with me; I want to see you,” whispered the storekeeper,


retaining his hold upon Nat’s arm and drawing him toward a side
door.

“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.”

“But I don’t want that everybody should know what I am going to


say to you,” urged the man; and as if to add emphasis to his words
he seized the boy with both hands, fairly lifted him from the floor,
carried him through the side door which closed behind him. “Now
will you listen to what I have to say to you?” he added, with a
wicked glitter in his eye. “I have got you now, and here you are
going to stay as long as I want you.”

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.

“Yes; there is no one on the streets,” replied the customer. “Now


what be you going to do with him?”

“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.”

Nat’s heart seemed to stop beating. If there was anything in the


world that he was afraid of it was a savage dog. He looked at Benny,
and rightly concluded that “he would not come any of his tricks” on
that beast. He was the worst looking dog that Nat had ever seen. He
was small, but he had an immense head, and his under jaw stuck
out so that his teeth could be plainly seen. He was yellow all over
except his head, which was as black as if he had been painted, and
he was bob-tailed. He did not appear to be gratified by this intrusion
at all. He would hardly get out of his way when the man pushed him
aside and pointed to a box and told Nat to sit down there.

“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.”

“Of course we know it is in the ground or else you wouldn’t need a


spade and pick-ax to throw it out with,” answered the storekeeper.
“You tell us where it is, and let us go up and dig for it.”

“I can’t tell you for I don’t know;” said Nat.

“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?”

“I have already answered your question until I am tired of it,” said


Nat, seating himself on the box, with a determined look on his face.
“If I stay here until I die you won’t get anything else out of me.”

“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.

“Well, by gum!” said Nat, unconsciously making use of the same


expression that Caleb had used when Nat threw him headlong into
the bushes. “I believe the dog is friendly;” and he raised his hand
and placed it on the dog’s head.

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.

“Glory!” whispered Nat, closing and fastening the shutter and


stooping down to caress Benny. “I dare not try it now, for fear that
that storekeeper may be on the watch; but when it comes dark, we
won’t stay in this house any longer. Hail! Columbia happy land!”

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.

“H I there!” exclaimed the storekeeper, as he threw open the


door and stepped over threshold. “Keeping watch over him
yet, ain’t you, Benny? I told you it wouldn’t be safe for you to try to
get away. Yes, here’s some supper for you, Benny. Nat can’t have
any until he gets ready to talk to me. How do you come on, Nat?”

“About as comfortably as I can, kept here in the dark and with a


savage dog for a companion,” said Nat. “I wish you would take me
out where it is a little lighter.”

“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?”

“Where—where did you find it?” stammered Nat, suppressing his


excitement, and it was all he could do to utter the words.

“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.”

Nat straightened up again and drew a long breath. If the


storekeeper told the truth, he had not yet found the money. He had
not dug in the place where it was concealed in the first instance,
because he did not say anything about the stone which needed a
lever to pry it out of its bed.

“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.”

“Now what is to hinder you from turning me loose?” asked Nat “I


can’t do you any more good by staying here.”

“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.”

“And are you going to keep me here all that time?”

“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—”

“Why, your partner has gone away,” said Nat.

“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.

“Well, good-by. I shall not be in here before to-morrow morning; and


if you have anything to say to me—”

“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.

“If everybody is as big a fraud as that man, my money is safe,” said


he, rubbing his hands together. “He has found the money, and yet
he wanted me to tell him where it was. Now, Benny,” placing his
hand upon the dog, which just then came up and put his head upon
his knee. “We will wait until twelve o’clock, and then we will start for
Pond Post Office. I know it is a small place but I reckon I can get
some clothes there, and a couple of big valises that I can carry my
money in.”

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.”

A short time afterward, perhaps it was two or three hours, he heard


a faint rustling outside the door, whereupon the dog left him and
took up his stand directly in front of it to see what was going to
happen. If it was the storekeeper and he wanted to know what was
going on in the room, he had his trouble for his pains. Whatever it
was that made the noise outside it finally ceased altogether and
then everything was quiet.

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.

“Are you all right in there?” Nat heard him inquire.

“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.”

“Let me see a sorter of betwixt and between,” said Nat, as he


followed the man into the store. “Something that will do to wear
between here and St. Louis.”

“Are you going as far as St Louis?” asked the man, in amazement.


“Then you want something pretty nice. Now there’s a suit that will
jest suit you.”

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.

“Now I am Nat Wood, gentleman,” said he, as he surveyed himself


as well as he could by turning first one leg and then the other to
make an estimate of himself. “I tell you it makes a fellow feel grand
to be dressed up as I am. Supposing Caleb should see me now?
Whoo-pe! He would not rest easy until he got these things on his
own back.”

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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like