D.4. How to Customize the Simulator

The simulator's support for the XIO programmed input and output instructions is linked as a sharable library that can be replaced by a compatible user-written library. A template file is provided on the CD-ROM and this can be customized to allow the simulator to interact with other parts of your system, including software simulations of special spacecraft peripheral devices.

You will find the template in templates/libxio.c. The CD-ROM file templates/Makefile will compile the library using the GNU toolset. If you have some other toolset, or are using GCC with a native linker, consult your manual pages for the appropriate commands and options.

To use the custom library in place of the default one, you must make sure that the directory where you place the custom library is on the library path, and is ahead of the directory that contains the default library. This is easily done by the following statement, which you can place in your login command file.

export LD_LIBRARY_PATH=my-directory:$LD_LIBRARY_PATH

You can check that the correct library is used in two ways: