News Archive (1999-2012) | 2013-current at LinuxGizmos | Current Tech News Portal |    About   

New book demystifies embedded firmware

Feb 22, 2002 — by LinuxDevices Staff — from the LinuxDevices Archive — 3 views

CMP Books has announced publication of a new technical book entitled Embedded Systems Firmware Demystified, by Ed Sutter. Sutter, a “distinguished member of the technical staff” at Lucent, has been working in embedded systems since 1983 and is the author and maintainer of MicroMonitor, an open source embedded… system boot platform.

Here is a summary of the contents of the book, as provided by its author . . .
  • Chapter 1: A Hard Start — describes a basic CPU structure, with support peripherals, on which the firmware discussed in this book can execute. The design includes, among other things, a core microprocessor, RAM, flash memory, serial I/O, and CPU supervision. Each element of the design is discussed (for example, CPU supervision and types of volatile and non-volatile memory devices). This chapter also examines the basics of how microprocessors fetch instructions from the memory device and how cache makes these fetches more efficient. The chapter covers the typical peripherals found in many microprocessors today, without being specific to a particular device.

  • Chapter 2: Getting Started — introduces the writing and building of programs for embedded devices. This chapter explains the differences between a native-compilation and a cross-compilation environment. I discuss file formats and break down the task of burning the boot flash memory into simple steps. I also explain the importance of the link editor file and show how it is used to allocate sections of the application code to portions of the target memory. The chapter also discusses some preliminary tests and preparations you must undertake before you start programming the firmware.

  • Chapter 3: Introducing MicroMonitor — introduces the boot platform, or boot monitor, used in embedded systems. This monitor, called MicroMonitor, has a full list of features and serves as a learning tool to teach you about the firmware development process.

  • Chapter 4: Assembly Required — describes MicroMonitor's reset vector, or startup code. I then build some serial drivers and discuss an implementation for establishing exception handlers.

  • Chapter 5: Command Line Interface — describes how to build a shell around the core functionality introduced in Chapter 4. I start with the command line interface (CLI). Next, I explain the processing that parses the input command line and that eventually (through the table of structures) calls a function corresponding to the command line. The command line interface includes shell variables and symbols, command line editing and history, user levels, and password protection.

  • Chapter 6: Interfacing to Flash Memory — is the first of three chapters dealing primarily with flash memory. I describe a sample platform with (potentially several) banks of flash memory. This chapter discusses the lowest-level details involved in programming flash memory and presents a useful approach for target hardware with different flash memory configurations.

  • Chapter 7: A Flash File System — discusses the creation of a tiny file system (TFS) which resides in flash memory. This simple file system is offered as an alternative to some of the more complicated approaches taken by many flash file system designers. I also describe some of the advantages and disadvantages of the trade-offs made in the design of TFS.

  • Chapter 8: Executing Scripts — describes a feature that, with a CLI for command execution and a TFS for file storage, lets a file execute as a script or small program. This chapter examines the surprisingly simple details that combine the CLI and TFS to create a simple interpreter. The CLI commands are chosen to provide the CLI/TFS user with a simple but useful programming environment. Conditional branching and subroutines are just a few of the capabilities of this system.

  • Chapter 9: Network Connectivity — examines the elements needed to connect as a node on a network. Just as flash memory is becoming a standard boot memory device, so too is Ethernet becoming a standard interface on many embedded systems. This chapter discusses several protocols used with embedded systems, including Ethernet, ARP, ICMP, IP, UDP, and BOOTP/DHCP. Finally, the chapter examines encapsulation of network layers — one on top of another — by small blocks of code that know only about their own piece of the packet payload.

  • Chapter 10: File/Data Transfer — discusses two common file-transfer protocols: Xmodem for serial interfaces and TFTP for networks. Here I explain each of these protocols as implemented in the boot monitor package. The Xmodem and TFTP implementations presented in this book can transfer files and raw memory both to and from the target.

  • Chapter 11: Adding the Application — shows you how the platform provides the base on which applications reside. The example in this chapter is a simple application with no RTOS, but it is clear that this platform supports just about any environment. You, as the developer, decide how much of the platform remains accessible by the application after the application takes over the system. This chapter discusses how the application is built to reside within the TFS and how the platform's loader automatically transfers the file from flash memory space to RAM space for execution.

  • Chapter 12: Monitor-Based Debugging — discusses some of the monitor's on-board debugging capabilities and shows the implementation of these capabilities because, whether you want to admit it or not, you're going to have to debug your code. Here you'll learn how to create a basic symbolic debugger that can display memory as a structure (instead of as raw data), set breakpoints, single-step through a program, profile a program's execution, and dump a stack trace. The debugging techniques described in this chapter do not require in-chip support or an external debugger.

  • Chapter 13: Porting MicroMonitor to the ColdFire MCF5272 — explains the process of porting the MicroMonitor firmware package to a Motorola MCF5272 (ColdFire) evaluation board. The text introduces the directory structure of the source code on the CD and walks through the monitor-specific details of the porting process. This chapter completes the process begun in earlier chapters.

  • Appendix A: Building a Host-Based Toolbox — provides snippets of code that might prove useful for interfacing to files, serial ports, and sockets. Despite the fact that this book is about firmware, you are likely to have to do some native programming eventually. Even if you've already done a lot of native programming, the code presented here should speed your work.

  • Appendix B: RTOS Overview — introduces some of the basic concepts of a real-time operating system (RTOS), which lets you expand your environment from supporting single-threaded programs to multi-threaded ones. Several books are available on this subject, so this appendix is not intended as an exhaustive study. I, however, present a fundamental explanation of what multi-tasking can do for you and why preemption is a beautiful yet dangerous feature.

 
This article was originally published on LinuxDevices.com and has been donated to the open source community by QuinStreet Inc. Please visit LinuxToday.com for up-to-date news and articles about Linux and open source.



Comments are closed.