1 |
30 |
unneback |
/*
|
2 |
|
|
* This file contains directives for the GNU linker which are specific
|
3 |
|
|
* to the Intel 386ex evaluation board.
|
4 |
|
|
*
|
5 |
|
|
* COPYRIGHT (c) 1989-1999.
|
6 |
|
|
* On-Line Applications Research Corporation (OAR).
|
7 |
|
|
*
|
8 |
|
|
* The license and distribution terms for this file may be
|
9 |
|
|
* found in the file LICENSE in this distribution or at
|
10 |
|
|
* http://www.OARcorp.com/rtems/license.html.
|
11 |
|
|
*
|
12 |
|
|
* $Id: linkcmds,v 1.2 2001-09-27 11:59:47 chris Exp $
|
13 |
|
|
*
|
14 |
|
|
* Memory layout:
|
15 |
|
|
*
|
16 |
|
|
* 0x3f80000 -> 0x3ff0000 : text section
|
17 |
|
|
* 0x3ff0000 -> 0x3ff0028 : global descriptor table in ROM
|
18 |
|
|
* 0x3ff0028 -> 0x3fff000 : data section ( copied by start.s to RAM )
|
19 |
|
|
* 0x3fff000 -> 0x3fffff0 : initial section ( init 386ex, goto protected mode, copy ROM-RAM )
|
20 |
|
|
* 0x3fffff0 -> 0x4000000 : reset section ( jmp to initial only )
|
21 |
|
|
*/
|
22 |
|
|
|
23 |
|
|
ENTRY(reset) ;
|
24 |
|
|
SECTIONS
|
25 |
|
|
{
|
26 |
|
|
|
27 |
|
|
/****************************************************************************************
|
28 |
|
|
* data section:
|
29 |
|
|
*
|
30 |
|
|
* This section defines the locations of the data section in ROM as well as in RAM.
|
31 |
|
|
* start.s copies the data section to RAM in real mode. This is done PRIOR to the lgdt
|
32 |
|
|
* instruction since the data section contains the Global_descriptor_table and GDTR.
|
33 |
|
|
***********************************************************************************/
|
34 |
|
|
|
35 |
|
|
_rom_data_start = 0x3ff0000;
|
36 |
|
|
|
37 |
|
|
_rom_data_segment = 0xF000;
|
38 |
|
|
_rom_data_offset = 0x0;
|
39 |
|
|
|
40 |
|
|
_ram_data_segment = 0x0000 ;
|
41 |
|
|
_ram_data_offset = 0x0;
|
42 |
|
|
_ram_data_location = _ram_data_segment * 16 + _ram_data_offset;
|
43 |
|
|
|
44 |
|
|
.data :
|
45 |
|
|
AT ( _rom_data_start )
|
46 |
|
|
{
|
47 |
|
|
_sdata = .;
|
48 |
|
|
*(.data);
|
49 |
|
|
_edata = .;
|
50 |
|
|
}
|
51 |
|
|
_data_start = ADDR(.data) ;
|
52 |
|
|
data_start = _data_start ;
|
53 |
|
|
_data_size = _edata - _sdata ;
|
54 |
|
|
|
55 |
|
|
/**************************************************************************************
|
56 |
|
|
* bss section:
|
57 |
|
|
*
|
58 |
|
|
* The bss section is the last section in RAM.
|
59 |
|
|
*************************************************************************************/
|
60 |
|
|
_edata = ALIGN( 0x10 );
|
61 |
|
|
.bss :
|
62 |
|
|
{
|
63 |
|
|
_bss_start = .;
|
64 |
|
|
*(.bss);
|
65 |
|
|
*(COMMON);
|
66 |
|
|
_ebss = ALIGN(0x10);
|
67 |
|
|
end = _ebss;
|
68 |
|
|
_end = end;
|
69 |
|
|
__end = end;
|
70 |
|
|
}
|
71 |
|
|
_bss_size = _ebss - _bss_start ;
|
72 |
|
|
|
73 |
|
|
/**************************************************************************************
|
74 |
|
|
* General variables:
|
75 |
|
|
*
|
76 |
|
|
* The stack_size variable is customizable here. The heap is located directly after
|
77 |
|
|
* The stack in RAM. A routine within bspstart.c uses these variables to ensure that
|
78 |
|
|
* the heap used by RTEMS is as large as the RAM remaining after all workspace configurations
|
79 |
|
|
* are complete.
|
80 |
|
|
*************************************************************************************/
|
81 |
|
|
stack_size = 0x8000 ;
|
82 |
|
|
stack_origin = end + stack_size ;
|
83 |
|
|
heap_bottom = stack_origin + 4 ;
|
84 |
|
|
|
85 |
|
|
/***************************************************************************************
|
86 |
|
|
* text section:
|
87 |
|
|
*
|
88 |
|
|
* This section is NOT copied into RAM. It is left in ROM, as the flash ROM is quick enough.
|
89 |
|
|
***************************************************************************************/
|
90 |
|
|
.text ( 0x3f80000 ):
|
91 |
|
|
{
|
92 |
|
|
CREATE_OBJECT_SYMBOLS
|
93 |
|
|
text_start = . ;
|
94 |
|
|
_text_start = . ;
|
95 |
|
|
*(.text ) ;
|
96 |
|
|
. = ALIGN (16);
|
97 |
|
|
|
98 |
|
|
*(.eh_fram)
|
99 |
|
|
. = ALIGN (16);
|
100 |
|
|
|
101 |
|
|
/*
|
102 |
|
|
* C++ constructors
|
103 |
|
|
*/
|
104 |
|
|
__CTOR_LIST__ = .;
|
105 |
|
|
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
|
106 |
|
|
*(.ctors)
|
107 |
|
|
LONG(0)
|
108 |
|
|
__CTOR_END__ = .;
|
109 |
|
|
. = ALIGN (4) ;
|
110 |
|
|
__DTOR_LIST__ = .;
|
111 |
|
|
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
|
112 |
|
|
*(.dtors)
|
113 |
|
|
LONG(0)
|
114 |
|
|
__DTOR_END__ = .;
|
115 |
|
|
_rodata_start 5 . ;
|
116 |
|
|
*(.rodata)
|
117 |
|
|
*(.gnu.linkonce.r*)
|
118 |
|
|
_erodata = ALIGN( 0x10 ) ;
|
119 |
|
|
_etext = ALIGN( 0x10 );
|
120 |
|
|
_endtext = . ;
|
121 |
|
|
}
|
122 |
|
|
|
123 |
|
|
/*******************************************************************************************
|
124 |
|
|
* initial section:
|
125 |
|
|
*
|
126 |
|
|
* This section is defined after the data section. It must be in the top 64K of memory
|
127 |
|
|
* to enable the initial short jmp from the reset section while still in real-mode. It
|
128 |
|
|
* initializes the i386ex, moves the gdt from ROM to RAM,loads the gdt,
|
129 |
|
|
* jumps to protected mode, copies the data section from ROM to RAM and loads the idt.
|
130 |
|
|
******************************************************************************************/
|
131 |
|
|
|
132 |
|
|
.initial _rom_data_start + _data_size :
|
133 |
|
|
{
|
134 |
|
|
*(.initial);
|
135 |
|
|
}
|
136 |
|
|
|
137 |
|
|
/*******************************************************************************************
|
138 |
|
|
* board reset section:
|
139 |
|
|
*
|
140 |
|
|
* This section contains the short jmp from the reset section to the initial section. It is
|
141 |
|
|
* the first code executed on reset/power on.
|
142 |
|
|
******************************************************************************************/
|
143 |
|
|
|
144 |
|
|
.reset 0x3fffff0:
|
145 |
|
|
{
|
146 |
|
|
*(.reset);
|
147 |
|
|
}
|
148 |
|
|
}
|