aboutsummaryrefslogtreecommitdiff
path: root/src/kernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel.cpp')
-rw-r--r--src/kernel.cpp59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/kernel.cpp b/src/kernel.cpp
deleted file mode 100644
index 063fe11..0000000
--- a/src/kernel.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-//=====================================================================
-// glitch kernel
-// spdx-license-identifier: ISC
-// description: kernel entry point
-//=====================================================================
-
-extern "C" {
-#include "conf.h"
-#include "mem.h"
-#include <keyboard.h>
-#include <mouse.h>
-#include <pic.h>
-#include <ps2_controller.h>
-#include <stdio.h>
-#include <sys/cpuid.h>
-}
-#include <uart.hpp>
-#include <vga.hpp>
-
-FILE *stdin;
-FILE *stdout;
-FILE *stderr;
-
-extern "C" void
-kmain()
-{
- stderr = uart_init<COM1>();
- vmm_map(0xb8000, 0xc03ff000);
- stdout = vga_init((void *)0xc03ff000);
-
- printf("glitch [version " VERSION "] [" CC "]\n");
- fprintf(stderr, "glitch [version " VERSION "] [" CC "]\n");
- {
- char vendor[13] = {'\0'};
- unsigned int eax;
- __get_cpuid(0, &eax, (unsigned int *)vendor, (unsigned int *)(vendor + 8), (unsigned int *)(vendor + 4));
- struct CPUVersion v;
- __get_cpuid(1, (unsigned int *)&v, &eax, &eax, &eax);
- printf("CPU: %s family %u model %u stepping %u\n", vendor, family(v), model(v), v.stepping);
- fprintf(stderr, "CPU: %s family %u model %u stepping %u\n", vendor, family(v), model(v), v.stepping);
- }
-
- pic_init();
-
- ps2_ctrl_init();
- ps2_keyboard_init();
- mouse_init();
-
- pic_enable();
- fprintf(stderr, "interrupts enabled\n");
-
- /*
- alloc4M();
- char *c = (char *)0xc0700000;
- if (*c == 0) printf("c is 0\r\n");
- */
-
- while (1) {}
-}