From 712df97dfcff61b213df45495e76a4bab0049f98 Mon Sep 17 00:00:00 2001 From: "Justin C. Miller" Date: Thu, 12 Apr 2018 09:03:53 -0700 Subject: [PATCH] Add a better boot message with version --- Makefile | 4 +++- src/boot/main.c | 6 +++--- src/modules/main/main.cpp | 13 ++++--------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 341461c..8524178 100644 --- a/Makefile +++ b/Makefile @@ -56,14 +56,16 @@ ASFLAGS ?= ASFLAGS += -p $(BUILD_D)/versions.s CFLAGS := $(INCLUDES) $(DEPENDFLAGS) $(BASEFLAGS) $(WARNFLAGS) +CFLAGS += -DGIT_VERSION="\"$(VERSION)\"" CFLAGS += -std=c11 CXXFLAGS := $(INCLUDES) $(DEPENDFLAGS) $(BASEFLAGS) $(WARNFLAGS) +CXXFLAGS += -DGIT_VERSION="\"$(VERSION)\"" CXXFLAGS += -std=c++14 BOOT_CFLAGS := -I src/boot $(CFLAGS) -fPIC -fshort-wchar -BOOT_CFLAGS += -DGIT_VERSION="L\"$(VERSION)\"" BOOT_CFLAGS += -DKERNEL_FILENAME="L\"$(KERNEL_FILENAME)\"" +BOOT_CFLAGS += -DGIT_VERSION_WIDE="L\"$(VERSION)\"" BOOT_CFLAGS += -DGNU_EFI_USE_MS_ABI -DHAVE_USE_MS_ABI BOOT_CFLAGS += -DEFI_DEBUG=0 -DEFI_DEBUG_CLEAR_MEMORY=0 #BOOT_CFLAGS += -DEFI_FUNCTION_WRAPPER diff --git a/src/boot/main.c b/src/boot/main.c index 413ddf1..8d1b43f 100644 --- a/src/boot/main.c +++ b/src/boot/main.c @@ -10,8 +10,8 @@ #include "memory.h" #include "utility.h" -#ifndef GIT_VERSION -#define GIT_VERSION L"no version" +#ifndef GIT_VERSION_WIDE +#define GIT_VERSION_WIDE L"no version" #endif #define KERNEL_HEADER_MAGIC 0x600db007 @@ -40,7 +40,7 @@ efi_main(EFI_HANDLE image_handle, EFI_SYSTEM_TABLE *system_table) // When checking console initialization, use CHECK_EFI_STATUS_OR_RETURN // because we can't be sure if the console was fully set up - status = con_initialize(system_table, GIT_VERSION); + status = con_initialize(system_table, GIT_VERSION_WIDE); CHECK_EFI_STATUS_OR_RETURN(status, "con_initialize"); // From here on out, we can use CHECK_EFI_STATUS_OR_FAIL instead diff --git a/src/modules/main/main.cpp b/src/modules/main/main.cpp index 76b131a..e68e2c0 100644 --- a/src/modules/main/main.cpp +++ b/src/modules/main/main.cpp @@ -32,15 +32,10 @@ kernel_main(popcorn_data *header) { console cons = load_console(header); - const int times = 38; - char message[] = " 000 Hello, I am text rendered by the kernel! :-D\n"; - for (int i = 0; i < times; ++i) { - cons.set_color(i, 0); - message[1] = '0' + ((i / 100) % 10); - message[2] = '0' + ((i / 10) % 10); - message[3] = '0' + (i % 10); - cons.puts(message); - } + cons.set_color(0x21, 0x00); + cons.puts("Popcorn OS "); + cons.set_color(0x08, 0x00); + cons.puts(GIT_VERSION " booting...\n"); do_the_set_registers(header); }