Files
SoraOS/kernel.c
T

45 lines
988 B
C

// File: kernel.c
// SoraOS Kernel - Main entry point
// INFO:
// 0xA0000 for EGA/VGA graphics modes (64 KB)
// 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 {
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();
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__);
while (1) {
// TODO: CLI IDEA
printf("%s@%s:$ ", current_user.user_name, current_user.user_hostname);
// TODO: Enable user input handling
char input_buffer[256] = {0};
scanf("%s", input_buffer);
printf("echo: %s\n", input_buffer);
}
// Infinite loop
while (1) {
__asm__ volatile("hlt");
}
}