summaryrefslogtreecommitdiff
path: root/main.c
blob: db9a6b969c8fcdfa8483b09c0f535ffe563c79d3 (plain)
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
#include "types.h"
#include "param.h"
#include "memlayout.h"
#include "riscv.h"
#include "defs.h"

// Bootstrap processor starts running C code here.
// Allocate a real stack and switch to it, first
// doing some setup required for memory allocator to work.
void
main()
{
  uartinit();      // serial port
  consoleinit();
  printf("entering main()\n");
  kinit();         // physical page allocator
  kvminit();       // kernel page table
  procinit();      // process table
  trapinit();      // trap vectors
  plicinit();      // set up interrupt controller
  binit();         // buffer cache
  fileinit();      // file table
  ramdiskinit();   // disk
  userinit();      // first user process

  scheduler();        
}