1.1 --- a/stage2/irq.c Sat Feb 27 17:56:51 2016 +0100
1.2 +++ b/stage2/irq.c Sat Feb 27 18:34:50 2016 +0100
1.3 @@ -116,10 +116,10 @@
1.4 physical memory, but at the same address in virtual memory.
1.5 */
1.6
1.7 - virtual = stack_start - pagesize * 2;
1.8 - physical = stack_start + stack_size * task - pagesize * 2;
1.9 + virtual = stack_start;
1.10 + physical = stack_start + stack_size * task;
1.11
1.12 - init_page_table(page_table_start, virtual, physical, pagesize, 0x1e, task);
1.13 + init_page_table(page_table_start, virtual - pagesize * 2, physical - pagesize * 2, pagesize, 0x1e, task);
1.14
1.15 /* Map the page for initialisation. */
1.16
1.17 @@ -130,11 +130,11 @@
1.18 return address.
1.19 */
1.20
1.21 - init_stack(stack_start + stack_size * task, _got_copy_start, (void (*)()) plot_pattern, args, 3);
1.22 + init_stack(physical, _got_copy_start, (void (*)()) plot_pattern, args, 3);
1.23
1.24 /* Advance the stack pointer so that the adopted frame will be found. */
1.25
1.26 - stack_pointers[task] = stack_start - framesize;
1.27 + stack_pointers[task] = virtual - framesize;
1.28 }
1.29
1.30 void switch_task()
1.31 @@ -198,7 +198,7 @@
1.32 "lw $fp, -108($sp)\n"
1.33 "lw $ra, -112($sp)\n"
1.34 "lw $k0, -116($sp)\n"
1.35 - "mtc0 $k0, $14\n" /* CP0_EPC */
1.36 + "mtc0 $k0, $14\n" /* CP0_EPC */
1.37 "nop\n"
1.38 "jr $ra\n"
1.39 "nop"