From 6f8c090f2ca7df55b3e43fc1b27228ab0e179555 Mon Sep 17 00:00:00 2001 From: awadyn Date: Mon, 6 Aug 2018 20:33:37 -0500 Subject: [PATCH 1/2] feat(all): add splash screen --- src/Splash.h | 38 ++++++++++++++++++++++++++++++++++++++ src/hosted/Cpu.cc | 3 +++ src/native/Main.cc | 4 ++++ 3 files changed, 45 insertions(+) create mode 100644 src/Splash.h diff --git a/src/Splash.h b/src/Splash.h new file mode 100644 index 00000000..2ec201d6 --- /dev/null +++ b/src/Splash.h @@ -0,0 +1,38 @@ +// Copyright Boston University SESA Group 2013 - 2014. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef COMMON_SRC_INCLUDE_EBBRT_SPLASH_H_ +#define COMMON_SRC_INCLUDE_EBBRT_SPLASH_H_ + +#define COLOR_RESET "\033[0m" +#define RED "\033[31m" /* Red */ +#define GREEN "\033[32m" /* Green */ +#define YELLOW "\033[33m" /* Yellow */ +#define BLUE "\033[34m" /* Blue */ +#define MAGENTA "\033[35m" /* Magenta */ +#define CYAN "\033[36m" /* Cyan */ +#define WHITE "\033[37m" /* White */ + +#define C0 COLOR_RESET +#define C1 CYAN +#define C2 MAGENTA +#define C3 GREEN +#define C4 YELLOW +#define C5 RED +#define C6 BLUE +#define C7 WHITE + +#include "Debug.h" + +void EbbRTSplash(void){ + ebbrt::kprintf_force(C1 " " C2 " " C5 " ___ \n"); + ebbrt::kprintf_force(C1 " ~~~~~ ~ ~" C2 " ~~~~~ ~~~~~~~~" C5 " | _|" C6 " ___ \n"); + ebbrt::kprintf_force(C1 " / / / " C2 " / / / " C5 " |_| " C4 " _" C6 "|" C6 "_ |\n"); + ebbrt::kprintf_force(C1 " ~~~~~ ~~~~ ~~~~" C2 " ~~~~ / " C5 " " C7 "_" C4 "|_ " C4 "|" C6 "_|\n"); + ebbrt::kprintf_force(C1 "/ / / / / " C2 " / \\ / " C5 " " C7 "| " C4 "|_| " C3 "|\n"); + ebbrt::kprintf_force(C1 "~~~~~ ~~~~ ~~~~ " C2 " / \\ / " C5 " " C7 "|___" C3 "|___|\n" C0); +} + +#endif //COMMON_SRC_INCLUDE_EBBRT_SPLASH_H_ + diff --git a/src/hosted/Cpu.cc b/src/hosted/Cpu.cc index 43ac046c..bc460691 100644 --- a/src/hosted/Cpu.cc +++ b/src/hosted/Cpu.cc @@ -20,6 +20,7 @@ #include "../Clock.h" #include "../GlobalIdMap.h" #include "../Runtime.h" +#include "../Splash.h" #include "../StaticIds.h" #include "Context.h" #include "ContextActivation.h" @@ -111,6 +112,8 @@ void* Cpu::run(void* arg) { } pthread_t Cpu::EarlyInit(size_t num) { + EbbRTSplash(); + // lets now get all the cpus create one per physical core int i; pthread_attr_t attr; diff --git a/src/native/Main.cc b/src/native/Main.cc index 4e2f0145..e588257e 100644 --- a/src/native/Main.cc +++ b/src/native/Main.cc @@ -49,6 +49,8 @@ #include "VMemAllocator.h" #include "VirtioNet.h" +#include "../Splash.h" + namespace { bool started_once = false; } @@ -76,6 +78,8 @@ ebbrt::Main(multiboot::Information* mbi) { kprintf_force("EbbRT Copyright 2013-2018 Boston University SESA Developers\n"); + EbbRTSplash(); + idt::Init(); cpuid::Init(); tls::Init(); From 0e6fd5fb692b86571b047ad5ca32d8b8dfa74f20 Mon Sep 17 00:00:00 2001 From: awadyn Date: Mon, 6 Aug 2018 20:43:42 -0500 Subject: [PATCH 2/2] chore(build): update default make target --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e3c9a6ab..9f64b3ab 100644 --- a/Makefile +++ b/Makefile @@ -61,10 +61,10 @@ EBBRT_LIBS ?= $(EBBRT_SRCDIR)/libs EBBRT_BUILD_DEFS ?= -DCMAKE_C_COMPILER_FORCED=1 \ -DCMAKE_CXX_COMPILER_FORCED=1 -build: hosted native - install: hosted-install native-install +build: hosted native + ebbrt-libs: native-libs hosted-libs @@ -78,7 +78,7 @@ hosted: | $(EBBRT_SRC) $(CMAKE_BUILD_TYPE) $(CMAKE_VERBOSE_OPT) $(EBBRT_SRC) $(MAKE) -C $(HOSTED_BUILD_DIR) $(MAKE_OPT) -hosted-install: | $(HOSTED_BUILD_DIR) +hosted-install: hosted | $(HOSTED_BUILD_DIR) $(MAKE) -C $(HOSTED_BUILD_DIR) $(MAKE_OPT) install hosted-libs: hosted-install @@ -97,7 +97,7 @@ native: | $(EBBRT_SRC) $(NATIVE_TOOLCHAIN_FILE) $(CMAKE_BUILD_TYPE) $(CMAKE_VERBOSE_OPT) $(EBBRT_SRC) $(MAKE) -C $(NATIVE_BUILD_DIR) $(MAKE_OPT) -native-install: | $(NATIVE_BUILD_DIR) +native-install: native | $(NATIVE_BUILD_DIR) $(MAKE) -C $(NATIVE_BUILD_DIR) $(MAKE_OPT) install native-libs: native-install