-
Notifications
You must be signed in to change notification settings - Fork 0
/
linker.ld
58 lines (49 loc) · 987 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
52
53
54
55
56
57
58
OUTPUT_FORMAT(elf64-x86-64)
SEARCH_DIR(kernel/target/target/release)
ENTRY(_bootstart)
OUTPUT(
bootloader.elf
)
INPUT (
bootloader.o
print.o
readDisk.o
secondStage.o
gdt_64.o
paging.o
CPUID.o
librust_os.a
)
SECTIONS
{
.bootloader 0x7C00 : SUBALIGN(2) {
bootloader.o(.text);
print.o(.text);
readDisk.o(.text);
}
.bootloader_data : SUBALIGN(2) {
bootloader.o(.data);
print.o(.data);
readDisk.o(.data);
bootloader.o(.rodata);
print.o(.rodata);
readDisk.o(.rodata);
}
/* Place the boot signature at LMA/VMA 0x7DFE */
.sig 0x7DFE : {
SHORT(0xaa55);
}
.secondStage 0x8000 :
{
*(.text);
*(.data);
librust_os.a(*);
FILL(0x00);
. = ALIGN(0x4000);
}
.idt BLOCK(0x1000) :
{
_IDT = .;
. += 0x1000;
}
}