summaryrefslogtreecommitdiff
path: root/src/kernel/kernel.c
blob: 025dcf33bbdf7cafb53b0ae38eebbd7d037caace (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
50
#include <stdbool.h>
#include <serial.h>
#include <printf.h>
#include <paging.h>
#include <video.h>
#include <acpi.h>
#include <panic.h>


void test4() {
  char bruh[10];
  panic(KERNEL_PANIC_KERNEL_RETURNED, KERNEL_PANIC_INVOKED);
}
void test3() {
  char bruh[5];
  test4();
}
void test2() {
  int a = 1;
  test3();
}
void test1() {
  printf("fuck\n");
  test2();
}


void main() {
  test1();
  if(!(init_serial(COM1))) {
    printf("\nKernal started on CPU 1!\n"); // will detect cpu later
  }
  
  rsdp_t *rsdp;
  rsdp = find_RSDP();
  if(!(rsdp)) {
    printf("Couldn't find the RSDP... not sure what to do now.\n");
    panic(KERNEL_PANIC_RSDP_UNFOUND, KERNEL_PANIC_INVOKED);
  }


  dump_video();
  debug_print_memory();

  init_pmap();
  debug_pmap();

  panic(KERNEL_PANIC_KERNEL_RETURNED, KERNEL_PANIC_INVOKED);

}