source: rtems/doc/bsp_howto/target.t @ ed11cadf

4.104.114.84.95
Last change on this file since ed11cadf was ed11cadf, checked in by Joel Sherrill <joel.sherrill@…>, on 10/01/99 at 17:44:06

Numerous minor changes required to transition to the latest version
of texinfo and TeX. This version of the tools can produce PDF with
figures included.

  • Property mode set to 100644
File size: 7.5 KB
Line 
1@c
2@c  COPYRIGHT (c) 1988-1998.
3@c  On-Line Applications Research Corporation (OAR).
4@c  All rights reserved.
5@c
6@c  $Id$
7@c
8
9@chapter Target Dependent Files
10
11RTEMS has a multi-layered approach to portability.  This is done to
12maximize the amount of software that can be reused.  Much of the
13RTEMS source code can be reused on all RTEMS platforms.  Other parts
14of the executive are specific to hardware in some sense.
15RTEMS classifies target dependent code based upon its dependencies
16into one of the following categories.
17
18@itemize @bullet
19@item CPU dependent
20@item Board dependent
21@item Peripheral dependent
22@end itemize
23
24@section CPU Dependent
25
26This class of code includes the foundation
27routines for the executive proper such as the context switch and
28the interrupt subroutine implementations.  Sources for the supported
29processor families can be found in @code{c/src/exec/score/cpu}.
30A good starting point for a new family of processors is the
31@code{no_cpu} directory, which holds both prototypes and
32descriptions of each needed CPU dependent function.
33
34CPU dependent code is further subcategorized if the implementation is
35dependent on a particular CPU model.  For example, the MC68000 and MC68020
36processors are both members of the m68k CPU family but there are significant
37differents between these CPU models which RTEMS must take into account.
38
39@section Board Dependent
40
41This class of code provides the most specific glue between RTEMS and
42a particular board.  This code is represented by the Board Support Packages
43and associated Device Drivers.  Sources for the BSPs included in the
44RTEMS distribution are located in the directory @code{c/src/lib/libbsp}.
45The BSP source directory is further subdivided based on the CPU family
46and BSP.
47
48Some BSPs may support multiple board models within a single board family.
49This is necessary when the board supports multiple variants on a
50single base board.  For example, the Motorola MVME162 board family has a
51fairly large number of variations based upon the particular CPU model
52and the peripherals actually placed on the board.
53
54@section Peripheral Dependent
55
56This class of code provides a reusable library of peripheral device
57drivers which can be tailored easily to a particular board.  The
58libchip library is a collection of reusable software objects that
59correspond to standard controllers.  Just as the hardware engineer
60chooses a standard controller when designing a board, the goal of
61this library is to let the software engineer do the same thing.
62
63The source code for the reusable peripheral driver library may be found
64in the directory @code{c/src/lib/libchip}.  The source code is further
65divided based upon the class of hardware.  Example classes include serial
66communications controllers, real-time clocks, non-volatile memory, and
67network controllers.
68
69@section Questions to Ask
70
71When evaluating what is required to support RTEMS applications on
72a particular target board, the following questions should be asked:
73
74@itemize @bullet
75
76@item Does a BSP for this board exist?
77
78@item Does a BSP for a similar board exists?
79
80@item Is the board's CPU supported?
81
82@end itemize
83
84If there is already a BSP for the board, then things may already be ready
85to start developing application software.  All that remains is to verify
86that the existing BSP provides device drivers for all the peripherals
87on the board that the application will be using.  For example, the application
88in question may require that the board's Ethernet controller be used and
89the existing BSP may not support this.
90
91If the BSP does not exist and the board's CPU model is supported, then
92examine the reusable chip library and existing BSPs for a close match. 
93Other BSPs and libchip provide starting points for the development
94of a new BSP.  It is often possible to copy existing components in
95the reusable chip library or device drivers from BSPs from different
96CPU families as the starting point for a new device driver.
97This will help reduce the development effort required. 
98
99If the board's CPU family is supported but the particular CPU model on
100that board is not, then the RTEMS port to that CPU family will have to
101be augmented.  After this is done, development of the new BSP can proceed.
102
103Otherwise both CPU dependent code and the BSP will have to be written.
104
105Regardless of the amount of development required, OAR Corporation
106offers custom development services to assist RTEMS users.
107For more information on custom development, training courses, and
108support, contact OAR Corporation at
109@uref{http://www.oarcorp.com}.
110
111
112@section CPU Dependent Executive Files
113
114The CPU dependent files in the RTEMS executive source code are found
115in the following directory:
116
117@example
118c/src/exec/score/cpu/@i{CPU}
119@end example
120
121where @i{CPU} is replaced with the CPU family name.
122
123Within each CPU dependent directory inside the executive proper is a
124file named @code{@i{CPU}.h} which contains information about each of the
125supported CPU models within that family.
126
127@section CPU Dependent Support Files
128
129The CPU dependent support files contain routines which aid in the development
130of applications using that CPU family.  For example, the support routines
131may contain standard trap handlers for alignment or floating point exceptions
132or device drivers for peripheral controllers found on the CPU itself.
133This class of code may be found in the following directory:
134
135@example
136c/src/lib/libcpu/@i{CPU}
137@end example
138
139CPU model dependent support code is found in the following directory:
140
141@example
142c/src/lib/libcpu/@i{CPU}/@i{CPU_MODEL}
143@end example
144
145@section Board Support Package Structure
146
147The BSPs are all under the c/src/lib/libbsp directory.  Below this
148directory, there is a subdirectory for each CPU family.  Each BSP
149is found under the subdirectory for the appropriate processor
150family (m68k, powerpc, etc.).  In addition, there is source code
151available which may be shared across all BSPs regardless of
152the CPU family or just across BSPs within a single CPU family.  This
153results in a BSP using the following directories:
154
155@example
156c/src/lib/libbsp/shared
157c/src/lib/libbsp/@i{CPU}/shared
158c/src/lib/libbsp/@i{CPU}/@i{BSP}
159@end example
160
161Under each BSP specific directory, there is a collection of
162subdirectories.  For commonly provided functionality, the BSPs
163follow a convention on subdirectory naming.  The following list
164describes the commonly found subdirectories under each BSP.
165
166@itemize @bullet
167
168@item @b{console}:
169is technically the serial driver for the BSP rather
170than just a console driver, it deals with the board
171UARTs (i.e. serial devices).
172
173@item @b{clock}:
174support for the clock tick -- a regular time basis to the kernel.
175
176@item @b{timer}:
177support of timer devices.
178
179@item @b{rtc}:
180support for the hardware real-time clock.
181
182@item @b{nvmem}:
183support for non-volatile memory such as EEPROM or Flash.
184
185@item @b{network}:
186the Ethernet driver.
187
188@item @b{shmsupp}:
189support of shared memory driver MPCI layer in a multiprocessor system,
190
191@item @b{include}:
192include files for this BSP.
193
194@item @b{wrapup}:
195bundles all the components necessary to construct the BSP library.
196
197@end itemize
198
199The build order of the BSP is determined by the Makefile structure.
200This structure is discussed in more detail in the @ref{Makefiles}
201chapter.
202
203@b{NOTE:} This manual refers to the gen68340 BSP for numerous concrete
204examples.  You should have a copy of the gen68340 BSP available while
205reading this piece of documentation.   This BSP is located in the
206following directory:
207
208@example
209c/src/lib/libbsp/m68k/gen68340
210@end example
211
212Later in this document, the $BSP340_ROOT label will be used
213to refer to this directory.
214
Note: See TracBrowser for help on using the repository browser.