This source file includes following definitions.
- main
1 #include "types.h"
2 #include "param.h"
3 #include "memlayout.h"
4 #include "riscv.h"
5 #include "defs.h"
6
7 volatile static int started = 0;
8
9
10 void
11 main()
12 {
13 if(cpuid() == 0){
14 consoleinit();
15 printfinit();
16 printf("\n");
17 printf("xv6 kernel is booting\n");
18 printf("\n");
19 kinit();
20 kvminit();
21 kvminithart();
22 procinit();
23 trapinit();
24 trapinithart();
25 plicinit();
26 plicinithart();
27 binit();
28 iinit();
29 fileinit();
30 virtio_disk_init();
31 userinit();
32 __sync_synchronize();
33 started = 1;
34 } else {
35 while(started == 0)
36 ;
37 __sync_synchronize();
38 printf("hart %d starting\n", cpuid());
39 kvminithart();
40 trapinithart();
41 plicinithart();
42 }
43
44 scheduler();
45 }