-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkernel.lds
44 lines (36 loc) · 1.09 KB
/
kernel.lds
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
/*
* Set the architecture to mips.
*/
OUTPUT_ARCH(mips)
/*
* Set the ENTRY point of the program to _start.
*/
ENTRY(_start)
SECTIONS {
/* Exercise 3.10: Your code here. */
. = 0x80000080;
.tlb_miss_entry : { *(.text.tlb_miss_entry) }
. = 0x80000180;
.exc_gen_entry : { *(.text.exc_gen_entry) }
/* fill in the correct address of the key sections: text, data, bss. */
/* Hint: The loading address can be found in the memory layout. And the data section
* and bss section are right after the text section, so you can just define
* them after the text section.
*/
/* Step 1: Set the loading address of the text section to the location counter ".". */
/* Exercise 1.2: Your code here. (1/4) */
. = 0x80020000;
/* Step 2: Define the text section. */
/* Exercise 1.2: Your code here. (2/4) */
.text : { *(.text) }
/* Step 3: Define the data section. */
/* Exercise 1.2: Your code here. (3/4) */
.data : { *(.data) }
bss_start = .;
/* Step 4: Define the bss section. */
/* Exercise 1.2: Your code here. (4/4) */
.bss : { *(.bss) }
bss_end = .;
. = 0x80400000;
end = . ;
}