-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.ld
More file actions
executable file
·72 lines (61 loc) · 1.58 KB
/
kernel.ld
File metadata and controls
executable file
·72 lines (61 loc) · 1.58 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
MEMORY {
PRE_MMU_MEMORY : ORIGIN = 0x0000000000000000, LENGTH = 0xFFFFFFFF
/* Kernel address space starts at the upper half of the 48-bit virtual address space.*/
POST_MMU_MEMORY : ORIGIN = 0x0000800000000000, LENGTH = 0xFFFFFFFF
}
SECTIONS {
.stack : {
__static_memory_start = .;
__stack_start = .;
. = 0x80000;
__sp = .;
__stack_end = .;
} > POST_MMU_MEMORY AT > PRE_MMU_MEMORY
.stack_phony : {
. += SIZEOF(.stack);
} > PRE_MMU_MEMORY
/* The kernel entry point: */
/* Address = __entry_point */
.init : {
__entry_point = .;
__text_start = .;
*(.init)
build/memory/virtual_memory.o (.text)
build/memory/virtual_memory.o (.data .data.*)
build/memory/virtual_memory.o (.bss)
} > PRE_MMU_MEMORY
.init_phony : {
. += SIZEOF(.init);
} > POST_MMU_MEMORY AT > PRE_MMU_MEMORY
/*
* Next we put the rest of the code.
*/
.text : {
*(.text)
__text_end = .;
} > POST_MMU_MEMORY AT > PRE_MMU_MEMORY
/*
* Next we put the data.
*/
.data : {
__data_start = .;
*(.data .data.*)
} > POST_MMU_MEMORY AT > PRE_MMU_MEMORY
.rodata : {
*(.rodata .rodata.*)
__data_end = .;
} > POST_MMU_MEMORY AT > PRE_MMU_MEMORY
.bss : ALIGN(4) {
__bss_start = .;
*(.bss)
/* Allows for word based clearing of BSS */
. = ALIGN(4);
__bss_end = .;
__static_memory_end = .;
} > POST_MMU_MEMORY AT > PRE_MMU_MEMORY
/*
* Finally comes everything else. A fun trick here is to put all other
* sections into this section, which will be discarded by default.
*/
/* Include debug symbols */
}