refactor: full rewrite of signal feature
[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         arch/*.o (.hhk_init)
18         arch/*.o (.text)
19     }
20
21     .hhk_init_bss BLOCK(4K) : {
22         arch/*.o (.bss)
23     }
24
25     .hhk_init_data BLOCK(4K) : {
26         arch/*.o (.data)
27     }
28
29     .hhk_init_rodata BLOCK(4K) : {
30         arch/*.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         PROVIDE(__ktext_start = .);
41         
42         kernel/*.o (.text)
43         hal/*.o (.text)
44         debug/*.o (.text)
45         libs/*.o (.text)
46
47         PROVIDE(__ktext_end = .);
48     }
49
50     .data BLOCK(4K) : AT ( ADDR(.data) - 0xC0000000 ) {
51         kernel/*.o (.data)
52         hal/*.o (.data)
53         debug/*.o (.data)
54         libs/*.o (.data)
55     }
56
57     .rodata BLOCK(4K) : AT ( ADDR(.rodata) - 0xC0000000 ) {
58         kernel/*.o (.rodata)
59         hal/*.o (.rodata)
60         debug/*.o (.rodata)
61         libs/*.o (.rodata)
62     }
63
64     .kpg BLOCK(4K) : AT ( ADDR(.kpg) - 0xC0000000 ) {
65         arch/*.o (.kpg)
66     }
67
68     .bss BLOCK(4K) : AT ( ADDR(.bss) - 0xC0000000 ) {
69         kernel/*.o (.bss)
70         hal/*.o (.bss)
71         debug/*.o (.bss)
72         libs/*.o (.bss)
73     }
74
75     __kernel_end = ALIGN(4K);
76 }