summaryrefslogtreecommitdiff
path: root/src/kernel/kernel.c
diff options
context:
space:
mode:
authorBrett Weiland <brett_weiland@bpcspace.com>2021-08-29 02:52:48 -0500
committerBrett Weiland <brett_weiland@bpcspace.com>2021-08-29 02:52:48 -0500
commit1f71b9576db536af84155363e14fc49e92de2eef (patch)
tree23f65a31cc89785befb70517b203625e2296326f /src/kernel/kernel.c
parentdc0e84d5779db68e081c667faadc19a20de861ea (diff)
backup 8.29.21
Diffstat (limited to 'src/kernel/kernel.c')
-rw-r--r--src/kernel/kernel.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c
index d550e37..11df1f1 100644
--- a/src/kernel/kernel.c
+++ b/src/kernel/kernel.c
@@ -1,12 +1,12 @@
#include <stdbool.h>
#include <smp.h>
-#include <serial.h>
+#include <klog.h>
#include <printf.h>
#include <paging.h>
#include <video.h>
#include <acpi.h>
#include <panic.h>
-#include <kernel.h>
+#include <addr.h>
#include <stdbool.h>
#include <int.h>
#include <io.h>
@@ -19,31 +19,36 @@
//testing headers
#include <testmalloc.h>
+void kmain() {
+ PANIC(KERNEL_PANIC_KERNEL_RETURNED);
+}
-void multicore_main() {
- printf("\nKernal started\n");
- asm("cli\nhlt");
+void smp_kinit() {
+ printf("\nKernal started on core\n"); //TODO get lapic working, then print core number
+ kmain();
}
-void main() {
-#ifndef SCREEN_OUTPUT
- if(init_serial(COM1)) printf("\nKernal started on CPU 1!\n");
-#endif
+//TODO move to global constructors
+void kernel_init() {
+ size_t pmap_size;
+
get_mem_capabilities();
- init_pmap(map_complete_physical());
+ pmap_size = map_complete_physical();
+ init_klog();
+ init_pmap(pmap_size);
+ printf("\nKernal started on CPU 1!\n");
find_root_sdp();
debug_acpi();
- init_interrupts();
+ init_interrupts_bsp();
randinit();
smp_boot();
fix_stack();
- unmap_lowmem();
-
- PANIC(KERNEL_PANIC_KERNEL_RETURNED);
+ //unmap_lowmem();
+ kmain();
}