KraKern

C++ Kernel
Log | Files | Refs | README | LICENSE | git clone https://git.ne02ptzero.me/git/KraKern

commit 57a0ee22d97f6778b8597c21ea06e8d57ae95903
parent e30114e9b0f515a33600eb25cbff858f767ae656
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Mon, 22 Feb 2016 15:08:36 +0100

Fix(Useless): Better welcome msg

Diffstat:
Mkernel/Io.cpp | 4++--
Mkernel/Kernel.cpp | 17+++++++----------
2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/kernel/Io.cpp b/kernel/Io.cpp @@ -177,13 +177,13 @@ u32 Io::read(char *buf, u32 count) { } void Io::loading(const char *s) { - this->puts(s); + this->printk("%e%s%e", COLOR_LIGHT_GREY, s, COLOR_WHITE); for (int padding = 80 - strlen(s) - 10; padding > 0; padding--, this->puts(" ")); this->_in_loading = 1; } void Io::done(void) { - this->printk("[%e DONE %e]\n", COLOR_GREEN, COLOR_WHITE); + this->printk("%e[%e DONE %e]\n", COLOR_LIGHT_GREY, COLOR_GREEN, COLOR_LIGHT_GREY); this->_in_loading = 0; } diff --git a/kernel/Kernel.cpp b/kernel/Kernel.cpp @@ -13,8 +13,7 @@ void list_files(File *root, int depth) { for (tmp = root->get_child(); tmp; tmp = tmp->get_next()) { for (int i = 0; i < depth; __kern.io.puts(" "), i++); - __kern.io.puts(tmp->get_name()); - __kern.io.puts("\n"); + __kern.io.printk("%s\n", tmp->get_name()); if (tmp->get_child()) list_files(tmp, depth + 1); } @@ -64,15 +63,13 @@ void Kernel::welcome(void) { void Kernel::ready(void) { s_clock *h = (struct s_clock *)__kern.mem.kmalloc(sizeof(struct s_clock)); + char *date, *time; __kern.mods->get("time")->ioctl(ACPI_GET_CLOCK, (u8 *)h); + date = getTextDate(*h); + time = getTextTime(*h); __kern.io.puts("\n"); - __kern.io.set_color(COLOR_LIGHT_GREY); - for (int i = 0; i < 26; i++, this->io.puts("=")); - __kern.io.set_color(COLOR_WHITE); - __kern.io.puts(" Boot done, Host is ready ! "); - __kern.io.set_color(COLOR_LIGHT_GREY); - for (int i = 0; i < 26; i++, this->io.puts("=")); - __kern.io.set_color(COLOR_WHITE); - __kern.io.printk("Date: %s %s\n", getTextDate(*h), getTextTime(*h)); + __kern.io.printk("Hello !"); + for (u32 i = 0; i < (80 - (strlen(date) + strlen(time) + 8)); __kern.io.putc(' '), i++); + __kern.io.printk("%e%s-%s%e", COLOR_LIGHT_GREY, date, time, COLOR_WHITE); }