diff options
author | Wojtek Kosior <kwojtus@protonmail.com> | 2020-01-03 04:53:01 +0100 |
---|---|---|
committer | Wojtek Kosior <kwojtus@protonmail.com> | 2020-01-03 04:53:01 +0100 |
commit | ffb2c4adfb8e65e355b39abd39d994eebc649c98 (patch) | |
tree | 760ef43f89b480ecd0be4bfd9312eb0d8c744d05 /setup.c | |
parent | 6bf5a3b8c6e8a5d1cb3fb4880a5d9688ab094c62 (diff) | |
download | rpi-MMU-example-ffb2c4adfb8e65e355b39abd39d994eebc649c98.tar.gz rpi-MMU-example-ffb2c4adfb8e65e355b39abd39d994eebc649c98.zip |
add (not yet fully working - it can only send through uart now) interrupt-driven uart together with "scheduler"
Diffstat (limited to 'setup.c')
-rw-r--r-- | setup.c | 30 |
1 files changed, 12 insertions, 18 deletions
@@ -6,12 +6,13 @@ // for POWER_OF_2() macro... perhaps the macro should be moved #include "memory.h" #include "armclock.h" +#include "scheduler.h" void setup(uint32_t r0, uint32_t machine_type, struct atag_header *atags) { uart_init(); - + // When we attach screen session after loading kernel with socat // we miss kernel's greeting... So we'll make the kernel wait for // one char we're going to send from within screen @@ -94,26 +95,19 @@ void setup(uint32_t r0, uint32_t machine_type, // prints some info and sets upp translation table, turns on MMU setup_flat_map(); - // prints some info and sets up a section for PL0 code, - // loads a blob there - demo_setup_PL0(); - + puts("Initializing clock"); // sets some general settings for arm timer armclk_init(); - // turns on irq from arm timer - armclk_enable_timer_irq(); - - // jumps to unprivileged code... never, ever, ever returns - demo_go_unprivileged(); - - while (1) - { - char c = getchar(); + puts("Setting up scheduler's internal structures"); + setup_scheduler_structures(); - if (c == '\r') - putchar('\n'); + puts("Switching uart to use irqs"); - putchar(c); - } + // note, that kernel's puts() is still going to use blocking io + uart_irq_enable(); + + // prints some info and sets up a section for PL0 code, loads a blob + // there, then runs scheduler... never, ever, ever returns + demo_setup_PL0(); } |