Complete (almost!) printf fmt support
[lunaix-os.git] / lunaix-os / link / linker.ld
1 ENTRY(start_)
2
3 /*
4     FUTURE: Use disk reader
5     A bit of messy here.
6     We will pull our higher half kernel out of this shit
7       and load it separately once we have our disk reader.
8 */
9
10 SECTIONS {
11     . = 0x100000;
12
13     /* 这里是我们的高半核初始化代码段和数据段 */
14
15     .hhk_init_text BLOCK(4K) : {
16         * (.multiboot)
17         build/obj/arch/x86/*.o (.hhk_init)
18         build/obj/arch/x86/*.o (.text)
19     }
20
21     .hhk_init_bss BLOCK(4K) : {
22         build/obj/arch/x86/*.o (.bss)
23     }
24
25     .hhk_init_data BLOCK(4K) : {
26         build/obj/arch/x86/*.o (.data)
27     }
28
29     .hhk_init_rodata BLOCK(4K) : {
30         build/obj/arch/x86/*.o (.rodata)
31     }
32     __init_hhk_end = ALIGN(4K);
33
34     /* Relocation of our higher half kernel */
35     . += 0xC0000000;
36
37     /* 好了,我们的内核…… */
38     .text BLOCK(4K) : AT ( ADDR(.text) - 0xC0000000 ) {
39         __kernel_start = .;
40         build/obj/kernel/*.o (.text)
41         build/obj/hal/*.o (.text)
42     }
43
44     .bss BLOCK(4K) : AT ( ADDR(.bss) - 0xC0000000 ) {
45         build/obj/kernel/*.o (.bss)
46         build/obj/hal/*.o (.bss)
47     }
48
49     .data BLOCK(4k) : AT ( ADDR(.data) - 0xC0000000 ) {
50         build/obj/kernel/*.o (.data)
51         build/obj/hal/*.o (.data)
52     }
53
54     .rodata BLOCK(4K) : AT ( ADDR(.rodata) - 0xC0000000 ) {
55         build/obj/kernel/*.o (.rodata)
56         build/obj/hal/*.o (.rodata)
57     }
58
59     .kpg BLOCK(4K) : AT ( ADDR(.kpg) - 0xC0000000 ) {
60         build/obj/arch/x86/*.o (.kpg)
61     }
62
63     __kernel_end = ALIGN(4K);
64     __kernel_heap_start = ALIGN(4K);    /* 内核结束的地方即堆开始的地方 */
65 }