Subversion Repositories HelenOS-historic

Rev

Rev 300 | Rev 328 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 300 Rev 301
1
/** IA-32 linker script
1
/** IA-32 linker script
2
 *  
2
 *  
3
 * umapped section:
3
 * umapped section:
4
 * 	kernel text
4
 * 	kernel text
5
 * 	kernel data
5
 * 	kernel data
6
 * mapped section:
6
 * mapped section:
7
 *	kernel text
7
 *	kernel text
8
 *	kernel data 
8
 *	kernel data 
9
 */
9
 */
10
 
10
 
-
 
11
#define __ASM__
-
 
12
#include <arch/boot/boot.h>
-
 
13
#include <arch/mm/page.h>
-
 
14
 
11
OUTPUT_FORMAT(binary)
15
OUTPUT_FORMAT(binary)
12
ENTRY(kernel_image_start)
16
ENTRY(kernel_image_start)
13
 
17
 
14
SECTIONS {
18
SECTIONS {
15
	.unmapped 0x8000: AT (0x8000) {
19
	.unmapped BOOTSTRAP_OFFSET: AT (BOOTSTRAP_OFFSET) {
16
		unmapped_ktext_start = .;
20
		unmapped_ktext_start = .;
17
		*(K_TEXT_START);
21
		*(K_TEXT_START);
18
		*(K_TEXT_START_2);
22
		*(K_TEXT_START_2);
19
		unmapped_ktext_end = .;
23
		unmapped_ktext_end = .;
20
		
24
		
21
		unmapped_kdata_start = .;
25
		unmapped_kdata_start = .;
22
		*(K_DATA_START);
26
		*(K_DATA_START);
23
		unmapped_kdata_end = .;
27
		unmapped_kdata_end = .;
24
	}
28
	}
25
	
29
	
26
	.mapped (0x80100000+0x8000+SIZEOF(.unmapped)): AT (0x8000+SIZEOF(.unmapped)) { 
30
	.mapped (PA2KA(BOOT_OFFSET+BOOTSTRAP_OFFSET)+SIZEOF(.unmapped)): AT (BOOTSTRAP_OFFSET+SIZEOF(.unmapped)) { 
27
		ktext_start = .;
31
		ktext_start = .;
28
		*(BOOT_DATA)
32
		*(BOOT_DATA)
29
		*(.text);
33
		*(.text);
30
		ktext_end = .;
34
		ktext_end = .;
31
		
35
		
32
		kdata_start = .;
36
		kdata_start = .;
33
		*(.data);		/* initialized data */
37
		*(.data);		/* initialized data */
34
		*(.rodata*);		/* string literals */
38
		*(.rodata*);		/* string literals */
35
		*(COMMON);		/* global variables */
39
		*(COMMON);		/* global variables */
36
		hardcoded_load_address = .;
40
		hardcoded_load_address = .;
37
		LONG(0x80108000);
41
		LONG(PA2KA(BOOT_OFFSET+BOOTSTRAP_OFFSET));
38
		hardcoded_ktext_size = .;
42
		hardcoded_ktext_size = .;
39
		LONG(ktext_end - ktext_start + (unmapped_ktext_end - unmapped_ktext_start));
43
		LONG(ktext_end - ktext_start + (unmapped_ktext_end - unmapped_ktext_start));
40
		hardcoded_kdata_size = .;
44
		hardcoded_kdata_size = .;
41
		LONG(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start));
45
		LONG(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start));
42
		hardcoded_unmapped_ktext_size = .;
46
		hardcoded_unmapped_ktext_size = .;
43
		LONG(unmapped_ktext_end - unmapped_ktext_start);
47
		LONG(unmapped_ktext_end - unmapped_ktext_start);
44
		hardcoded_unmapped_kdata_size = .;
48
		hardcoded_unmapped_kdata_size = .;
45
		LONG(unmapped_kdata_end - unmapped_kdata_start);
49
		LONG(unmapped_kdata_end - unmapped_kdata_start);
46
		*(.bss);		/* uninitialized static variables */
50
		*(.bss);		/* uninitialized static variables */
47
		*(K_DATA_END);
51
		*(K_DATA_END);
48
 
52
 
49
		symbol_table = .;
53
		symbol_table = .;
50
		*(symtab.*);            /* Symbol table, must be LAST symbol!*/
54
		*(symtab.*);            /* Symbol table, must be LAST symbol!*/
51
 
55
 
52
		kdata_end = .;
56
		kdata_end = .;
53
	}
57
	}
54
	
58
	
55
	_hardcoded_kernel_size = (ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start) + (kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start);
59
	_hardcoded_kernel_size = (ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start) + (kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start);
56
	_hardcoded_unmapped_size = (unmapped_ktext_end - unmapped_ktext_start) + (unmapped_kdata_end - unmapped_kdata_start);
60
	_hardcoded_unmapped_size = (unmapped_ktext_end - unmapped_ktext_start) + (unmapped_kdata_end - unmapped_kdata_start);
57
	
61
	
58
	_map_address = 0x80100000;
-
 
59
	e820table_boot = e820table - _map_address;
62
	e820table_boot = KA2PA(e820table) - BOOT_OFFSET;
60
	e820counter_boot = e820counter - _map_address;
63
	e820counter_boot = KA2PA(e820counter) - BOOT_OFFSET;
61
	real_bootstrap_gdtr = real_bootstrap_gdtr_boot + 0x80000000;
64
	real_bootstrap_gdtr = PA2KA(real_bootstrap_gdtr_boot);
62
}
65
}
63
 
66