Added new startup logger, tab support and new iso image

This commit is contained in:
Marco Cetica
2020-08-24 01:12:39 +02:00
parent 50dc3ab1c7
commit 0728dc0dbc
7 changed files with 38 additions and 27 deletions

View File

@@ -18,43 +18,45 @@
#include <stdint.h>
#define PRTOK printf("\n["); printf_color(" OK ", LIGHT_GREEN, BLACK); printf("]"); // Ugly hack to print "[ OK ]"
#define PRTAT printf("\n["); printf_color(" ** ", LIGHT_BROWN, BLACK); printf("]"); // Ugly hack to print "[ * ]"
void kernel_main() {
printf_color("\n[STATUS]", LIGHT_GREEN, BLACK);
printf_color(" - Loading kernel, wait please...", WHITE, BLACK);
printf("Loading kernel, wait please...");
gdt_setup(); // Setup Global Descriptor Table
printf_color("\n[INFO]", LIGHT_CYAN, BLACK);
printf_color(" - Loaded GDT", WHITE, BLACK);
PRTOK
printf(" - Loaded GDT");
idt_setup(); // Setup Interrupt Descriptor Table
printf_color("\n[INFO]", LIGHT_CYAN, BLACK);
printf_color(" - Loaded IDT", WHITE, BLACK);
PRTOK
printf(" - Loaded IDT");
init_timer(1); // Initialize PIT driver
printf_color("\n[INFO]", LIGHT_CYAN, BLACK);
printf_color(" - Loaded PIT", WHITE, BLACK);
PRTOK
printf(" - Loaded PIT");
init_keyboard(); // Initialize keyboard driver
printf_color("\n[INFO]", LIGHT_CYAN, BLACK);
printf_color(" - Loaded PS/2 driver", WHITE, BLACK);
PRTOK
printf(" - Loaded PS/2 driver");
init_paging(); // Initialize paging
printf_color("\n[INFO]", LIGHT_CYAN, BLACK);
printf_color(" - Loaded Paging", WHITE, BLACK);
PRTOK
printf(" - Loaded Paging");
printf_color("\n[TEST]", LIGHT_BROWN, BLACK); // Testing heap
printf_color(" - Testing heap..\n", LIGHT_BROWN, BLACK);
PRTAT
printf(" - Testing heap...\t");
uint32_t x = kmalloc(32), y = kmalloc(32);
printf("x: %x, y: %x", x, y);
kfree((void*)y);
uint32_t z = kmalloc(8);
printf(", z: %x\n", z); // If z is equal to y, heap's anti-fragmentation algorithm works
printf(", z: %x", z); // If z is equal to y, heap's anti-fragmentation algorithm works
ASSERT(z == y);
kfree((void*)z), kfree((void*)x);
printf_color("[STATUS]", LIGHT_GREEN, BLACK);
printf_color(" - Heap works!", WHITE, BLACK);
PRTOK
printf(" - Heap works!");
iceos_ascii_logo();
init_prompt(); // Initialize frame buffer