Вы находитесь на странице: 1из 8

April 18, 2001

Embedded Linux Reference Guide

A Lab Manual for Embedded Linux Developers

Book Outline - Thomas E. Besemer


Revision History



Initial generation; provides overview, next step is better chapter organization. I would not call this the best example of how well I write - its an outline, and in such, first person is used often. Its a nice introduction into what I feel is important, and should give the reader some sense of my organizational skills. I can supply sample chapters to give a better sense of writing style. Removed much detail from Chapter outlines, providing a more concise overview. Still a bit rough.



1.0 Introduction
This document serves as a working outline for the Embedded Linux Reference Guide, written by Thomas E. Besemer. Copyright 2001 Thomas E. Besemer. The target audience for this outline is publishers evaluating the viability of publishing this book, and marketing people who will manage the marketing aspects of this book. Additionally, if during generation of the manuscript proper, changes in concept or material are required, this outline will be updated, and used to evaluate how to handle the suggested changes. 1.1 Authors Bio Thomas E. Besemer has been involved in the Embedded Systems Industry for 20 years, and has worked as an independent consultant for the past 15 years. He attended Michi-

1 of 8

Book Description

gan Technological University for two years, and then left to build a Graphite Tool Bit Stacking Robot for usage with coating furnaces. During his career, he has worked as a hardware engineer, software engineer and program manager. He has ten years experience with VxWorks, and has worked with organizations to put together training programs (including full course development and presentation) which were deployed in the United States, Canada and Japan. He has spent the past 16 months researching the issues behind Embedded Linux, and has performed consulting for vendors and developers deploying and using Embedded Linux. Additional information about him may be found at his web site: http://www.tbcorp.com

2.0 Book Description

The Embedded Linux Reference Guide is designed to be just that: a clear and concise reference book for developers of Embedded Linux Systems. The following key subjects are covered by this book:

Architecture models; state driven versus client server. Overview of the GNU tools, such as cc, ld, as and objcopy, as applied to embedded

Understanding the boot process by linux; low level boot as well as system initialization and start-up.

Managing interrupts; when to process at the device driver level, versus when to process at the application level, and how to make the decisions on partitioning (and then how to do it).

Building binaries from the output of the standard linux makefiles, and how to put
these binaries into ROM.

Discussion on how to debug both drivers and applications. How to reduce the footprint for ROM based systems. How to bring up httpd (Apache) servers for Internet Appliances. How to do RAM disks and NFS Root based development environments; mostly, how to configure a development versus production environment. sus a Flat memory model.

Introduction to the Linux Memory Model; whats the big deal about the MMU ver Reference in System V IPC - the quick guide to using System V IPCs. Reference to Posix Thread and Semaphores; how to use them to build a system
model within a heavy Linux process. The discussions for each subject are supported through tested and working examples which are contained on a CD ROM which is included in the book. Additionally, numerous drawings are provided to help the reader visualize the concepts behind the discussions and code examples. Figure 1 provides an example of a typical drawing; in this

2 of 8

Embedded Linux Reference Guide

Book Description

case, this drawing is used in a section which discusses the operation of shared memory between two Linux processes.

Process A
Text Data BSS Stack
Shared Memory Segment Shared Memory Segment

Process B
Text Data BSS Stack

Linux Kernel
MMU Scheduler I/O System Device Drivers

Target Hardware


Shared Memory Between Linux Processes

2.1 Target Audience The primary reader will be System Designers and Software Engineers. From a System Designers perspective, this book will aid in understanding how to approach designing an Embedded Linux System. Software Engineers will be able to use the book as solid reference for design and implementation of application code and support drivers. Hardware Engineers will find this book an excellent place to understand how Linux runs in any hardware environment, from system start-up to interrupts and device drivers. Program Managers will find it an excellent book to gain a high level understanding of the technology being used in an Embedded Linux based project.

Embedded Linux Reference Guide

3 of 8

Chapter Outlines

