forked from iProgramMC/NanoShellOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
link.ld
65 lines (49 loc) · 1.16 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* Tell the linker that we want an ELF32 output file */
OUTPUT_FORMAT(elf32-i386)
OUTPUT_ARCH(i386)
/* Linker script for the OS */
OUTPUT_FORMAT(elf32-i386)
OUTPUT_ARCH(i386)
ENTRY (KeIPLEntry)
/* Here is where all of the sections of the kernel are defined. */
SECTIONS
{
/* Begin loading at 0x100000, as that's where GRUB will place our data. */
. = 1M;
_kernel_start = .;
/* start blocking out writes from here */
l_code_and_rodata_start = 0xC0100000;
.ipldata :
{
*(.ipldata .ipldata.*)
}
.ipltext :
{
*(.ipltext .ipltext.*)
}
. += 0xC0000000;
.text ALIGN (4K) : AT (ADDR (.text) - 0xC0000000)
{
*(.text .text.*)
}
.rodata ALIGN (4K) : AT (ADDR (.rodata) - 0xC0000000)
{
*(.rodata .rodata.*)
}
.data ALIGN (4K) : AT (ADDR (.data) - 0xC0000000)
{
/* place the end right where data starts to get that nice page alignment :) */
l_code_and_rodata_end = .;
*(.data .data.*)
}
.bss ALIGN (4K) : AT (ADDR (.bss) - 0xC0000000)
{
*(COMMON)
*(.bss .bss.*)
}
.section :
{
}
/* Add a symbol that indicates the end address of the kernel. */
_kernel_end = .;
}