[417fcc73] | 1 | @c |
---|
[6449498] | 2 | @c COPYRIGHT (c) 1988-2002. |
---|
[417fcc73] | 3 | @c On-Line Applications Research Corporation (OAR). |
---|
| 4 | @c All rights reserved. |
---|
| 5 | @c |
---|
| 6 | @c $Id$ |
---|
| 7 | @c |
---|
| 8 | |
---|
| 9 | @chapter Building the Sample Application |
---|
| 10 | |
---|
[6449498] | 11 | @section Unarchive the Sample Application |
---|
[417fcc73] | 12 | |
---|
| 13 | Use the following command to unarchive the sample application: |
---|
| 14 | |
---|
| 15 | @example |
---|
| 16 | cd tools |
---|
[ae2e9f2] | 17 | tar xzf ../archive/hello_world_c.tgz |
---|
[417fcc73] | 18 | @end example |
---|
| 19 | |
---|
[57a736ff] | 20 | @section Set the Environment Variable RTEMS_MAKEFILE_PATH |
---|
[417fcc73] | 21 | |
---|
[6449498] | 22 | RTEMS_MAKEFILE_PATH must point to the appropriate directory containing |
---|
| 23 | RTEMS build for our target and board support package combination. |
---|
[417fcc73] | 24 | |
---|
| 25 | @example |
---|
[6449498] | 26 | export RTEMS_MAKEFILE_PATH=<INSTALLATION_POINT>/<BOARD_SUPPORT_PACKAGE> |
---|
[417fcc73] | 27 | @end example |
---|
| 28 | |
---|
[57a736ff] | 29 | Where <INSTALLATION_POINT> and <BOARD_SUPPORT_PACKAGE> are those used when |
---|
[bdec2709] | 30 | configuring and installing RTEMS. |
---|
[417fcc73] | 31 | |
---|
[9230e9c] | 32 | NOTE: In release 4.0, BSPs were installed at |
---|
| 33 | @code{<INSTALLATION_POINT>/rtems/<BOARD_SUPPORT_PACKAGE>}. This |
---|
| 34 | was changed to be more in compliance with GNU standards. |
---|
| 35 | |
---|
[417fcc73] | 36 | @section Build the Sample Application |
---|
| 37 | |
---|
[6449498] | 38 | Use the following command to start the build of the sample hello |
---|
| 39 | world application: |
---|
[417fcc73] | 40 | |
---|
| 41 | @example |
---|
[6449498] | 42 | cd hello_world_c |
---|
[bb4b574] | 43 | make |
---|
[417fcc73] | 44 | @end example |
---|
| 45 | |
---|
[bb4b574] | 46 | NOTE: GNU make is the preferred @code{make} utility. Other @code{make} |
---|
| 47 | implementations may work but all testing is done with GNU make. |
---|
| 48 | |
---|
[417fcc73] | 49 | If no errors are detected during the sample application build, it is |
---|
| 50 | reasonable to assume that the build of the GNU C/C++ Cross Compiler Tools |
---|
[bdec2709] | 51 | for RTEMS and RTEMS itself for the selected host and target |
---|
[417fcc73] | 52 | combination was done properly. |
---|
| 53 | |
---|
[57a736ff] | 54 | @section Application Executable |
---|
[417fcc73] | 55 | |
---|
[6449498] | 56 | If the sample application has successfully been built, then the application |
---|
[417fcc73] | 57 | executable is placed in the following directory: |
---|
| 58 | |
---|
| 59 | @example |
---|
[6449498] | 60 | hello_world_c/o-optimize/<filename>.exe |
---|
[417fcc73] | 61 | @end example |
---|
| 62 | |
---|
[bdec2709] | 63 | How this executable is downloaded to the target board is very dependent |
---|
[6449498] | 64 | on the BOARD_SUPPORT_PACKAGE selected. The following is a list of |
---|
| 65 | commonly used BSPs classified by their RTEMS CPU family and pointers |
---|
| 66 | to instructions on how to use them. [NOTE: All file names should be |
---|
[6e8d424] | 67 | prepended with @value{RTEMSUNTAR}/c/src/lib/libbsp.] |
---|
[6449498] | 68 | |
---|
| 69 | @need 1000 |
---|
| 70 | @table @b |
---|
| 71 | |
---|
| 72 | @item i386/pc386 |
---|
| 73 | See @code{i386/pc386/HOWTO} |
---|
| 74 | |
---|
| 75 | @item i386/pc486 |
---|
| 76 | The i386/pc386 BSP specially compiled for an i486-class CPU. |
---|
| 77 | |
---|
| 78 | @item i386/pc586 |
---|
| 79 | The i386/pc386 BSP specially compiled for a Pentium-class CPU. |
---|
| 80 | |
---|
| 81 | @item i386/pc686 |
---|
| 82 | The i386/pc386 BSP specially compiled for a Pentium II. |
---|
| 83 | |
---|
| 84 | @item i386/pck6 |
---|
| 85 | The i386/pc386 BSP specially compiled for an AMD K6. |
---|
| 86 | |
---|
| 87 | @item m68k/gen68360 |
---|
| 88 | This BSP is for a MC68360 CPU. See @code{m68k/gen68360/README} for details. |
---|
| 89 | |
---|
| 90 | @item m68k/mvme162 |
---|
| 91 | See @code{m68k/mvme162/README}. |
---|
| 92 | |
---|
| 93 | @item m68k/mvme167 |
---|
| 94 | See @code{m68k/mvme167/README}. |
---|
| 95 | |
---|
| 96 | @item powerpc/mcp750 |
---|
| 97 | See @code{powerpc/motorola_shared/README}. |
---|
| 98 | |
---|
| 99 | @item powerpc/mvme230x |
---|
| 100 | See @code{powerpc/motorola_shared/README.MVME2300}. |
---|
| 101 | |
---|
| 102 | @item powerpc/psim |
---|
| 103 | This is a BSP for the PowerPC simulator included with @code{powerpc-rtems-gdb}. |
---|
| 104 | The simulator is complicated to initialize by hand. The user is referred |
---|
| 105 | to the script @code{powerpc/psim/tools/psim}. |
---|
| 106 | |
---|
| 107 | @item sparc/erc32 |
---|
| 108 | The ERC32 is a radiation hardened SPARC V7. This BSP can be used with |
---|
| 109 | either real ERC32 hardware or with the simulator included with |
---|
| 110 | @code{sparc-rtems-gdb}. An application can be run on the simulator |
---|
| 111 | by executing the following commands upon entering @code{sparc-rtems-gdb}: |
---|
| 112 | |
---|
| 113 | @example |
---|
| 114 | target sim |
---|
| 115 | load |
---|
| 116 | run |
---|
| 117 | @end example |
---|
| 118 | |
---|
| 119 | @end table |
---|
| 120 | |
---|
| 121 | RTEMS has many more BSPs and new BSPs for commercial boards and CPUs |
---|
| 122 | with on-CPU peripherals are generally welcomed. |
---|
[2038a444] | 123 | |
---|
| 124 | @section More Information on RTEMS Application Makefiles |
---|
| 125 | |
---|
| 126 | The hello world sample application is a simple example of an |
---|
[6449498] | 127 | RTEMS application that uses the RTEMS Application Makefile |
---|
| 128 | system. This Makefile system simplifies building |
---|
[2038a444] | 129 | RTEMS applications by providing Makefile templates and |
---|
| 130 | capturing the configuration information used to build |
---|
| 131 | RTEMS specific to your BSP. Building an RTEMS application |
---|
| 132 | for different BSPs is as simple as switching the |
---|
| 133 | setting of @code{RTEMS_MAKEFILE_PATH}. This Makefile |
---|
| 134 | system is described in the file |
---|
[6b5a7b50] | 135 | @code{make/README}. |
---|