aboutsummaryrefslogtreecommitdiff
path: root/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel.c')
-rw-r--r--kernel.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/kernel.c b/kernel.c
index fc629e1..096cd9a 100644
--- a/kernel.c
+++ b/kernel.c
@@ -1,6 +1,7 @@
#include "uart.h"
#include "demo_functionality.h"
#include "paging.h"
+#include "interrupts.h"
void kernel_main(uint32_t r0, uint32_t r1, uint32_t atags)
{
@@ -21,6 +22,10 @@ void kernel_main(uint32_t r0, uint32_t r1, uint32_t atags)
// prints some info
demo_paging_support();
+
+
+ // prints some info and switches to system mode
+ demo_mode_to_system();
// prints some info
demo_current_mode();
@@ -30,13 +35,30 @@ void kernel_main(uint32_t r0, uint32_t r1, uint32_t atags)
demo_setup_libkernel();
demo_setup_PL0();
+ enable_timer();
+ // enable interrupts
demo_setup_interrupts();
-
- // prints some info and sets up a section for PL0 code, loads a blob
+
+ *(int *)(0x3000B210) = 1;
+ *(int *)(0x3000B204) = 1;
+
+
+ asm("LDR r0, =0x3F00B200\n\r"
+ "MOV r1, #2\n\r"
+ "STR r1, [r0, #0x00]\n\r");
+
+ *(int *)(0x7E00B210) = 1;
+ *(int *)(0x7E00B214) = 1;
+ *(int *)(0x7E00B218) = 1;
+ uart_putc(*(int*)(0x40000034) );
+ *(int *)(0x40000034) = 1;
+
+
+ // prints some info and sets up a section for PL0 code, loads a blob
// there and jumps to it... never, ever, ever returns
demo_go_unprivileged();
-
+
while(1);
while (1)