Source Code Directory Tree

Before I can start writing code for the evaluation board, I must step back and look at the tree of source code that comes with MicroMonitor on the CD. There are basically two high-level directories: common and targets. The common directory contains the code that is reusable across several different platforms. The targets directory contains subdirectories, each of which are specific to a particular target. Separating the code into these two main directories allows you to port the monitor source to several very different architectures with minimal changes to the code.

image from book
Figure 13.1: MicroMonitor Source Tree.

The subdirectories under the common and targets directories are as follows :

  • common/cpu contains code that is CPU-specific but not target-specific. Things like the disassembler, exception handling, and CPU-specific commands for the CLI are here.

  • common/monitor contains the bulk of the code. All facilities that are 100% target/CPU-independent reside in this directory. This includes TFS, the Ethernet facilities, file editor, the majority of the monitor commands, memory allocator, CLI handler, and so forth. All of the core monitor facilities are in this directory.

  • common/zlib contains almost entirely untouched material from the zlib public domain code. I have made only the bare minimum changes needed to get zlib code to fit into the monitor. The changes are isolated to one file.

  • common/flash contains subdirectories that support specific flash architectures. The architecture might be a single 29F040 or 29F800, or it might be a target that has a 29F040 boot device with a 28F640 device used for TFS storage. Each subdirectory represents one flash configuration; each flash configuration might be applicable to several target systems.

  • targets/fads860 contains (along with the other targets/xxx directories) code that is specific to one particular target system. All of the non-generic, non-reusable stuff for a given target (In this case, the FADS860 evaluation board) is here.

  • targets/eval5272 like the other target-specific directories, this contains the reset code, communications drivers (serial port and Ethernet), and main() . Also, the linker map file, makefile, and most other build-related files are located here. This directory is where I do the majority of the work related to this port.

Beneath each targets/XXX directory is a monitor and app directory. The monitor directory contains all of the target-specific code used by the monitor for the specific target, and the app directory is intended to contain a very basic example of an application that could reside in and execute out of TFS after the monitor is ported and running on the target.



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