summaryrefslogtreecommitdiff
path: root/src/kernel/kernel.c
blob: d550e37baf6adee380685cf156777509a3cb1875 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <stdbool.h>
#include <smp.h>
#include <serial.h>
#include <printf.h>
#include <paging.h>
#include <video.h>
#include <acpi.h>
#include <panic.h>
#include <kernel.h>
#include <stdbool.h>
#include <int.h>
#include <io.h>
#include <cpuid.h>
#include <heap.h>
#include <random.h>
#include <timer.h>
#include <libc.h>

//testing headers
#include <testmalloc.h>


void multicore_main() {
  printf("\nKernal started\n");
  asm("cli\nhlt");
}

void main() {
#ifndef SCREEN_OUTPUT
  if(init_serial(COM1)) printf("\nKernal started on CPU 1!\n");
#endif
  get_mem_capabilities(); 
  init_pmap(map_complete_physical()); 
 
  
  find_root_sdp();
  debug_acpi();
  
  init_interrupts();

  
  randinit();

  smp_boot();
  fix_stack();
  unmap_lowmem();

  PANIC(KERNEL_PANIC_KERNEL_RETURNED);
}