aboutsummaryrefslogtreecommitdiff
path: root/kernel/init.c
blob: 6ec852381ce881b74ef26115358011ee780a1dcd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "init.h"
#include "mux/debug.h"
#include "mux/sched.h"
#include "mux/idle.h"
#include "mux/clock.h"
#include "mcu/context.h"

#define HZ 100

DECLARE_TASK(task_idle, IDLE_STACK_SIZE, idle_entry);
DECLARE_TASK(tcb1, DEFAULT_STACK_SIZE, task1);
DECLARE_TASK(tcb2, DEFAULT_STACK_SIZE, task2);

int main(int argc, char *argv[]) {
  cli();

  setup();

  spawn_idle(&task_idle, 0);
  spawn(&tcb1, 1);
  //spawn(&tcb2, 2);

  sei();
  clock_init(1000/HZ, schedule);
  clock_start();
  sched_init();
  panic(); //should never reach here
  while(1){}
}