Espresso 0.0.2a

This commit is contained in:
2025-10-20 21:57:30 -05:00
parent 102d517097
commit ff6cba1164
59 changed files with 29272 additions and 773 deletions

View File

@ -11,8 +11,13 @@
#include <types.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <kernel/boot.h>
#include <kernel/kshell.h>
#include <kdebug.h>
#include <gdt.h>
#include <drivers/idt.h>
@ -20,7 +25,6 @@
#include <multiboot.h>
#include <stdio.h>
#include <drivers/pci.h>
#include <drivers/ps2_keyboard.h>
#include <drivers/pit.h>
@ -38,6 +42,8 @@
#include <builtin_games/miner.h>
#include <fs/ssfs.h>
#define DEBUG
@ -53,18 +59,24 @@ char* espresso_str = ""
"# # # # # # # # # # # # #\n"
"####### ##### # # # ####### ##### ##### #######\n";
char* kernel_version = "0.0.2a";
void kernel_main(multiboot_info_t* mbd, uint32_t magic)
{
/* --- BEGIN INITIALIZATION SECTION --- */
const char* espresso_kernel_version = "0.0.1e";
/* We need to initialize the terminal so that any error/debugging messages show. */
terminal_initialize();
printf("Loading Espresso %s...\n", espresso_kernel_version);
printf("Loading Espresso %s... ", kernel_version);
#ifdef _DEBUG
printf("[ DEBUG BUILD ]");
#endif
printf("\n");
terminal_setcolor(VGA_COLOR_RED);
@ -85,24 +97,20 @@ void kernel_main(multiboot_info_t* mbd, uint32_t magic)
gdt_install(false);
pic_remap();
idt_init();
_sti_asm();
irq_init(); /* MUST be done after pic_remap() and idt_init() */
terminal_setcolor(VGA_COLOR_GREEN);
printd("Initializing physical memory manager...\n");
pmm_init(mbd);
printd("Physical memory manager initialized\n");
printd("Initializing paging...\n");
paging_init();
printd("Paging initialized\n");
printd("Initializing heap allocator...\n");
heap_init();
printd("Heap allocator initialized\n");
heap_init(0xC2000000, 0x80000);
printd("Testing SSE...\n");
int32_t sse_test_result = test_sse();
@ -115,31 +123,13 @@ void kernel_main(multiboot_info_t* mbd, uint32_t magic)
printd("SSE test passed\n");
}
printd("Initializing the PIT...\n");
pit_init();
printd("PIT initialized\n");
printd("Initializing the PS/2 keyboard...\n");
keyboard_init();
printd("PS/2 Keyboard initialized\n");
/*
printd("Initalizing AHCI...\n");
ahci_init();
printd("AHCI initialized\n");
*/
printd("Initializing IDE system...\n");
ide_initialize();
printd("IDE initialized\n");
/*printd("Initializing DuckFS...\n");
duckfs_init();
printd("DuckFS initialized\n");*/
printd("Initializing PCI...\n");
pci_enumerate();
printd("PCI initialized\n");
pci_init();
/* --- END INITIALIZATION SECTION --- */
@ -148,22 +138,19 @@ void kernel_main(multiboot_info_t* mbd, uint32_t magic)
/*pit_sleep(4000);
begin_anim(espresso_kernel_version);*/
begin_anim(kernel_version);*/
printf("Guten tag and welcome to Espresso %s\n", espresso_kernel_version);
printf("%s\n", espresso_str);
char buffer[512] = { 0 };
printf("Guten tag and welcome to Espresso %s\n", kernel_version);
int32_t i = sfs_read_file("test.txt", buffer, -1);
sleep(1000);
printf("%i\n", i);
intro_begin();
/*extern void terminal_clear(void);
if (i == 0)
{
printf("%s\n", buffer);
}
terminal_clear();
kshell_start(1, NULL);*/
while (true)
{