forked from arighi/pastaos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
linker.ld
48 lines (42 loc) · 779 Bytes
/
linker.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
K_VIR_START = 0xC0000000;
K_PHYS_START = 0x100000;
PAGE_SIZE = 0x1000;
K_STACK_SIZE = PAGE_SIZE;
ENTRY (_start)
SECTIONS
{
.text K_VIR_START : AT(K_PHYS_START)
{
KERNEL_INIT = .;
*(.init*)
. = ALIGN(PAGE_SIZE);
KERNEL_END_INIT = .;
KERNEL_TEXT = .;
*(.text*)
*(.rodata*)
. = ALIGN(PAGE_SIZE);
KERNEL_END_TEXT = .;
}
.data : AT(K_PHYS_START + (KERNEL_DATA - KERNEL_INIT))
{
KERNEL_DATA = .;
*(.data*)
. = ALIGN(PAGE_SIZE);
KERNEL_END_DATA = .;
}
.bss : AT(K_PHYS_START + (KERNEL_BSS - KERNEL_INIT))
{
_stack_end = .;
. += K_STACK_SIZE;
_stack_start = .;
K_STACK_START = .;
. = ALIGN( PAGE_SIZE );
KERNEL_BSS = .;
*(.bss*)
*(COMMON*)
. = ALIGN(PAGE_SIZE);
KERNEL_END_BSS = .;
}
. = ALIGN(PAGE_SIZE);
KERNEL_TOP = .;
}