diff options
author | vetch <vetch97@gmail.com> | 2020-01-04 11:26:57 +0100 |
---|---|---|
committer | vetch <vetch97@gmail.com> | 2020-01-04 11:26:57 +0100 |
commit | 885a097da42317f48cead2d91c0e0240066943a8 (patch) | |
tree | 0ee86dbaf5678b32f496b99c48ea81bbd20971f2 /setup.c | |
parent | 2d31012739a11724844701d07db12e6e1307925e (diff) | |
parent | 814d4a5357d849c4988422d48afa4aaa5432ce78 (diff) | |
download | rpi-MMU-example-885a097da42317f48cead2d91c0e0240066943a8.tar.gz rpi-MMU-example-885a097da42317f48cead2d91c0e0240066943a8.zip |
Merge branch 'bob' of https://repo.or.cz/RPi-MMU-example into alice
# Conflicts:
# demo_functionality.h
# interrupt_vector.S
# interrupts.c
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(); } |