Programming Embedded Systems in C and C++

( 2 )

Overview

Embedded software is in almost every electronic device designed today. There is software hidden away inside our watches, microwaves, VCRs, cellular telephones, and pagers; the military uses embedded software to guide smart missiles and detect enemy aircraft; communications satellites, space probes, and modern medicine would be nearly impossible without it. Of course, someone has to write all that software, and there are thousands of computer scientists, electrical engineers, and...

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (16) from $14.98   
  • New (5) from $92.90   
  • Used (11) from $14.98   
Close
Sort by
Page 1 of 1
Showing 1 – 4 of 5
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$92.90
Seller since 2008

Feedback rating:

(193)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
1565923545 New. Looks like an interesting title!

Ships from: Naperville, IL

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
$154.50
Seller since 2014

Feedback rating:

(273)

Condition: New
Brand New Item.

Ships from: Chatham, NJ

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$155.00
Seller since 2014

Feedback rating:

(164)

Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
$215.00
Seller since 2014

Feedback rating:

(164)

Condition: New
Brand new.

Ships from: acton, MA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing 1 – 4 of 5
Close
Sort by
Sending request ...

Overview

Embedded software is in almost every electronic device designed today. There is software hidden away inside our watches, microwaves, VCRs, cellular telephones, and pagers; the military uses embedded software to guide smart missiles and detect enemy aircraft; communications satellites, space probes, and modern medicine would be nearly impossible without it. Of course, someone has to write all that software, and there are thousands of computer scientists, electrical engineers, and other professionals who actually do.

Each embedded system is unique and highly customized to the application at hand. As a result, embedded systems programming is a widely varying field that can take years to master. However, if you have some programming experience and are familiar with C or C++, you're ready to learn how to write embedded software. The hands-on, no-nonsense style of this book will help you get started by offering practical advice from someone who's been in your shoes and wants to help you learn quickly.

The techniques and code examples presented here are directly applicable to real-world embedded software projects of all sorts. Even if you've done some embedded programming before, you'll still benefit from the topics in this book, which include:

  • Testing memory chips quickly and efficiently
  • Writing and erasing Flash memory
  • Verifying nonvolatile memory contents with CRCs
  • Interfacing to on-chip and external peripherals
  • Device driver design and implementation
  • Optimizing embedded software for size and speed

So whether you're writing your first embedded program, designing the latest generation of hand-held whatchamacalits, or simply managing the people who do, this book is for you.

Read More Show Less

Product Details

  • ISBN-13: 9781565923546
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 1/28/1999
  • Edition description: Older Edition
  • Edition number: 1
  • Pages: 200
  • Product dimensions: 7.00 (w) x 9.11 (h) x 0.53 (d)

Meet the Author

Michael Barr has been an editor of Embedded Systems Programming since 1999 and a contributor since 1997; he is currently that magazine's editor-in-chief. His book about embedded software development — Programming Embedded Systems in C and C++ (O'Reilly, 1999) — has taught tens of thousands of engineers the subject and been translated into several languages. He is also the author of CMP Book's Embedded Systems Dictionary (2003). Michael is a lecturer at the University of Maryland and a popular Embedded Systems Conference instructor and advisor. Software he wrote helps run millions of systems around the world, ranging from satellite base stations to physical therapy equipment. Through the Netrino Consultants Network, Michael provides design advice and training. He holds MS and BS degrees in electrical engineering.

Read More Show Less

Read an Excerpt


Chapter 8: Operating Systems

All but the most trivial of embedded programs will benefit from the inclusion of an operating system. This can range from a small kernel written by you to a fullfeatured commercial operating system. Either way, you'll need to know what features are the most important and how their implementation will affect the rest of your software. At the very least, you need to understand what an embedded operating system looks like on the outside. But there's probably no better way to understand the exterior interfaces than to examine a small operating system in its entirety. So that's what we'll do in this chapter.

History and Purpose

