-
Notifications
You must be signed in to change notification settings - Fork 0
/
kernel.ld
50 lines (41 loc) · 1 KB
/
kernel.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
OUTPUT_FORMAT("elf32-i386")
ENTRY(_startup)
STARTUP(startup.o)
SECTIONS
{
/DISCARD/ : {
*(.eh_frame)
*(.comment)
}
/* VMA LMA */
.text.start (0xc0000000) : AT(0x00100000) {
startup.o(.text)
}
.text : ALIGN(0x1000) {
KERNEL_START = .;
KERNEL_TEXT_START = .;
*(.text)
KERNEL_TEXT_END = .;
}
.data : ALIGN(0x1000) {
KERNEL_DATA_START = .;
*(.data)
KERNEL_DATA_END = .;
}
.bss : ALIGN(0x1000) {
KERNEL_BSS_START = .;
*(.bss)
KERNEL_BSS_END = .;
}
/* make sure a free page is left in between to detect illegal accesses */
. += 4K;
/* the kernel stack */
.stack : ALIGN(0x1000) {
KERNEL_STACK_START = .;
KERNEL_STACK_BOTTOM = .;
. += 4K;
KERNEL_STACK_END = .;
KERNEL_STACK_TOP = .;
}
KERNEL_END = .;
}