aboutsummaryrefslogtreecommitdiff
path: root/kernel_stage2.ld
blob: dce2d1f9621cbde5651a300484d33d9bb2ef2a5b (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* This sesond stage of the kernel is run from address 0x0 */

TRANSLATION_TABLE_SIZE = 4096 * 4;
MMU_SECTION_SIZE = 1 << 20;

SECTIONS
{

	. = 0x0;

	__start = .;
	.interrupt_vector :
	{
		KEEP(interrupt_vector.o)
	}
	. = ALIGN(4);
	.embedded_ramfs :
	{
		ramfs_embeddable.o
	}
	.rest_of_kernel :
	{
		*(.text)
		*(.data)
		*(.rodata)
		*(.bss)
		*(/COMMON/)
	}
	__end = .;

	. = ALIGN(1 << 14);
	
	.translation_table (NOLOAD) :
	{
		_translation_table_start = .;
		
		. = . + TRANSLATION_TABLE_SIZE;

		_translation_table_end = .;
	}

	. = ALIGN(1 << 20);
	. = . + MMU_SECTION_SIZE;
	
	.stack (NOLOAD) :
	{
		_stack_start = .;
		
		. = . + MMU_SECTION_SIZE;

		_stack_top = .;
	}

	.unprivileged_memory (NOLOAD) :
	{
		_unprivileged_memory_start = .;
		
		. = . + MMU_SECTION_SIZE;

		_unprivileged_memory_end = .;
	}
}