In the early days of computing there was no such thing as an operating system. Application programmers were completely responsible for controlling and monitoring the state of the processor and other hardware. in fact, the purpose of the first operating systems was to provide a virtual hardware platform that made application programs easier to write. To accomplish this goal, operating system developers needed only provide a loose collection of routines-much like a modem software library-for resetting the hardware to a known state, reading the state of the inputs, and changing the state of the outputs.

Modem operating systems add to this the ability to execute multiple software tasks simultaneously on a single processor. Each such task is a piece of the software that can be separated from and run independently of the rest. A set of embedded software requirements can usually be decomposed into a small number of such independent pieces. For example, the printer-sharing device described in Chapter 5, Getting to Know the Hardware, contains three obvious software tasks:

  • Task 1: Receive data from the computer attached to serial port A.
  • Task 2: Receive data from the computer attached to serial port B.
  • Task 3: Format and send the waiting data (if any) to the printer attached to the parallel port.

Tasks provide a key software abstraction that makes the design and implementation of embedded software easier and the resulting source code simpler to understand and maintain. By breaking the larger program up into smaller pieces, the programmer can more easily concentrate her energy and talents on the unique features of the system under development.

Strictly speaking, an operating system is not a required component of any computer system-embedded or otherwise. it is always possible to perform the same functions from within the application program itself. Indeed, all of the examples so far in this book have done just that. There is simply one path of execution-starting at main-that is downloaded into the system and run. This is the equivalent of having only one task. But as the complexity of the application expands beyond just blinking an LED, the benefits of an operating system far outweigh the associated costs.

If you have never worked on operating system internals before, you might have the impression that they are complex. I'm sure the operating system vendors would like you to continue to believe that they are and that only a handful of computer scientists are capable of writing one. But I'm here to let the cat out of the bag: it's not all that hard! in fact, embedded operating systems are even easier to write than their desktop cousins-the required functionality is smaller and better defined. Once you learn what that functionality is and a few implementation techniques, you will see that an operating system is no harder to develop than any other piece of embedded software.

Embedded operating systems are small because they lack many of the things you would expect to find on your desktop computer. For example, embedded systems rarely have disk drives or graphical displays, and hence they need no filesystem or graphical user interface in their operating systems. In addition, there is only one "user" (i.e., all of the tasks that comprise the embedded software cooperate), so the security features of multiuser operating systems do not apply. All of these are features that could be part of an embedded operating system but are unnecessary in the majority of cases.

A Decent Embedded Operating System

What follows is a description of an embedded operating system that I have developed on my own. I call my operating system ADEOS (pronounced the same as the Spanish farewell), which is an acronym for "A Decent Embedded Operating System." I think that name really sums it up nicely. Yes, it is an embedded operating system; but it is neither the best nor the worst in any regard. in all, there are less than 1000 lines of source code. Of these, three quarters are platform-independent and written in C++. The rest are hardware- or processor-specific and, therefore, written in assembly language. In the discussion later, I will present and explain all of the routines that are written in C++ along with the theory you need to understand them. In the interest of clarity, I will not present the source code for the assembly language routines. Instead, I will simply state their purpose and assume that interested readers will download and examine that code on their own.

If you would like to use ADEOS (or a modified version of it) in your embedded system, please feel free to do so. In fact, I would very much like to hear from anyone who uses it. I have made every effort to test the code and improve upon the weaknesses I have uncovered. However, I can make no guarantee that the code presented in this chapter is useful for any purpose other than learning about operating systems. If you decide to use it anyway, please be prepared to spend some amount of your time finding and fixing bugs in the operating system itself.

Tasks

We have already talked about multitasking and the idea that an operating system makes it possible to execute multiple "programs" at the same time. But what does that mean? How is it possible to execute several tasks concurrently? In actuality, the tasks are not executed at the same time. Rather, they are executed in pseudoparallel. They merely take turns using the processor. This is similar to the way several people might read the same copy of a book. Only one person can actually use the book at a given moment, but they can both read it by taking turns using it.

