Update main kernel file and Utils for the new functions.

Can't use term_x any more.
This commit is contained in:
Curle 2019-07-23 23:01:12 +01:00
parent 15293681ea
commit 80154dbb51
2 changed files with 4 additions and 62 deletions

View File

@ -20,69 +20,17 @@
void gdb_end() {} /* GDB Debugging stump */ void gdb_end() {} /* GDB Debugging stump */
int kernel_main(void) { int kernel_main(FILELOADER_PARAMS* FLOP) {
/* The kernel is started in 64-bit Long Mode by Syncboot. */ /* The kernel is started in 64-bit Long Mode by Syncboot. */
/* Here, we start by drawing a splash, then loading a GDT and IDT into the placeholder UEFI gives us. */ /* Here, we start by drawing a splash, then loading a GDT and IDT into the placeholder UEFI gives us. */
/* Not sure how well serial would work in UEFI. */ /* Not sure how well serial would work in UEFI. */
// TODO: look at this. // TODO: look at this.
PrepareSystem(FLOP);
//init_serial();
//serial_print(0x3F8, "[INFO] Serial ready.\r\n");
//serial_print(0x3F8, "[INFO] Beginning GDT subroutine.\r\n");
/* term_writes: writes a string to the terminal. */
//term_writes("GDT...");
/* Prepares the Global Descriptor Table, called from gdt.c */
gdt_install();
/* puts: writes a line to the terminal. */
//puts("GDT Ready.");
//serial_print(0x3F8, "[INFO] GDT subroutine complete.\r\n");
/* Prepare the Interrupt Descriptor Table. */
//serial_print(0x3F8, "[INFO] Beginning IDT subroutine.\r\n");
//term_writes("IDT...");
idt_install();
//puts("IDT Ready.");
//serial_print(0x3F8, "[INFO] IDT subroutine complete.\r\n[INFO] Enabling interrupts.\r\n");
gdb_end(); /* The first important step. Waypoint it for gdb debugging. */ gdb_end(); /* The first important step. Waypoint it for gdb debugging. */
//term_writes("Memory available:");
/* The first important thing: start the system clock immediately. */
//serial_print(0x3F8, "[INFO] Starting System Clock.\r\n");
//term_writes("Timer...");
timer_install();
//puts("Timer Ready.");
//serial_print(0x3F8, "[INFO] All subsystems ready. Printing message.\r\n");
/* Everything is ready; print a pretty message. */
//term_setcolor(RED);
//term_writes("\n(c)");
//term_setcolor(GREEN);
//term_writes(" Sync");
//term_setcolor(WHITE);
//term_writes(", 2019\n");
//serial_print(0x3F8, "[INFO] All operations complete. Checking for other tasks...\r\n");
/* Here are a series of tests for the ANSI escape code and CSI implementations. */
//term_writes("\x1b[BA"); /* Down a line, then A. */
/* A stub causing a Divide by Zero error. */
//serial_print(0x3F8, "[DEBUG] Attempting a Divide by Zero error.\r\n");
//char div = (5 / 0);
//serial_print(0x3F8, "[DEBUG] Survived the error!\r\n");
gdb_end(); /* Everything is done. The last debug routine. */
return 0; return 0;
} }

View File

@ -11,12 +11,7 @@
* permanent solution can be found. * permanent solution can be found.
*/ */
#include <kernel/utils.h> #include <kernel.h>
#include <kernel/tty.h>
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
/* /*
Returns the length of a given string. Returns the length of a given string.
@ -192,8 +187,7 @@ void empty_string(char* string) {
* @param cause: A string, telling the basic reason for the crash. * @param cause: A string, telling the basic reason for the crash.
*/ */
void panic(char* cause) { void panic(char* cause) {
term_writes("\n\n>>>> PANIC <<<<\nCaused by: "); printf("Kernel Halted.");
term_writes(cause);
for(;;); for(;;);