-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.ld
More file actions
78 lines (57 loc) · 1.59 KB
/
Copy pathkernel.ld
File metadata and controls
78 lines (57 loc) · 1.59 KB
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
OUTPUT_FORMAT("elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(_start)
ENTRY_SVC_STACK_SIZE = 0x1000;
SECTIONS
{
/* the entry point, before enabling paging. The code to enable paing
needs to have the same virtual/physical address. entry.S and start.c
run in this initial setting.*/
. = 0x10000;
.start_sec : {
build/entry.o(.text)
build/start.o(.text .text.*)
build/entry.o(.rodata .rodata.*)
build/start.o(.rodata .rodata.*)
build/entry.o(.data .data.*)
build/start.o(.data .data.*)
PROVIDE(edata_entry = .);
build/entry.o(.bss .bss.* COMMON)
build/start.o(.bss .bss.* COMMON)
/*define a stack for the entry*/
. = ALIGN(0x1000);
. += ENTRY_SVC_STACK_SIZE;
PROVIDE (svc_stktop = .);
/* define the kernel page table, must be 16K and 16K-aligned*/
. = ALIGN(0x4000);
PROVIDE (_kernel_pgtbl = .);
. += 0x4000;
/* we also need a user page table*/
PROVIDE (_user_pgtbl = .);
. += 0x1000;
PROVIDE(end_entry = .);
}
/*the kernel executes at the higher 2GB address space, but loaded
at the lower memory (0x20000)*/
. = 0x80020000;
.text : AT(0x20000){
*(.text .text.* .gnu.linkonce.t.*)
}
PROVIDE(etext = .); /* Define the 'etext' symbol to this value */
.rodata : {
*(.rodata .rodata.* .gnu.linkonce.r.*)
}
/* aligned the data to a (4K) page, so it can be assigned
different protection than the code*/
. = ALIGN(0x1000);
PROVIDE (data_start = .);
.data : {
*(.data .data.*)
}
PROVIDE (edata = .);
.bss : {
*(.bss .bss.* COMMON)
}
. = ALIGN(0x1000);
PROVIDE (end = .);
}