1.1 --- a/stage2/cpu.c Sat Feb 27 18:34:50 2016 +0100
1.2 +++ b/stage2/cpu.c Sat Feb 27 19:20:32 2016 +0100
1.3 @@ -177,7 +177,7 @@
1.4 /* Wire in the kseg0 mapping and the page tables. */
1.5
1.6 asm volatile(
1.7 - "li $t1, 2\n" /* index of first randomly-replaced entry */
1.8 + "li $t1, 1\n" /* index of first randomly-replaced entry */
1.9 "mtc0 $t1, $6\n" /* CP0_WIRED */
1.10 "mtc0 $zero, $4\n" /* CP0_CONTEXT */
1.11 "mtc0 $zero, $10\n" /* CP0_ENTRYHI */
1.12 @@ -186,10 +186,6 @@
1.13 /* Map the code, making it globally available. */
1.14
1.15 map_page_index(0x80000000, 0x00000000, 16 * 1024 * 1024, 0x1f, 0, 0);
1.16 -
1.17 - /* Map the page tables. */
1.18 -
1.19 - map_page_index(page_table_start, page_table_start, 64 * 1024, 0x1f, 0, 1);
1.20 }
1.21
1.22 void map_page_index(u32 virtual, u32 physical, u32 pagesize, u8 flags, u8 asid, u32 index)
2.1 --- a/stage2/cpu.h Sat Feb 27 18:34:50 2016 +0100
2.2 +++ b/stage2/cpu.h Sat Feb 27 19:20:32 2016 +0100
2.3 @@ -17,7 +17,7 @@
2.4 void map_page_index(u32, u32, u32, u8, u8, u32);
2.5 void unmap_page(u32, u32, u32, u8, u8);
2.6
2.7 -#define page_table_start 0x00040000
2.8 +#define page_table_start 0x80040000
2.9 #define page_table_task_size 0x00008000
2.10 #define page_table_task_size_log2 15
2.11
3.1 --- a/stage2/entry.S Sat Feb 27 18:34:50 2016 +0100
3.2 +++ b/stage2/entry.S Sat Feb 27 19:20:32 2016 +0100
3.3 @@ -27,7 +27,7 @@
3.4
3.5 /* NOTE: Duplicated from cpu.h. */
3.6
3.7 -#define page_table_start 0x00040000
3.8 +#define page_table_start 0x80040000
3.9 #define page_table_task_size_log2 15
3.10
3.11 _tlb_entry:
4.1 --- a/stage2/irq.c Sat Feb 27 18:34:50 2016 +0100
4.2 +++ b/stage2/irq.c Sat Feb 27 19:20:32 2016 +0100
4.3 @@ -51,7 +51,7 @@
4.4 u32 current_stack_pointer;
4.5 extern u32 _got_copy_start;
4.6
4.7 -const u32 stack_start = 0x00080000;
4.8 +const u32 stack_start = 0x80080000;
4.9 const u32 stack_size = 0x00002000;
4.10 const u32 pagesize = 4 * 1024;
4.11 const u32 framesize = 120; /* see the handlers */
4.12 @@ -89,7 +89,7 @@
4.13
4.14 /* Switch task. */
4.15
4.16 - /* switch_task(); */
4.17 + switch_task();
4.18
4.19 /* Clear interrupt status. */
4.20
4.21 @@ -116,15 +116,11 @@
4.22 physical memory, but at the same address in virtual memory.
4.23 */
4.24
4.25 - virtual = stack_start;
4.26 physical = stack_start + stack_size * task;
4.27 + virtual = physical;
4.28
4.29 init_page_table(page_table_start, virtual - pagesize * 2, physical - pagesize * 2, pagesize, 0x1e, task);
4.30
4.31 - /* Map the page for initialisation. */
4.32 -
4.33 - map_page(physical, physical, pagesize, 0x1e, 0);
4.34 -
4.35 /*
4.36 Set the stack for the new task, initialising the global pointer and
4.37 return address.
5.1 --- a/stage2/stage2.c Sat Feb 27 18:34:50 2016 +0100
5.2 +++ b/stage2/stage2.c Sat Feb 27 19:20:32 2016 +0100
5.3 @@ -50,7 +50,6 @@
5.4
5.5 start_task(1);
5.6 start_task(2);
5.7 - invoke_task(1);
5.8
5.9 /* Now, wait for the tasks to be selected as interrupts occur. */
5.10