Introduction

In an embedded environment, runtime support requirements differ, depending on the application and target configuration. For example, if user C code calls high level I/O routines such as printf, scanf, or malloc, then low-level system call routines write, read, and sbrk need to be implemented, perhaps with modifications appropriate to your specific hardware environment. Green Hills provides a default implementation for these interfaces which work with the Green Hills target environments; for example, Green Hills instruction set simulators, ROM monitors, or real-time operating systems.

The Green Hills version 1.8.9 cross development library system includes two low-level libraries, libsys.a and libarch.a. The libsys.a library contains low-level system routines which implement memory initialization and system calls. The libsys.a library automates the function of copying sections of a program's initialized data from ROM to RAM. It automatically relocates initializers which are runtime located (PIC/PID). The libarch.a library contains utility routines specific to a particular architecture; for example, libarch.a might include an integer divide routine to be used by the compiler system when a processor architecture does not specify an integer divide instruction. The startup module, crt0.o, performs some basic initializations.

The source code to libsys.a and crt0.o is fully contained in a separate directory, libsrc, under the usual installation directory (for example, /usr/green) of a Green Hills cross development distribution. This directory also contains example project build files to build these libraries using the MULTI Development Environment. This source code, as well as the low-level library object modules themselves, are a guide for development of an embedded system.

While these object modules and object libraries enable you to get up and running quickly under the initial default Green Hills configuration, you may want to omit or modify these low-level interfaces for a particular system. Also, not all functions contained in the libraries have default implementations; a few routines, such as fstat, are entry points for user-supplied implementations, if needed.


Previous

Next



Copyright © 1999, Green Hills Software. All rights reserved.