Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(all): add splash screen #244

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -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
Expand All @@ -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
Expand Down
38 changes: 38 additions & 0 deletions src/Splash.h
Original file line number Diff line number Diff line change
@@ -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_

3 changes: 3 additions & 0 deletions src/hosted/Cpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/native/Main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
#include "VMemAllocator.h"
#include "VirtioNet.h"

#include "../Splash.h"

namespace {
bool started_once = false;
}
Expand Down Expand Up @@ -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();
Expand Down