DOC: small user manual

This commit is contained in:
boreddevnl
2026-04-14 10:59:52 +02:00
parent fd7fa4f16e
commit bb187faf79
13 changed files with 214 additions and 21 deletions

View File

@@ -15,7 +15,7 @@ static uint32_t text_color = 0xFFFFFFFF; // White
void kconsole_init(void) {
cursor_x = 10;
cursor_y = 10;
kconsole_active = true;
kconsole_active = false;
// Initial clear screen during boot
graphics_clear_back_buffer(0x00000000);

View File

@@ -155,3 +155,17 @@ void k_beep_process(void) {
}
}
char *k_strstr(const char *haystack, const char *needle) {
if (!*needle) return (char *)haystack;
for (; *haystack; haystack++) {
const char *h = haystack;
const char *n = needle;
while (*h && *n && *h == *n) {
h++;
n++;
}
if (!*n) return (char *)haystack;
}
return NULL;
}

View File

@@ -26,5 +26,6 @@ void k_reboot(void);
void k_shutdown(void);
void k_beep(int freq, int ms);
void k_beep_process(void);
char *k_strstr(const char *haystack, const char *needle);
#endif

View File

@@ -70,6 +70,7 @@ static volatile struct limine_bootloader_info_request bootloader_info_request =
.revision = 0
};
__attribute__((used, section(".requests")))
static volatile struct limine_kernel_file_request kernel_file_request = {
.id = LIMINE_KERNEL_FILE_REQUEST,
.revision = 0
@@ -229,6 +230,15 @@ void kmain(void) {
struct limine_framebuffer *fb = framebuffer_request.response->framebuffers[0];
graphics_init(fb);
kconsole_init();
// Check for verbose boot flag
if (kernel_file_request.response != NULL && kernel_file_request.response->kernel_file != NULL) {
const char *cmdline = kernel_file_request.response->kernel_file->cmdline;
if (cmdline != NULL && k_strstr(cmdline, "-v") != NULL) {
kconsole_set_active(true);
}
}
log_ok("Graphics and Console ready");
if (memmap_request.response != NULL) {