System Calls cleanup, multiple Processes and context switch
[cortex-from-scratch] / link.ld
1 /* (CC-BY-NC-SA) ROBIN KRENS - ROBIN @ ROBINKRENS.NL
2  * 
3  * $LOG$
4  * 2019/7/20 - ROBIN KRENS      
5  * Initial version 
6  * 
7  * $DESCRIPTION$
8  * Linker file for Cortex-M3 STM32 based boards
9  * Boards have similar FLASH and SRAM ORIGINs
10  * LENGTHs differs of course.
11  * 
12  * _start flag is the first procedure to be 
13  * executed (linked to beginning of FLASH at 
14  * 0x08000000). The procedure should do some
15  * basic things, such as set up the stack and
16  * reset and hard fault handler (see start.asm)
17  * *
18  * _endofbss flag is used to calculate the end 
19  * of .bss and the start of (a possible) kernel
20  * heap
21  *
22  * */
23
24 KHEAP_SIZE = 0x100; 
25
26 MEMORY
27 {
28         FLASH (xr) : ORIGIN = 0x08000000, LENGTH = 512K
29         SRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
30
31
32 ENTRY(_start) 
33
34 SECTIONS
35 {
36         . = 0x0;
37         .text : ALIGN(4)
38         {
39                 /* (.vector_table */
40                 *(.text)
41                 *(.rodata) 
42                 data_lma = .;
43         }
44         . = 0x20000000; 
45         data_vma = .;
46         .data : AT (data_lma)
47         {
48                 *(.data)
49         } 
50         data_end = .;
51         .bss : ALIGN(4) 
52         {
53                 *(.bss)
54         }
55         _endofbss = .;  
56         _beginofheap = .;
57         . = . + KHEAP_SIZE;
58         . = ALIGN(8);
59         _endofheap = .;
60 }