changeset 388:e07c2a9abac1

Enabled paging in kernel
author Windel Bouwman
date Fri, 02 May 2014 14:51:46 +0200
parents 34ac19044b8a
children 2ec730e45ea1 b77f3290ac79
files kernel/arch/qemu_vexpress/startup_a9.asm kernel/arch/vexpressA9.c3
diffstat 2 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/kernel/arch/qemu_vexpress/startup_a9.asm	Thu May 01 22:09:18 2014 +0200
+++ b/kernel/arch/qemu_vexpress/startup_a9.asm	Fri May 02 14:51:46 2014 +0200
@@ -34,8 +34,8 @@
 ; Enable the VMSA (Virtual memory system architecture):
 mrc p15, 0, r0, c1, c0, 0
 ; TODO:
-; mov r1, 0x1
-; orr r0, r0, r1 ; TODO: implement orr r0, r0, 1
+mov r1, 0x1
+orr r0, r0, r1 ; TODO: implement orr r0, r0, 1
 mcr p15, 0, r0, c1, c0, 0
 
 ; Setup stack:
@@ -77,8 +77,15 @@
 section mem_tables
 
 kernel_table0:
- dcd 0x000402 ; Identity map first 1 MB
- repeat 0xFFE
+ dcd 0x00000402 ; Identity map first 1 MB
+ dcd 0x10000402 ; Map to peripheral space 1 MB
+ repeat 0x5FE
  dcd 0
  endrepeat
 
+ dcd 0x00000402 ; Alias to 0x0
+
+ repeat 0x9FF
+ dcd 0
+ endrepeat
+
--- a/kernel/arch/vexpressA9.c3	Thu May 01 22:09:18 2014 +0200
+++ b/kernel/arch/vexpressA9.c3	Fri May 02 14:51:46 2014 +0200
@@ -16,7 +16,7 @@
 function void putc(int c)
 {
     var int *UART0DR;
-    UART0DR = cast<int*>(0x10009000); // UART0 DR register
+    UART0DR = cast<int*>(0x109000); // UART0 DR register when remapped at 1MB
     *UART0DR = c;
 }