2.1 --- a/stage2/entry.S Thu May 05 12:19:24 2016 +0200
2.2 +++ b/stage2/entry.S Tue May 10 13:58:05 2016 +0200
2.3 @@ -136,9 +136,9 @@
2.4 lw $k1, 0($k1) /* &stack_pointers[current_task] */
2.5 sw $sp, 0($k1)
2.6
2.7 - /* Switch to the kernel stack. */
2.8 + /* Switch to the kernel exception stack. */
2.9
2.10 - li $sp, 0x80070000
2.11 + li $sp, 0x80008000
2.12
2.13 /* Invoke the rest of the interrupt handling process. */
2.14
3.1 --- a/stage2/head2.S Thu May 05 12:19:24 2016 +0200
3.2 +++ b/stage2/head2.S Tue May 10 13:58:05 2016 +0200
3.3 @@ -51,9 +51,9 @@
3.4 .word 0
3.5
3.6 real_start:
3.7 - /* Initialise the stack. */
3.8 + /* Initialise the default kernel stack. */
3.9
3.10 - la $sp, 0x80080000
3.11 + la $sp, 0x80004000
3.12
3.13 /* Initialise the globals pointer. */
3.14
4.1 --- a/stage2/tasks.c Thu May 05 12:19:24 2016 +0200
4.2 +++ b/stage2/tasks.c Tue May 10 13:58:05 2016 +0200
4.3 @@ -19,6 +19,7 @@
4.4
4.5 #include "cpu.h"
4.6 #include "cpu_op.h"
4.7 +#include "mips.h"
4.8 #include "paging.h"
4.9 #include "tasks.h"
4.10
4.11 @@ -33,7 +34,7 @@
4.12
4.13 /* Address locations and paging configuration. */
4.14
4.15 -const u32 stack_start = 0x00080000;
4.16 +const u32 stack_start = 0x01c00000;
4.17 const u32 stack_size = 0x00002000;
4.18 const u32 pagesize = 4 * 1024;
4.19
4.20 @@ -65,13 +66,14 @@
4.21
4.22 /*
4.23 Each task employs a stack at a multiple of the given start address in
4.24 - physical memory, but at the same address in virtual memory.
4.25 + physical memory, but at the same address in virtual memory. Task zero
4.26 + is never started.
4.27 */
4.28
4.29 virtual = stack_start;
4.30 physical = stack_start - stack_size * task;
4.31
4.32 - init_page_table(page_table_start, virtual - pagesize * 2, physical - pagesize * 2, pagesize, 0x1e, task);
4.33 + init_page_table(page_table_start, virtual - pagesize * 2, physical - pagesize * 2, pagesize, TLB_WRITE, task);
4.34
4.35 /*
4.36 Subtract from the stack pointer to prevent the called function from
4.37 @@ -89,18 +91,18 @@
4.38
4.39 /* Map the global object table for the task. */
4.40
4.41 - init_page_table(page_table_start, user_address((u32) &_got_start), user_address((u32) &_got_copy_start), pagesize, 0x1e, task);
4.42 + init_page_table(page_table_start, user_address((u32) &_got_start), user_address((u32) &_got_copy_start), pagesize, TLB_READ, task);
4.43
4.44 /* Map all shared pages for the task. */
4.45
4.46 for (address = (u32) &_payload_start; address < (u32) &_got_start; address += pagesize * 2)
4.47 {
4.48 - init_page_table(page_table_start, user_address(address), user_address(address), pagesize, 0x1e, task);
4.49 + init_page_table(page_table_start, user_address(address), user_address(address), pagesize, TLB_READ, task);
4.50 }
4.51
4.52 for (address = (u32) &_got_copy_end + pagesize * 2; address < (u32) &_memory_end; address += pagesize * 2)
4.53 {
4.54 - init_page_table(page_table_start, user_address(address), user_address(address), pagesize, 0x1e, task);
4.55 + init_page_table(page_table_start, user_address(address), user_address(address), pagesize, TLB_WRITE, task);
4.56 }
4.57 }
4.58