Add a better boot message with version

This commit is contained in:
Justin C. Miller
2018-04-12 09:03:53 -07:00
parent 656d5dfedf
commit 712df97dfc
3 changed files with 10 additions and 13 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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);
}