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

@ -1,19 +1,30 @@
#include <string.h>
#include <tty.h>
#include <stdio.h>
#include <port_io.h>
#include <stdlib.h>
#include <drivers/ps2_keyboard.h>
#include <kernel/intro.h>
void delay_us(uint32_t microseconds, uint32_t cpu_mhz)
{
uint32_t count = cpu_mhz * microseconds;
while (count--)
{
asm volatile ("nop" ::: "memory");
}
}
void ack_char(char c);
void start_kernel_shell(void);
char char_entered = 0x00;
void intro_begin(void)
{
extern char* kernel_version;
char* fin = (char*) malloc(strlen(kernel_version) + 6);
memset(fin, 0, (strlen(kernel_version) + 5));
strcpy(fin, kernel_version);
#ifdef _DEBUG
strcat(fin, " DEBUG");
#endif
begin_anim(fin);
}
int16_t begin_anim(const char* version)
{
@ -31,11 +42,18 @@ int16_t begin_anim(const char* version)
int16_t b = 0;
int32_t sh_pos = VGA_WIDTH / 2;
int32_t sv_pos = VGA_HEIGHT / 2;
setup_hook((ps2_hook_t) ack_char);
while (true)
{
terminal_clear();
if (char_entered != 0)
{
break;
}
for (int32_t i = 0; n[i]; ++i)
{
terminal_putentryat(n[i], terminal_getcolor(), sh_pos, sv_pos);
@ -64,11 +82,35 @@ int16_t begin_anim(const char* version)
b = 0;
delay_us(50000, 5000);
sleep(1000);
}
if (char_entered != 0)
{
start_kernel_shell();
}
else
{
terminal_clear();
}
terminal_clear();
return 0;
}
void ack_char(char c)
{
char_entered = c;
return;
}
void start_kernel_shell(void)
{
/* terminal_clear() already called by begin_anim() */
extern int kshell_start(int argc, char** argv);
kshell_start(0, NULL);
return;
}