annotate kernel/arch/vexpressA9.c3 @ 388:e07c2a9abac1

Enabled paging in kernel
author Windel Bouwman
date Fri, 02 May 2014 14:51:46 +0200
parents 6df89163e114
children
rev   line source
352
899ae3aea803 First kernel run for vexpressA9
Windel Bouwman
parents:
diff changeset
1 module arch;
367
577ed7fb3fe4 Try to make thumb work again
Windel Bouwman
parents: 362
diff changeset
2 import io;
352
899ae3aea803 First kernel run for vexpressA9
Windel Bouwman
parents:
diff changeset
3
362
c05ab629976a Added CPUID for arm
Windel Bouwman
parents: 354
diff changeset
4
352
899ae3aea803 First kernel run for vexpressA9
Windel Bouwman
parents:
diff changeset
5 function void init()
899ae3aea803 First kernel run for vexpressA9
Windel Bouwman
parents:
diff changeset
6 {
354
5477e499b039 Added some sort of string functionality
Windel Bouwman
parents: 353
diff changeset
7 // putc(65)
381
6df89163e114 Fix section and ldr pseudo instruction
Windel Bouwman
parents: 367
diff changeset
8 io.print2("PFR0 = ", pfr0());
6df89163e114 Fix section and ldr pseudo instruction
Windel Bouwman
parents: 367
diff changeset
9 io.print2("PFR1 = ", pfr1());
6df89163e114 Fix section and ldr pseudo instruction
Windel Bouwman
parents: 367
diff changeset
10 io.print2("MMFR0 = ", mmfr0());
6df89163e114 Fix section and ldr pseudo instruction
Windel Bouwman
parents: 367
diff changeset
11
6df89163e114 Fix section and ldr pseudo instruction
Windel Bouwman
parents: 367
diff changeset
12 // This below is not compatible with all qemu versions:
6df89163e114 Fix section and ldr pseudo instruction
Windel Bouwman
parents: 367
diff changeset
13 // io.print2("MPUIR = ", arch.mpuir());
353
b8ad45b3a573 Started with strings
Windel Bouwman
parents: 352
diff changeset
14 }
b8ad45b3a573 Started with strings
Windel Bouwman
parents: 352
diff changeset
15
b8ad45b3a573 Started with strings
Windel Bouwman
parents: 352
diff changeset
16 function void putc(int c)
b8ad45b3a573 Started with strings
Windel Bouwman
parents: 352
diff changeset
17 {
352
899ae3aea803 First kernel run for vexpressA9
Windel Bouwman
parents:
diff changeset
18 var int *UART0DR;
388
e07c2a9abac1 Enabled paging in kernel
Windel Bouwman
parents: 381
diff changeset
19 UART0DR = cast<int*>(0x109000); // UART0 DR register when remapped at 1MB
353
b8ad45b3a573 Started with strings
Windel Bouwman
parents: 352
diff changeset
20 *UART0DR = c;
352
899ae3aea803 First kernel run for vexpressA9
Windel Bouwman
parents:
diff changeset
21 }
899ae3aea803 First kernel run for vexpressA9
Windel Bouwman
parents:
diff changeset
22
899ae3aea803 First kernel run for vexpressA9
Windel Bouwman
parents:
diff changeset
23 function void halt()
899ae3aea803 First kernel run for vexpressA9
Windel Bouwman
parents:
diff changeset
24 {
381
6df89163e114 Fix section and ldr pseudo instruction
Windel Bouwman
parents: 367
diff changeset
25 while(true) {}
352
899ae3aea803 First kernel run for vexpressA9
Windel Bouwman
parents:
diff changeset
26 }
899ae3aea803 First kernel run for vexpressA9
Windel Bouwman
parents:
diff changeset
27
381
6df89163e114 Fix section and ldr pseudo instruction
Windel Bouwman
parents: 367
diff changeset
28 function int pfr0();
6df89163e114 Fix section and ldr pseudo instruction
Windel Bouwman
parents: 367
diff changeset
29 function int pfr1();
6df89163e114 Fix section and ldr pseudo instruction
Windel Bouwman
parents: 367
diff changeset
30 function int mmfr0();
6df89163e114 Fix section and ldr pseudo instruction
Windel Bouwman
parents: 367
diff changeset
31 // function int mpuir();
6df89163e114 Fix section and ldr pseudo instruction
Windel Bouwman
parents: 367
diff changeset
32