-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboot.ld
47 lines (38 loc) · 788 Bytes
/
boot.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
/* Linker script */
/* Output flat binary (no structure) */
OUTPUT_FORMAT(binary)
SECTIONS{
/* Load address */
. = 0x7c00;
/* Stage 1 */
.text :
{
rt0.o (.text .data .bss .rodata)
bootloader.o (.text .data .bss .rodata)
utils.o (.text .data .bss .rodata)
}
/* Boot signature address */
. = 0x7c00 + 510;
/* Boot signature */
.signature :
{
BYTE(0x55)
BYTE(0xAA)
}
/* For load_sector() */
_STAGE2_ADDR = .;
/* Stage 2*/
.text2 :
{
kernel.o (.text .data .bss .rodata)
syscall.o (.text .data .bss .rodata)
runtime.o (.text .data .bss .rodata)
tyos.o (.text .data .bss .rodata)
mbr.o (.text .data .bss .rodata)
}
_STAGE2_SIZE = . - _STAGE2_ADDR;
/* Just bellow 7c00h */
_END_STACK = 0x7c00;
}
/* Prepend with the start file */
STARTUP(rt0.o)