From 8826a7d873635ec575ff053591bfc6860dbe03d6 Mon Sep 17 00:00:00 2001 From: xamidev <121681048+xamidev@users.noreply.github.com> Date: Sat, 7 Sep 2024 20:27:03 +0200 Subject: [PATCH] Minor fixes --- src/initrd/welcome.txt | 37 +++++++++++++++++++++++++++++++++++++ src/kernel/kmain.c | 7 +++---- src/kernel/kmain.h | 2 ++ src/kernel/shell.c | 6 +++++- 4 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 src/initrd/welcome.txt diff --git a/src/initrd/welcome.txt b/src/initrd/welcome.txt new file mode 100644 index 0000000..60365aa --- /dev/null +++ b/src/initrd/welcome.txt @@ -0,0 +1,37 @@ +*********************** +* Welcome to BlankOS! * +*********************** + +Congratulations, you've entered my small world! + +You can try all the commands, try tweaking stuff like explained +in the DEVELOPERS.md file, and even contribute if you got the +guts. lol. + +Don't look too much at the code, it's badly designed, but hey, +that's my first OS project so I find it kinda cool. + +There's no paging, ring 3, processes... I am not smart enough +for all this modern stuff. Let's keep it simple and stay in +ring0, without processes, maybe one day there'll be more +advanced features, but not today. + +** Why am I doing this? + +I wanted to explore the world of low-level programing. +As I had only 1 year of experience in C, it was super challenging +especially at the beginning, and I needed much time to understand +even the most basic things around OSDev. + +I'll backup the project on archival media once it'll be at a good +enough point; I think it's cool to leave a trace of my passage on +Earth. + +** Easter eggs + +To make the exploration a bit funnier, I hid some easter eggs +around. You can try to find them if you have time to lose. + +** Ravtzn + +Jub xabjf? Znlor fbzrguvat'f uvqqra va gurer... diff --git a/src/kernel/kmain.c b/src/kernel/kmain.c index 5c52717..5805abf 100644 --- a/src/kernel/kmain.c +++ b/src/kernel/kmain.c @@ -77,14 +77,14 @@ void kmain(multiboot2_info *mb_info) if (mmap->addr != 0) { - /* - printf("[debug] base addr=0x%x%x, length=0x%x%x, type=%u\n", + + serial_printf(3, "base addr=0x%x%x, length=0x%x%x, type=%u\n", (uint32_t) (mmap->addr >> 32), (uint32_t) (mmap->addr & 0xFFFFFFFF), (uint32_t) (mmap->len >> 32), (uint32_t) (mmap->len & 0xFFFFFFFF), mmap->type); - */ + } mmap = (struct multiboot_mmap_entry*) ((uint8_t*)mmap + mmap_tag->entry_size); @@ -99,7 +99,6 @@ void kmain(multiboot2_info *mb_info) uint32_t initrd_size = initrd_end - initrd_start; printf("[kernel] TAR initrd module found at 0x%x, size=%u bytes\n", initrd_start, initrd_size); - //tar_find_file((uint8_t*)initrd_start, "./hello.txt"); } else { puts("[kernel] TAR initrd module not found\n"); diff --git a/src/kernel/kmain.h b/src/kernel/kmain.h index 9475f4d..e3f2c67 100644 --- a/src/kernel/kmain.h +++ b/src/kernel/kmain.h @@ -6,6 +6,8 @@ #ifndef KMAIN_H #define KMAIN_H +#define BLANK_VERSION "0.3.107-alpha" + #include typedef struct { diff --git a/src/kernel/shell.c b/src/kernel/shell.c index ec4f2f3..e9876f7 100644 --- a/src/kernel/shell.c +++ b/src/kernel/shell.c @@ -10,6 +10,7 @@ #include "../libc/crypto.h" #include #include "../drivers/rtc.h" +#include "kmain.h" #define BUFFER_SIZE 256 #define MAX_COMMANDS 64 @@ -54,7 +55,10 @@ void splash() int random = randint(time_seed()); char* motd_pick = motd[random%motd_size]; cowsay(motd_pick, red, black); - colorputs(" blankOS 0.3.97-alpha", red, black); + puts(" "); + colorputs("blankOS", black, white); + puts(" "); + colorputs(BLANK_VERSION, red, black); puts("\n");