-
Notifications
You must be signed in to change notification settings - Fork 0
/
linker.ld
51 lines (41 loc) · 945 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
49
50
51
OUTPUT_FORMAT(elf32-i386)
ENTRY(_loader)
phys = 0x100000;
offset = 0xC0000000;
virt = offset + phys;
SECTIONS
{
. = virt;
KernelStart = .;
PhysKernelStart = . - offset;
.text : AT(ADDR(.text) - offset) {
g_text = .;
*(.BOOT)
*(.text)
*(.rodata)
. = ALIGN(0x1000);
}
.data : AT(ADDR(.data) - offset) {
g_data = .;
*(.data)
. = ALIGN(0x1000);
}
.bss : AT(ADDR(.bss) - offset) {
g_bss = .;
*(COMMON)
*(.bss)
. = ALIGN(0x1000);
kernel_page_directory = .;
. = . + 0x3000; /* 3 Pages (12KB) for the page directory */
kernel_page_tables = .;
. = . + 0x100000; /* 256 pages for kernel page directory */
. = ALIGN(0x1000);
}
KernelEnd = .;
PhysKernelEnd = . - offset;
/DISCARD/ : {
*(.comment)
*(.eh_frame)
*(.note.gnu.build-id)
}
}