Subversion Repositories HelenOS

Rev

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

Rev 1787 Rev 2089
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>
11
#include <arch/boot/boot.h>
13
#include <arch/mm/page.h>
12
#include <arch/mm/page.h>
14
 
13
 
15
SECTIONS {
14
SECTIONS {
16
	.unmapped BOOT_OFFSET: AT (0) {
15
	.unmapped BOOT_OFFSET: AT (0) {
17
		unmapped_ktext_start = .;
16
		unmapped_ktext_start = .;
18
		*(K_TEXT_START);
17
		*(K_TEXT_START);
19
		unmapped_ktext_end = .;
18
		unmapped_ktext_end = .;
20
	
19
	
21
		unmapped_kdata_start = .;
20
		unmapped_kdata_start = .;
22
		*(K_DATA_START);
21
		*(K_DATA_START);
23
		unmapped_kdata_end = .;
22
		unmapped_kdata_end = .;
24
	}
23
	}
25
	
24
	
26
	.mapped (PA2KA(BOOT_OFFSET)+SIZEOF(.unmapped)): AT (SIZEOF(.unmapped)) { 
25
	.mapped (PA2KA(BOOT_OFFSET)+SIZEOF(.unmapped)): AT (SIZEOF(.unmapped)) { 
27
		ktext_start = .;
26
		ktext_start = .;
28
		*(.text);
27
		*(.text);
29
		ktext_end = .;
28
		ktext_end = .;
30
		
29
		
31
		kdata_start = .;
30
		kdata_start = .;
32
		*(.data);			/* initialized data */
31
		*(.data);			/* initialized data */
33
		*(.rodata*);			/* string literals */
32
		*(.rodata*);			/* string literals */
34
		*(COMMON);			/* global variables */
33
		*(COMMON);			/* global variables */
35
		hardcoded_load_address = .;
34
		hardcoded_load_address = .;
36
		LONG(PA2KA(BOOT_OFFSET));
35
		LONG(PA2KA(BOOT_OFFSET));
37
		hardcoded_ktext_size = .;
36
		hardcoded_ktext_size = .;
38
		LONG((ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start));
37
		LONG((ktext_end - ktext_start) + (unmapped_ktext_end - unmapped_ktext_start));
39
		hardcoded_kdata_size = .;
38
		hardcoded_kdata_size = .;
40
		LONG((kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start));
39
		LONG((kdata_end - kdata_start) + (unmapped_kdata_end - unmapped_kdata_start));
41
		hardcoded_unmapped_ktext_size = .;
40
		hardcoded_unmapped_ktext_size = .;
42
		LONG(unmapped_ktext_end - unmapped_ktext_start);
41
		LONG(unmapped_ktext_end - unmapped_ktext_start);
43
		hardcoded_unmapped_kdata_size = .;
42
		hardcoded_unmapped_kdata_size = .;
44
		LONG(unmapped_kdata_end - unmapped_kdata_start);
43
		LONG(unmapped_kdata_end - unmapped_kdata_start);
45
		symbol_table = .;
44
		symbol_table = .;
46
		*(symtab.*);            	/* Symbol table, must be LAST symbol! */
45
		*(symtab.*);            	/* Symbol table, must be LAST symbol! */
47
		*(.bss);			/* uninitialized static variables */
46
		*(.bss);			/* uninitialized static variables */
48
		kdata_end = .;
47
		kdata_end = .;
49
	}
48
	}
50
 
49
 
51
	/DISCARD/ : {
50
	/DISCARD/ : {
52
		*(.note.GNU-stack);		
51
		*(.note.GNU-stack);		
53
		*(.comment);
52
		*(.comment);
54
	}
53
	}
55
	
54
	
56
#ifdef CONFIG_SMP	
55
#ifdef CONFIG_SMP	
57
	
56
	
58
	_hardcoded_unmapped_size = (unmapped_ktext_end - unmapped_ktext_start) + (unmapped_kdata_end - unmapped_kdata_start);
57
	_hardcoded_unmapped_size = (unmapped_ktext_end - unmapped_ktext_start) + (unmapped_kdata_end - unmapped_kdata_start);
59
	ap_boot = unmapped_ap_boot - BOOT_OFFSET + AP_BOOT_OFFSET;
58
	ap_boot = unmapped_ap_boot - BOOT_OFFSET + AP_BOOT_OFFSET;
60
	ap_gdtr = unmapped_ap_gdtr - BOOT_OFFSET + AP_BOOT_OFFSET;
59
	ap_gdtr = unmapped_ap_gdtr - BOOT_OFFSET + AP_BOOT_OFFSET;
61
	protected_ap_gdtr = PA2KA(ap_gdtr);
60
	protected_ap_gdtr = PA2KA(ap_gdtr);
62
 
61
 
63
#endif /* CONFIG_SMP */
62
#endif /* CONFIG_SMP */
64
 
63
 
65
}
64
}
66
 
65