Espresso 0.0.2c

This commit is contained in:
2026-03-20 16:57:08 -05:00
parent 021fdbbcef
commit 5971218b56
77 changed files with 4538 additions and 518 deletions

View File

@ -16,6 +16,12 @@
#include <kernel/boot.h>
#include <kernel/kshell.h>
#include <kernel/syscall.h>
#include <tty.h>
#include <vga/vga.h>
#include <new_tty.h>
#include <kdebug.h>
@ -23,54 +29,41 @@
#include <drivers/idt.h>
#include <drivers/irq.h>
#include <scheduler.h>
#include <multiboot.h>
#include <drivers/pci.h>
#include <drivers/ps2_keyboard.h>
#include <drivers/keyboard.h>
#include <drivers/pit.h>
/*#include <drivers/ahci.h>*/
#include <drivers/ide.h>
#include <mm/mm.h>
#include <fs/fat32.h>
#include <fs/duckfs.h>
/*#include <fs/duckfs.h>*/
#include <fs/vfs.h>
#include <fs/sfs.h>
#ifdef DEBUG_USE_SSE2
#include <vector_extensions/sse.h>
#endif
#include <kernel/intro.h>
#include <builtin_games/miner.h>
#include <fs/ssfs.h>
#define DEBUG
extern void _hang_asm(void);
extern void _sti_asm(void);
char* espresso_str = ""
"####### ##### ###### ###### ####### ##### ##### #######\n"
"# # # # # # # # # # # # # #\n"
"# # # # # # # # # # #\n"
"##### ##### ###### ###### ##### ##### ##### # #\n"
"# # # # # # # # # #\n"
"# # # # # # # # # # # # #\n"
"####### ##### # # # ####### ##### ##### #######\n";
char* kernel_version = "0.0.2a";
void kernel_main(multiboot_info_t* mbd, uint32_t magic)
{
{
/* --- BEGIN INITIALIZATION SECTION --- */
/* We need to initialize the terminal so that any error/debugging messages show. */
terminal_initialize();
printf("Loading Espresso %s... ", kernel_version);
printf("Loading Espresso %s... ", KERNEL_VERSION);
#ifdef _DEBUG
printf("[ DEBUG BUILD ]");
@ -96,12 +89,8 @@ void kernel_main(multiboot_info_t* mbd, uint32_t magic)
gdt_install(false);
pic_remap();
pic_remap(); /* must be done before idt_init() */
idt_init();
_sti_asm();
irq_init(); /* MUST be done after pic_remap() and idt_init() */
terminal_setcolor(VGA_COLOR_GREEN);
@ -112,44 +101,65 @@ void kernel_main(multiboot_info_t* mbd, uint32_t magic)
heap_init(0xC2000000, 0x80000);
#ifdef DEBUG_USE_SSE2
#ifdef _DEBUG
printd("Testing SSE...\n");
#endif
int32_t sse_test_result = test_sse();
if (sse_test_result != 0)
{
printf("[ DEBUG ] SSE test failed with RV %d\n", sse_test_result);
printf("[ SSE ] SSE test failed with RV %d\n", sse_test_result);
}
else
{
#ifdef _DEBUG
printd("SSE test passed\n");
#endif
}
#endif
pit_init();
int j = init_tty();
if (j != 0)
{
printwc("[ ERROR ] init_tty failed\n", VGA_COLOR_RED);
while (1)
{
asm volatile ("nop" ::: "memory");
}
}
keyboard_init();
//keyboard_init();
init_keyboard();
ide_initialize();
pci_init();
init_sysints();
/*init_scheduler();*/
_sti_asm();
/* --- END INITIALIZATION SECTION --- */
terminal_setcolor(VGA_COLOR_LIGHT_GREEN);
printf("Guten tag and welcome to Espresso %s\n", kernel_version);
printf("Guten tag and welcome to Espresso %s\n", KERNEL_VERSION);
sleep(1000);
intro_begin();
/*extern void terminal_clear(void);
extern void terminal_clear(void);
terminal_clear();
kshell_start(1, NULL);*/
kshell_start();
while (true)
for(;;) /* Loop infinitely. We only do something when an interrupt/syscall happens now. */
{
/* Loop infinitely. We only do something when a syscall happens now. */
asm volatile("hlt" ::: "memory");
}
}