-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.c
More file actions
49 lines (40 loc) · 1.21 KB
/
kernel.c
File metadata and controls
49 lines (40 loc) · 1.21 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "os.h"
#include "timer.h"
/*
* Here are some interfaces only called by the
* kernel, and would not exposed to user ect.
*/
extern void uart_init(void);
extern void page_init(void);
extern void page_test(void);
extern void sched_init(void);
extern void schedule(void);
extern void os_main(void);
extern void trap_init(void);
extern void plic_init(void);
extern void timer_init(void);
void start_kernel(void)
{
uart_init();
uart_puts("Hello, RVOS!\n");
printf("----------- page_init() ------------\n");
page_init();
printf("----------- page_test() ------------\n");
page_test();
printf("----------- plic_init() ------------\n");
plic_init();
printf("----------- timer_init() ------------\n");
timer_init();
init_timer();
printf("----------- trap_init() ------------\n");
trap_init();
printf("----------- sched_init() ------------\n");
sched_init();
printf("------------ os_main() --------------\n");
os_main();
printf("------------ tasks created --------------\n");
// printf("------------ schedule() -------------\n");
schedule();
while(1) {}; // schedule to tasks before this, thus would not reach here!
uart_puts("Would not go here!\n");
}