An operating system is responsible for deciding which task gets to use the processor at a particular moment. In addition, it maintains information about the state of each task. This information is called the task's context, and it serves a purpose similar to a bookmark. In the multiple book reader scenario, each reader is presumed to have her own bookmark. The bookmark's owner must be able to recognize it (e.g., it has her name written on it), and it must indicate where she stopped reading when last she gave up control of the book. This is the reader's context.

A task's context records the state of the processor just prior to another task's taking control of it. This usually consists of a pointer to the next instruction to be executed (the instruction pointer), the address of the current top of the stack (the stack pointer), and the contents of the processor's flag and general-purpose registers. On 16-bit 80x86 processors, these are the registers CS and IP, SS and SP, Flags, and DS, ES, SI, DI, AX, BX, CX, and DX, respectively....

Read More Show Less

Table of Contents

Dedication;
Preface;
Why I Wrote This Book;
Intended Audience;
Organization;
Conventions, Typographical and Otherwise;
Obtaining the Examples Online;
How to Contact Us;
Personal Comments and Acknowledgments;
Chapter 1: Introduction;
1.1 What Is an Embedded System?;
1.2 Variations on the Theme;
1.3 C: The Least Common Denominator;
1.4 A Few Words About Hardware;
Chapter 2: Your First Embedded Program;
2.1 Hello, World!;
2.2 Das Blinkenlights;
2.3 The Role of the Infinite Loop;
Chapter 3: Compiling, Linking, and Locating;
3.1 The Build Process;
3.2 Compiling;
3.3 Linking;
3.4 Locating;
3.5 Building das Blinkenlights;
Chapter 4: Downloading and Debugging;
4.1 When in ROM ...;
4.2 Remote Debuggers;
4.3 Emulators;
4.4 Simulators and Other Tools;
Chapter 5: Getting to Know the Hardware;
5.1 Understand the Big Picture;
5.2 Examine the Landscape;
5.3 Learn How to Communicate;
5.4 Get to Know the Processor;
5.5 Study the External Peripherals;
5.6 Initialize the Hardware;
Chapter 6: Memory;
6.1 Types of Memory;
6.2 Memory Testing;
6.3 Validating Memory Contents;
6.4 Working with Flash Memory;
Chapter 7: Peripherals;
7.1 Control and Status Registers;
7.2 The Device Driver Philosophy;
7.3 A Simple Timer Driver;
7.4 Das Blinkenlights, Revisited;
Chapter 8: Operating Systems;
8.1 History and Purpose;
8.2 A Decent Embedded Operating System;
8.3 Real-Time Characteristics;
8.4 Selection Process;
Chapter 9: Putting It All Together;
9.1 Application Overview;
9.2 Flashing the LED;
9.3 Printing “Hello, World!”;
9.4 Working with Serial Ports;
9.5 The Zilog 85230 Serial Controller;
Chapter 10: Optimizing Your Code;
10.1 Increasing Code Efficiency;
10.2 Decreasing Code Size;
10.3 Reducing Memory Usage;
10.4 Limiting the Impact of C++;
Arcom’s Target188EB;
Glossary;
Bibliography;
Colophon;

Read More Show Less

Customer Reviews

Average Rating 3.5
( 2 )
Rating Distribution

5 Star

(1)

4 Star

(0)

3 Star

(0)

2 Star

(1)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 2 Customer Reviews
  • Anonymous

    Posted June 10, 2002

    Not for Experienced Embedded Programmers

    Very introductory level book on embedded programming. I'm not sure I would recommend this book even to beginners as it doesn't really offer any structured approach to embedded programming. I would put your $23 towards another book.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted December 8, 1999

    Great book!

    As an embedded systems programmer myself, I was looking for a book that would help both beginners and experienced programmers. Among all the books I reviewed, I liked this one the best!

    Was this review helpful? Yes  No   Report this review
Sort by: Showing all of 2 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)