forked from rasendubi/akernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.c
More file actions
40 lines (33 loc) · 699 Bytes
/
kernel.c
File metadata and controls
40 lines (33 loc) · 699 Bytes
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
#include <gic.h>
#include <page_alloc.h>
#include <pipe.h>
#include <print.h>
#include <scheduler.h>
#include <user/syscalls.h>
/* Define hypervisor stack */
unsigned hyp_stack[2048];
/* Initialize all services and execute user level code */
void init_systems(void) {
if (!fork()) {
do {
sys_exec("user/services/pipe_master");
printa("pipe_master error\n");
} while (1);
}
if (!fork())
sys_exec("user/user_first");
while (1);
}
/* Initialize all kernel subsystems and run system */
int main(void) {
printa("In main %x\n", (unsigned)main);
init_int();
init_page_alloc();
init_pipes();
init_scheduler();
add_task(&init_systems);
while (1) {
schedule();
}
return 0;
}