Chapter 4: Assembly Required

Overview

This chapter explains how MicroMonitor handles basic system startup. Here you will learn how the system initializes the execution context, including stack, exception handlers, and important state information.

This startup code is critically important: if its not right, nothing else will work right. It is also notoriously machine-dependent . To get this part of the monitor right, you must:

  • come to terms with the systems memory map;

  • identify some means of distinguishing between a power cycle and warm restart;

  • master the machine exception handlers;

  • learn how to save the entire processor state;

  • correctly disable any cache;

  • initialize and manipulate a communications port.

Thus, the startup code involves many machine-specific details and until you get them all correct, you wont have enough working machine to support any code-based debugging. Even so, a great deal of the structure can be coded in relatively machine-independent C. This chapter details the high-level portions of this structure and explains what considerations the lower-level board support code must address. Along the way, Ill point out some of the more important design tradeoffs youll need to consider to adapt the code to your own projects.



Embedded Systems Firmware Demystified
Embedded Systems Firmware Demystified (With CD-ROM)
ISBN: 1578200997
EAN: 2147483647
Year: 2002
Pages: 118
Authors: Ed Sutter

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net