-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlink.ld
47 lines (40 loc) · 1019 Bytes
/
link.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
ENTRY(_core)
OUTPUT_FORMAT(elf32-i386)
SECTIONS
{
. = 0x7C00; /* osboot.asm starts at 0x7C00*/
.osboot : AT(0x7C00) SUBALIGN(4)
{
osboot.o(.text)
osboot.o(.*)
}
. = 0x7DFE;
.bootsig : {
SHORT(0xaa55);
}
. = 0x7E00; /* osload.asm starts at 0x7E00. We need a place to jmp to from osboot */
.osload : AT(0x7E00) SUBALIGN(4)
{
osload.o(.text)
osload.o(.*)
}
. = 0x819e; /* core.c started at 0x8000. As the os grows so will this address. This is the address where the core _core starts */
._core : SUBALIGN(4)
{
*(.text*)
*(.rodata*)
*(.data*)
}
.bss : SUBALIGN(4) {
__bss_start = .;
*(COMMON);
*(.bss*);
}
. = ALIGN(4); /* Round BSS up to 4 byte boundary */
__bss_end = .;
kernel_sectors = (SIZEOF(._core) + 511) / 512;
/DISCARD/ : {
*(.eh_frame)
*(.comment)
}
}