aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-01-12 22:42:38 -0700
committerChristian Cunningham <cc@localhost>2022-01-12 22:42:38 -0700
commit17bf7c7f1805fa70bf5a768c535df8f1ca9c0321 (patch)
treeb1fa6a530e59bbe6b1b70743c41dfe7fdf02fabf
parent8520d34e890885c19966346155675a2532b6feda (diff)
Started filling out handlers
-rw-r--r--src/boot.S57
-rw-r--r--src/cpu/irq.c2
-rw-r--r--src/sys/core.c7
3 files changed, 42 insertions, 24 deletions
diff --git a/src/boot.S b/src/boot.S
index 686fe01..6bb24ae 100644
--- a/src/boot.S
+++ b/src/boot.S
@@ -67,34 +67,51 @@ io_halt:
b io_halt
io_halt_undefined:
+ stmfd sp!, {r0-r12,lr}
+ ldr r0, [lr, #-8]
+ push {r0}
ldr r0, =undefined_msg
- ldr r0, [r0]
- bl uart_char
- b io_halt
+ bl uart_string
+ pop {r0}
+ bl uart_hexn
+ // Skip instruction for now
+ // In future,
+ // ldmfd ... pc->lr
+ // subs pc, lr, #8
+ ldmfd sp!, {r0-r12,pc}^
io_halt_swi:
+ stmfd sp!, {r0-r12,lr}
+ ldr r0, [lr, #-4]
+ bic r0, #0xFF000000
+ push {r0}
ldr r0, =swi_msg
- ldr r0, [r0]
- bl uart_char
- b io_halt
+ bl uart_string
+ pop {r0}
+ bl uart_hexn
+ ldmfd sp!, {r0-r12,pc}^
io_halt_prefetch:
ldr r0, =prefetch_msg
- ldr r0, [r0]
- bl uart_char
+ push {lr}
+ bl uart_string
+ pop {lr}
b io_halt
io_halt_data:
ldr r0, =data_msg
- ldr r0, [r0]
- bl uart_char
+ push {lr}
+ bl uart_string
+ pop {lr}
b io_halt
io_halt_unused:
ldr r0, =unused_msg
- ldr r0, [r0]
- bl uart_char
+ push {lr}
+ bl uart_string
+ pop {lr}
b io_halt
io_halt_fiq:
ldr r0, =fiq_msg
- ldr r0, [r0]
- bl uart_char
+ push {lr}
+ bl uart_string
+ pop {lr}
b io_halt
.align 5
@@ -116,9 +133,11 @@ data_handler: .word io_halt_data
unused_handler: .word io_halt_unused
irq_handler: .word irq
fiq_handler: .word io_halt_fiq
-undefined_msg: .asciz "Undefined\n"
-swi_msg: .asciz "SWI\n"
-prefetch_msg: .asciz "Prefetch\n"
-data_msg: .asciz "Data\n"
-unused_msg: .asciz "unused\n"
+
+.section .data
+undefined_msg: .asciz "Undefined Handler\n"
+swi_msg: .asciz "SWI Handler\n"
+prefetch_msg: .asciz "Prefetch Handler\n"
+data_msg: .asciz "Data Handler\n"
+unused_msg: .asciz "Unused Handler\n"
fiq_msg: .asciz "FIQ\n"
diff --git a/src/cpu/irq.c b/src/cpu/irq.c
index c0fd367..ca64335 100644
--- a/src/cpu/irq.c
+++ b/src/cpu/irq.c
@@ -67,7 +67,7 @@ void c_irq_handler(void)
} else if (data == 0x61) {
cmd[off] = (char) data;
off += 1;
- heap_info_u();
+ //heap_info_u();
// Else output
} else {
cmd[off] = (char) data;
diff --git a/src/sys/core.c b/src/sys/core.c
index 13fdbfe..c1c75ba 100644
--- a/src/sys/core.c
+++ b/src/sys/core.c
@@ -57,10 +57,9 @@ void sysinit(void)
enableirq();
enablefiq();
- add_thread(testlocal, 0);
- add_thread(testlocal, 1);
- add_thread(testlocal, 3);
- void* a = malloca(7, 9);
+ //add_thread(testlocal, 0);
+ //add_thread(testlocal, 1);
+ //add_thread(testlocal, 3);
}
struct Mutex testm = {.addr = (void*)0xDEADBEEF, .pid = NULL_PID};