aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sys/kernel.S10
-rw-r--r--src/util/status.c15
-rw-r--r--src/util/time.c5
3 files changed, 26 insertions, 4 deletions
diff --git a/src/sys/kernel.S b/src/sys/kernel.S
index 4a3c096..356cedd 100644
--- a/src/sys/kernel.S
+++ b/src/sys/kernel.S
@@ -3,9 +3,16 @@
.globl kernel_main
kernel_main:
bl sysinit
+ ///https://wiki.osdev.org/ARM_Paging
+ // Query the ID_MMFR0 register
+ mrc p15, 0, r0, c0, c1, 4
+ bl uart_hexn
+ // Switch to user mode
cps #0x10
// Intentional undefined instruction
- .word 0xf7f0a000
+ //.word 0xf7f0a000
+ // This will fail in user mode
+ mrc p15, 3, r0, c15, c0, 0
// Supervisor Call #1 - Does nothing special
svc #1
mrs r0, cpsr
@@ -15,7 +22,6 @@ kernel_main:
mrs r0, cpsr
bl uart_hexn
1:
- //bl schedule
wfe
b 1b
diff --git a/src/util/status.c b/src/util/status.c
index ac801d1..dd2b899 100644
--- a/src/util/status.c
+++ b/src/util/status.c
@@ -124,12 +124,14 @@ void status(void)
write_cchar(&g_Drawer, '!', 0xFF00FF);
}
+
g_Drawer.x = 0;
g_Drawer.y = 9;
+ write_string(&g_Drawer, "SVC IRQ FIQ User/SYS\n");
for(int i = 0; i < 128; i++)
write_char(&g_Drawer, ' ');
g_Drawer.x = 0;
- g_Drawer.y = 9;
+ g_Drawer.y = 10;
unsigned long sp = (unsigned long)getsvcstack();
write_hex32(&g_Drawer, sp);
@@ -143,14 +145,23 @@ void status(void)
sp = (unsigned long)getsysstack();
write_hex32(&g_Drawer, sp);
write_char(&g_Drawer, '\n');
+ /* WRITE Stack Values
for(unsigned long i = 1; i <= 14; i++) {
- write_hex32(&g_Drawer, *(unsigned long*)(0x4000 - i*4));
+ write_hex32(&g_Drawer, *(unsigned long*)(0x2000 - i*4));
if(i % 6 == 0) {
write_char(&g_Drawer, '\n');
} else {
write_char(&g_Drawer, ' ');
}
}
+ write_char(&g_Drawer, '\n');
+ */
+ unsigned long coren;
+ asm volatile (
+ "mrc p15, #0, %0, c0, c0, #5\n"
+ "and %0, %0, #3" : "=r"(coren) :: "cc");
+ write_string(&g_Drawer, "Status Updated by Core #");
+ write_10(&g_Drawer, coren);
g_Drawer.x = x;
g_Drawer.y = y;
diff --git a/src/util/time.c b/src/util/time.c
index 035ff82..a0c539b 100644
--- a/src/util/time.c
+++ b/src/util/time.c
@@ -1,6 +1,11 @@
#include <symbols.h>
#include <sys/core.h>
+void routing_core0cntv_to_core0fiq(void)
+{
+ store32(0x80, CORE0_TIMER_IRQCNTL);
+}
+
void routing_core0cntv_to_core0irq(void)
{
store32(0x08, CORE0_TIMER_IRQCNTL);