aboutsummaryrefslogtreecommitdiff
path: root/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'setup.c')
-rw-r--r--setup.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/setup.c b/setup.c
index ad01720..f1d1263 100644
--- a/setup.c
+++ b/setup.c
@@ -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();
}