Feat: Initital beggining of a CLI

This commit is contained in:
AfonsoCMSousa
2025-11-25 21:03:44 +00:00
parent b619b9ed1d
commit 403face1e6
3 changed files with 41 additions and 14 deletions
+22 -10
View File
@@ -6,26 +6,38 @@
// 0xB0000 for monochrome text mode (32 KB)
// 0xB8000 for color text mode and CGA-compatible graphics modes (32 KB)
#include "kernel.h"
#include "stdio.h"
typedef struct user {
int id;
const char *name;
typedef struct {
char user_name[32];
char user_hostname[32];
unsigned int user_id;
} user;
void kmain(void) {
user current_user = {
.user_name = "admin",
.user_hostname = "soraos",
.user_id = 0
};
__clear_screen();
user current_user;
current_user.id = 1;
current_user.name = "admin";
printf("SoraOS Kernel Initialized!\n");
printf("\tWelcome to SoraOS!\n");
printf("\tKernel Version: %s\n", __KERNEL_VERSION);
printf("\tCompiled on: %s at %s\n\n", __DATE__, __TIME__);
printf("\tUser name:\t%s\n", current_user.name);
printf("\tUser id:\t%d\n", current_user.id);
vga_set_cursor(0, 0);
// TODO: CLI IDEA
int _count = printf("%s@%s:>", current_user.user_name, current_user.user_hostname);
scursor(_count, text_pos.line);
// TODO: Enable user input handling
// Infinite loop
while (1) {