2.2 Key Problems Solved with the Embedded Linux Reference Guide The most notable set of issues which this book serves well at is that it provides a starting point for people who wish to deploy an Embedded Linux System. Using Linux in an embedded capacity is fairly new technology, so almost all users can be considered early adaptors. These users will first need to evaluate the viability of using Linux, as opposed to a commercial solution such as VxWorks from Wind River Systems. A glance through this book at the book store will clearly give the potential reader the confidence that they have valuable reference material to move forward with. Additionally, once a developer makes a decision to use Linux for their Embedded System, they will have dozens of working examples for every aspect of their project. Some examples:

For developers who will deploy a ROM based system, they can turn to Chapter 9 for
descriptions of approaches, and working examples of building binaries suitable for ROM, as well as how to handle boot.

For developers who have not worked with a MMU based system, with protected
memory space, Chapter 4 provides them with a picture from the sky discussion of the issues, while Chapter 5 provide them with working code examples.

For the Hardware and System Engineers concerned with boot and application
launch, there are clear examples.

If a Program Manager hears that there are some problems in routing interrupts to an
application process or thread, they can turn to the chapters on these topics, and gain enough understanding of the issues to help schedule the project, and make technical decisions. The key concept behind this book is in the tittle: Reference Guide. By the end of a project, this book will be worn out by being handled so much. Individual copies will have book marks in numerous places. When diagnosing problems during development and/or integration, the developer will be able to find clear examples of approaches to aid in diagnoses of the problems. There will be overlap with other books. For example, OReilly has books out on pthread programing, and Linux Device Drivers. These books have detailed information on these topics, but this book contains enough information that will ensure the developer does not need to run to the book store for several different books in order to design, implement and integrate.

3.0 Chapter Outlines

This section provides a breakdown of each chapter in the book. 3.1 Chapter 1 - Introduction The scope of this book is to provide a practical reference guide for engineers developing an embedded linux application. It is possible that Chapter 1 ends up being a preface; for all practical purposes, as a chapter, it introduces the reader to what is in the book. The following key topics are presented in Chapter 1:

4 of 8

Embedded Linux Reference Guide

Chapter Outlines

Overview of the Book Host Development Environment; RedHat 7.2. Target Development Environments; both x86 and PPC are used.
3.2 Chapter 2 - Architectures There are different types of system architectures in an embedded environment. The two most predominate are client/server stateless designs, and stateful event driven designs. This chapter introduces the reader to these approaches, and demonstrates architecture approach works best for varying system requirements. Key subjects for this chapter are:

State Driven Designs Client/Server Designs Mixed Mode Designs

3.3 Chapter 3 - Tools and Environments This chapter provides an in-depth breakdown of all of the key linux tools and facilities used to develop an embedded linux application, such as compiler, linker, library handling facilities and Makefiles. It establishes a baseline environment in which all of the book examples are based on and developed in.
3.3.1 Overview of Tools

Provides an in-depth discussion on each of the tools available in linux, and required for generation of an embedded linux application. The goal of this chapter is to provide the user with a firm understanding of the key tools used to build an application.

gcc ld as objcopy objdump ar nm

3.3.2 Debug Tool Overview

A discussion how what the embedded developer will face with linux. Kernel debug versus application debug, and it also touches on how to debug a ROM image. A starting point for the issues involved with debug of an embedded linux application, as well as an embedded linux project.

Kernel Debug Application Debug User Developed Tools

Embedded Linux Reference Guide

5 of 8

Chapter Outlines

3.3.3 Build Environment Overview

There are three significant build environments; the kernel itself, the application and libraries, and drivers. This establishes a baseline for the user, and introduces them to the native linux kernel build environment.

Dependency Generation Kernel Makefiles Application Makefiles Module Makefiles Managing Multiple Targets cscope Introduction to RCS and CVS

