From 3f3a0264328fa1b9233625bb62d9df7833747579 Mon Sep 17 00:00:00 2001 From: Karina Date: Thu, 29 Jan 2026 05:29:39 +0400 Subject: [PATCH] build: officially naming the kernel "Dewar" and updating kfetch --- kernel/CMakeLists.txt | 4 ++-- kernel/inc/shell/builtins.h | 1 + kernel/src/shell/builtins.c | 15 +++++++++++---- kernel/src/shell/ksh.c | 4 ++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/kernel/CMakeLists.txt b/kernel/CMakeLists.txt index 9100969..48c777e 100644 --- a/kernel/CMakeLists.txt +++ b/kernel/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.20) -project(termOS_krn LANGUAGES C ASM_NASM) +project(dewar LANGUAGES C ASM_NASM) set(CMAKE_C_STANDARD 23) set(CMAKE_C_STANDARD_REQUIRED ON) @@ -9,7 +9,7 @@ if (NOT DEFINED ARCH) set(ARCH "x86_64") endif() -message(STATUS "TermOS Kernel: Building for architecture '${ARCH}'") +message(STATUS "Dewar kernel: Building for architecture '${ARCH}'") file(GLOB_RECURSE KERNEL_SOURCES CMAKE_CONFIGURE_DEPENDS diff --git a/kernel/inc/shell/builtins.h b/kernel/inc/shell/builtins.h index 14402cb..4de38a8 100644 --- a/kernel/inc/shell/builtins.h +++ b/kernel/inc/shell/builtins.h @@ -11,3 +11,4 @@ void print_regs(); void cmd_sleep(); void cmd_debug(); void cmd_rand(); +void cmd_ver(); \ No newline at end of file diff --git a/kernel/src/shell/builtins.c b/kernel/src/shell/builtins.c index aea4945..d8caaec 100644 --- a/kernel/src/shell/builtins.c +++ b/kernel/src/shell/builtins.c @@ -29,13 +29,13 @@ void cmd_kfetch() { kprintf("\n\n"); kprintf("^p %s ^!\t\t^g kernel^!@^gtermos\n^0", ascii_logo[0]); - kprintf("^p %s ^!\t\t^!-------------\n^!", ascii_logo[1]); + kprintf("^p %s ^!\t\t^!-------------\n^!", ascii_logo[1]); kprintf("^p %s ^!\t\t^gOS^!: termOS %s\n^!", ascii_logo[2], TERMOS_VERSION); - kprintf("^p %s ^!\t\t^gKernel^!: sucks\n^!", ascii_logo[3]); + kprintf("^p %s ^!\t\t^gKernel^!: Dewar (x86_64), build: %s %s\n^!", ascii_logo[3], __DATE__, __TIME__); kprintf("^p %s ^!\t\t^gUptime^!: %d seconds\n^!", ascii_logo[4], uptime_s); kprintf("^p %s ^!\t\t^gShell^!: ksh\n^!", ascii_logo[5]); - kprintf("^p %s ^p\t\t^gDE^!: shitgui\n^!", ascii_logo[6]); - kprintf("^p %s ^p\t\t^gCPU^!: %s\n^!", ascii_logo[7], g_cpu.vendor); + kprintf("^p %s ^!\t\t^gDE^!: shitgui\n^!", ascii_logo[6]); + kprintf("^p %s ^!\t\t^gCPU^!: %s\n^!", ascii_logo[7], g_cpu.vendor); kprintf("\n\n"); } @@ -71,6 +71,7 @@ void cmd_help() { kprintf("\t\t^yclear^! \t\tClear console\n"); kprintf("\t\t^yhelp^! \t\tShow this menu\n"); kprintf("\t\t^yrand^! \t\tGet a random number\n"); + kprintf("\t\t^yver^! \t\tDisplays termOS's version\n"); } void cmd_regs() { @@ -106,3 +107,9 @@ void cmd_debug() { kprintf("\nDebug ended with code %d\n", status); return; } + +void cmd_ver() { + kprintf("termOS version %s\n", TERMOS_VERSION); + kprintf("Dewar Kernel (x86_64), build: %s %s\n", __DATE__, __TIME__); + kprintf("License: GPL-3.0-or-later\n"); +} \ No newline at end of file diff --git a/kernel/src/shell/ksh.c b/kernel/src/shell/ksh.c index a1764f6..a42a8d3 100644 --- a/kernel/src/shell/ksh.c +++ b/kernel/src/shell/ksh.c @@ -37,6 +37,7 @@ typedef enum { TOKEN_CLEAR, TOKEN_BLINKING, TOKEN_RAND, + TOKEN_VER, TOKEN_BACK, TOKEN_FORWARD, @@ -70,6 +71,8 @@ static const ksh_command_map token_map[] = { {"help", TOKEN_HELP}, {"clear", TOKEN_CLEAR}, {"rand", TOKEN_RAND}, + {"ver", TOKEN_VER}, + {nullptr, TOKEN_NULL} }; @@ -92,6 +95,7 @@ void ksh() { case TOKEN_CLEAR: console_clear((u32) console_get_colors() & 0xFFFFFFFF); break; case TOKEN_BLINKING: console_toggle_cursor_blink(); break; case TOKEN_RAND: cmd_rand(); break; + case TOKEN_VER: cmd_ver(); break; case TOKEN_SLEEP: cmd_sleep(); break; case TOKEN_DEBUG: cmd_debug(); break;