1 | @c |
---|
2 | @c COPYRIGHT (c) 1988-1997. |
---|
3 | @c On-Line Applications Research Corporation (OAR). |
---|
4 | @c All rights reserved. |
---|
5 | @c |
---|
6 | |
---|
7 | @ifinfo |
---|
8 | @node Board Support Packages, Board Support Packages Introduction, Default Fatal Error Processing Default Fatal Error Handler Operations, Top |
---|
9 | @end ifinfo |
---|
10 | @chapter Board Support Packages |
---|
11 | @ifinfo |
---|
12 | @menu |
---|
13 | * Board Support Packages Introduction:: |
---|
14 | * Board Support Packages System Reset:: |
---|
15 | * Board Support Packages Processor Initialization:: |
---|
16 | @end menu |
---|
17 | @end ifinfo |
---|
18 | |
---|
19 | @ifinfo |
---|
20 | @node Board Support Packages Introduction, Board Support Packages System Reset, Board Support Packages, Board Support Packages |
---|
21 | @end ifinfo |
---|
22 | @section Introduction |
---|
23 | |
---|
24 | An RTEMS Board Support Package (BSP) must be designed |
---|
25 | to support a particular processor and target board combination. |
---|
26 | This chapter presents a discussion of i386 specific BSP issues. |
---|
27 | For more information on developing a BSP, refer to the chapter |
---|
28 | titled Board Support Packages in the RTEMS C Applications User's |
---|
29 | Guide. |
---|
30 | |
---|
31 | @ifinfo |
---|
32 | @node Board Support Packages System Reset, Board Support Packages Processor Initialization, Board Support Packages Introduction, Board Support Packages |
---|
33 | @end ifinfo |
---|
34 | @section System Reset |
---|
35 | |
---|
36 | An RTEMS based application is initiated when the i386 |
---|
37 | processor is reset. When the i386 is reset, |
---|
38 | |
---|
39 | @itemize @bullet |
---|
40 | @item The EAX register is set to indicate the results of the |
---|
41 | processor's power-up self test. If the self-test was not |
---|
42 | executed, the contents of this register are undefined. |
---|
43 | Otherwise, a non-zero value indicates the processor is faulty |
---|
44 | and a zero value indicates a successful self-test. |
---|
45 | |
---|
46 | @item The DX register holds a component identifier and |
---|
47 | revision level. DH contains 3 to indicate an i386 component and |
---|
48 | DL contains a unique revision level indicator. |
---|
49 | |
---|
50 | @item Control register zero (CR0) is set such that the |
---|
51 | processor is in real mode with paging disabled. Other portions |
---|
52 | of CR0 are used to indicate the presence of a numeric |
---|
53 | coprocessor. |
---|
54 | |
---|
55 | @item All bits in the extended flags register (EFLAG) which |
---|
56 | are not permanently set are cleared. This inhibits all maskable |
---|
57 | interrupts. |
---|
58 | |
---|
59 | @item The Interrupt Descriptor Register (IDTR) is set to point |
---|
60 | at address zero. |
---|
61 | |
---|
62 | @item All segment registers are set to zero. |
---|
63 | |
---|
64 | @item The instruction pointer is set to 0x0000FFF0. The |
---|
65 | first instruction executed after a reset is actually at |
---|
66 | 0xFFFFFFF0 because the i386 asserts the upper twelve address |
---|
67 | until the first intersegment (FAR) JMP or CALL instruction. |
---|
68 | When a JMP or CALL is executed, the upper twelve address lines |
---|
69 | are lowered and the processor begins executing in the first |
---|
70 | megabyte of memory. |
---|
71 | @end itemize |
---|
72 | |
---|
73 | Typically, an intersegment JMP to the application's |
---|
74 | initialization code is placed at address 0xFFFFFFF0. |
---|
75 | |
---|
76 | @ifinfo |
---|
77 | @node Board Support Packages Processor Initialization, Processor Dependent Information Table, Board Support Packages System Reset, Board Support Packages |
---|
78 | @end ifinfo |
---|
79 | @section Processor Initialization |
---|
80 | |
---|
81 | This initialization code is responsible for |
---|
82 | initializing all data structures required by the i386 in |
---|
83 | protected mode and for actually entering protected mode. The |
---|
84 | i386 must be placed in protected mode and the segment registers |
---|
85 | and associated selectors must be initialized before the |
---|
86 | initialize_executive directive is invoked. |
---|
87 | |
---|
88 | The initialization code is responsible for |
---|
89 | initializing the Global Descriptor Table such that the i386 is |
---|
90 | in the thirty-two bit flat memory model with paging disabled. |
---|
91 | In this mode, the i386 automatically converts every address from |
---|
92 | a logical to a physical address each time it is used. For more |
---|
93 | information on the memory model used by RTEMS, please refer to |
---|
94 | the Memory Model chapter in this document. |
---|
95 | |
---|
96 | If the application requires that the IDTR be some |
---|
97 | value besides zero, then it should set it to the required value |
---|
98 | at this point. All tasks share the same i386 IDTR value. |
---|
99 | Because interrupts are enabled automatically by RTEMS as part of |
---|
100 | the initialize_executive directive, the IDTR MUST be set |
---|
101 | properly before this directive is invoked to insure correct |
---|
102 | interrupt vectoring. If processor caching is to be utilized, |
---|
103 | then it should be enabled during the reset application |
---|
104 | initialization code. The reset code which is executed before |
---|
105 | the call to initialize_executive has the following requirements: |
---|
106 | |
---|
107 | For more information regarding the i386s data |
---|
108 | structures and their contents, refer to Intel's 386 |
---|
109 | Programmer's Reference Manual. |
---|
110 | |
---|