forked from rust-osdev/bootloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinker.ld
50 lines (45 loc) · 916 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
ENTRY(_start)
SECTIONS {
. = 0x500;
/* buffer for loading the kernel */
_kernel_buffer = .;
. += 512;
/* page tables */
. = ALIGN(0x1000);
__page_table_start = .;
_p4 = .;
. += 0x1000;
_p3 = .;
. += 0x1000;
_p2 = .;
. += 0x1000;
_p1 = .;
. += 0x1000;
__page_table_end = .;
__bootloader_start = .;
_memory_map = .;
. += 0x1000;
_stack_start = .;
. = 0x7c00;
_stack_end = .;
.bootloader :
{
/* first stage */
*(.boot-first-stage)
/* rest of bootloader */
_rest_of_bootloader_start_addr = .;
*(.boot)
*(.context_switch)
*(.text .text.*)
*(.rodata .rodata.*)
*(.data .data.*)
*(.got)
. = ALIGN(512);
_rest_of_bootloader_end_addr = .;
__bootloader_end = .;
}
.kernel :
{
KEEP(*(.kernel))
}
}