-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimage.ld
50 lines (39 loc) · 1.33 KB
/
image.ld
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
SECTIONS {
/* assign load address (per QEMU) */
. = 0x70010000;
/* TEXT PAGE (R-only for all) 0x700 */
/* place text segment(s) */
.text : { kernel/lolevel.o(.text) *(.text .rodata) }
/* KERNEL DATA/BSS page (R/W for kernel, no access for user) 0x701 */
. = 0x70100000;
/* place data segment(s) */
.kernel_data : { kernel/*.o(.data ) }
/* place bss segment(s) */
.kernel_bss : { kernel/*.o(.bss ) }
/* align address (per AAPCS) */
. = ALIGN( 8 );
/* allocate stack for irq mode */
. = . + 0x00001000;
tos_irq = .;
/* allocate stack for abt mode */
. = . + 0x00001000;
tos_abt = .;
/* allocate stack for svc mode */
. = . + 0x00001000;
tos_svc = .;
/* Pseudo-heap: kernel managed/owned memory */
. = 0x701A0000;
mem_lo = .;
/* User DATA/BSS (mainly libc!) page (R/W for all) 0x702 */
. = 0x70200000;
/* place data segment(s) */
.data : { *(.data ) }
/* place bss segment(s) */
.bss : { *(.bss ) }
/* USER memory PAGES 0x702 and above */
. = 0x70300000;
mem_lo = .;
. = 0x90000000;
mem_hi = .;
ASSERT((tos_svc < mem_lo), "Error: Too little data/bss memory in kernel page")
}