load stage2 high to leave the low RAM for the kernel
[eightysix] / boot.ld
1 OUTPUT_FORMAT(binary)
2 ENTRY(_start)
3
4 SECTIONS {
5         . = 0x7c00;
6         .bootsect : {
7                 * (.bootsect);
8         }
9         _bootsect_end = .;
10
11         /* load high out of the way, to allow stage2 to load the kernel low */
12         . = 0x80000;
13         _stage2_start = .;
14         _stage2_start_seg = _stage2_start >> 4;
15         .text : AT(_bootsect_end) {
16                 * (.startup);
17                 * (.text*);
18         }
19         .data : {
20                 * (.rodata*);
21                 * (.data*);
22         }
23         .bss ALIGN(4) (NOLOAD): {
24                 _bss_start = .;
25                 _bss_start_off = _bss_start - _stage2_start;
26                 * (.bss*);
27                 * (COMMON);
28                 . = ALIGN(4);
29         }
30         _bss_size = SIZEOF(.bss);
31         . = ALIGN(4);
32         _stage2_end = .;
33         _stage2_size = _stage2_end - _stage2_start;
34 };