refactor: decouple i386 specific instruction invocation
[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     .hhk_init_text BLOCK(4K) : {
15         *(.multiboot)
16         *(.hhk_init_text)
17     }
18
19     .hhk_init_bss BLOCK(4K) : {
20         *(.hhk_init_bss)
21     }
22
23     .hhk_init_data BLOCK(4K) : {
24         *(.hhk_init_data)
25     }
26
27     .hhk_init_rodata BLOCK(4K) : {
28         *(.hhk_init_rodata)
29     }
30     __init_hhk_end = ALIGN(4K);
31
32     /* Relocation of our higher half kernel */
33     . += 0xC0000000;
34
35     /* 好了,我们的内核…… */
36     .text BLOCK(4K) : AT ( ADDR(.text) - 0xC0000000 ) {
37         __kernel_start = .;
38         PROVIDE(__ktext_start = .);
39         
40         *(.text)
41
42         PROVIDE(__ktext_end = .);
43     }
44
45     .data BLOCK(4K) : AT ( ADDR(.data) - 0xC0000000 ) {
46         *(.data)
47     }
48
49     .rodata BLOCK(4K) : AT ( ADDR(.rodata) - 0xC0000000 ) {
50         *(.rodata)
51     }
52
53     .kpg BLOCK(4K) : AT ( ADDR(.kpg) - 0xC0000000 ) {
54         *(.kpg)
55     }
56
57     .bss BLOCK(4K) : AT ( ADDR(.bss) - 0xC0000000 ) {
58         *(.bss)
59     }
60
61     __kernel_end = ALIGN(4K);
62 }