summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/ts_386ex/startup/linkcmds
blob: 99911126bb48b76389e7c099da2f6b841623a100 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
 *  This file contains directives for the GNU linker which are specific
 *  to the Technologic Systems TS-1325 (i386ex) board.
 *
 *  Copyright (c) 1989-1998.
 *  On-Line Applications Research Corporation (OAR).
 *  Copyright assigned to U.S. Government, 1994.
 *
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  http://www.OARcorp.com/rtems/license.html.
 *
 *  $Id$
 * 
 * Memory layout:
 *
 * 0x0008000 ->    ...    : initial section ( init 386ex, goto protected mode) 
 *    ...    ->    ...    : text section ( executable code )
 *    ...    -> 0x00A0000 : data section ( initialized storage )
 * 0x0100000 -> 0x0200000 : bss section, stack space, heap storage
 */

	ENTRY(_init_i386ex) ;
SECTIONS
{

/***************************************************************************
 * initial section:
 *
 * This section is the first in memory, preceding the text and data sections.
 * It initializes the i386ex, sets up the gdt in RAM, loads the gdt,
 * jumps to protected mode, loads the idt, zeros the bss section, sets up
 * the stack and calls the rest of the RTEMS initialization.
 ***************************************************************************/

	_DOS_ld_addr	=	0x0008000 ;

	.initial _DOS_ld_addr :
	{
	*(.initial);
	}

/***************************************************************************
 * text section:
 *
 * Nobody here but us opcodes.
 ***************************************************************************/

        .text BLOCK(0x10) :
        {
         CREATE_OBJECT_SYMBOLS
	text_start = . ;
        _text_start = . ;
        *(.text ) ;
	. = ALIGN (16);

	*(.eh_fram)
	. = ALIGN (16);

	/*
	 * C++ constructors
	 */
	__CTOR_LIST__ = .;
	LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
	*(.ctors)
	LONG(0)
	__CTOR_END__ = .;
	. = ALIGN (4) ;
	__DTOR_LIST__ = .;
	LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
	*(.dtors)
	LONG(0)
	__DTOR_END__ = .;
	_rodata_start = . ;
	*(.rodata)
	*(.gnu.linkonce.r*)
	_erodata = ALIGN( 0x10 ) ;
        _etext = ALIGN( 0x10 );
	_endtext = . ; 
        }

/***************************************************************************
 * data section:
 *
 * This section defines the location of the data section in RAM.  
 ***************************************************************************/

        .data  BLOCK(0x10) : 
        {
        _sdata = .;
        *(.data);
        _edata = .;
   	}
        _data_size        = _edata - _sdata ;

/***************************************************************************
 * bss section:
 *
 * The bss section is the first section in extended RAM ( > 1MB).  
 ***************************************************************************/

	.bss 0x100000 (NOLOAD) :
	{
	_bss_start = .;
	*(.bss);
	*(COMMON);
	_ebss = ALIGN(0x10);
	}
        _bss_size   = _ebss - _bss_start ;

/***************************************************************************
 * General variables:
 *
 * The stack_size variable is customizable here.  The heap is located directly
 * after the stack in RAM.  A routine within bspstart.c uses these variables
 * to ensure that the heap used by RTEMS is as large as the RAM remaining
 * after all workspace configurations are complete.
 ***************************************************************************/

        stack_size  = 0x8000 ;
	stack_origin = _ebss + stack_size ;
	heap_bottom  = stack_origin + 4 ;  

}