3.4 Chapter 4 - Linux API This presents the reader with the basic linux process and thread model, and describes the various facilities available to the reader/developer. It discusses threads versus processes, and how memory is handled in linux. For readers who have never used linux and/or Unix, this chapter presents the linux API model. For readers/developers coming from traditional environments, such as VxWorks or pSOS, this chapter serves to help them understand the differences from these traditional environments. This chapter is the picture from the sky view of linux, and is designed to be a preface to Chapter 5, which elaborates on details. Developers fluent with linux/Unix can skip this chapter. Key topics:

Linux Memory Model Process Memory Model Linux Processes Posix Threads Scheduling Priorities IPC

3.5 Chapter 5 - Infrastructure and System Calls Detailed This chapter details the key system calls a reader/developer will need to understand to implement an embedded linux application. It shows why and how the developer should put interface layers in to system calls (to aid in debug, which is discussed in subsequent chapters). Although Chapter 4 provides example code, this chapter provides advanced and detailed examples which help establish a developers baseline. All examples in this chapter, as in other chapters, are available on the CD supplied with the book; they can install this baseline in their system and have a turn key baseline to base their own development efforts on top of. Key topics:

Process Creation

6 of 8

Embedded Linux Reference Guide

Chapter Outlines

System V IPC Queues Semaphores Shared Memory Pthread Programing Timers and Time Management Interacting with Hardware

3.6 Chapter 6 - I/O and Drivers A chapter not meant to displace Rubini and Linux Device Drivers, but more the quick reference to I/O and Drivers. Developers need this chapter to understand when they will need a device driver, what type drivers are available, and how to approach using drivers in their application. Perhaps another name for this chapter is Rubini and Linux Device Drivers Applied (in an embedded application). This chapter will guide the reader through the process of determining what type Driver works best for their application. Three types of Drivers are covered:
1. Character 2. Block 3. Network

Additionally, discussions on the following:

Modules versus Linking with Kernel Routing Interrupts to Application Code Potentially, a discussion on PCI
3.7 Chapter 7 - Advanced Debug and Diagnostics Builds on top of Chapter 5 (and 4); shows how a big limitation with linux is lack of visibility when debugging a system occurs, and shows how the developer can design to debug in the linux environment. Lots of solid examples of how to instrument a system to get solid diagnostic information to aid in debug of a working (or perhaps better phrased, non working) system. My basic philosophy with embedded systems is dont build one you cant debug, but build one that gives you enough information that it basically debugs itself for you. This is born out of years of experience, and this chapter shows how it is done. Again, Design to Debug! Key topics:

Native/Public Tools for Logging and Visibility; sysklogd, DDD, GDB, LTT and

User Developed Tools for Logging and Visibility; a user shell, rooting around memory, attaching diagnostics to running processes. 7 of 8

Embedded Linux Reference Guide

Chapter Outlines

3.8 Chapter 8 - Libraries This chapter extends upon Chapter 3 and its discussion of tools. Libraries are a pretty big deal, and come in several flavors. They also can impact size of a final application, which is important for people building products such as PalmPilots or MP3 players, where reduced footprint is essential to product cost issues. Key topics:

Linux Libraries Static Linking versus Shared Libraries Building Libraries Adding Libraries Footprint Reduction

3.9 Chapter 9 - Production Configurations Covers putting the application in flash, kernel configuration, system start-up. A very important chapter for the developer who needs to know about start-up of linux, initialization of kernel from ROM, reduced footprints and other needs that arise when working with a system that is non-disk or network based. How to configure RAM disks. Key topics:

System Boot Application Launch NFS Root Configurations RAM Disks ROM Based Applications Building Binaries Working with Board Monitors Initializing Boards without Monitors

3.10 Chapter 10 - The MMU and Linux There are certain cases where understanding the MMU and how to map memory will be very important to the developer. For this select group of people, this chapter presents the details on how to approach it from an embedded perspective. Other books are available on this. Key topics:

Kernel Level Memory Model Physical Memory Remapping Memory Application Data Space Cache Issues Diagnostics

8 of 8

Embedded Linux Reference Guide