From 1ca1a068a1c7140febf376cc9dfb9c5d8a42e4ee Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sat, 30 Apr 2016 17:39:40 +0200 Subject: [PATCH] Make the branding system more neutral. --- kernel/hostname.cpp | 1 + kernel/kernel.cpp | 2 +- kernel/panic.cpp | 4 ++-- libc/dlfcn/dlfcn.c | 4 ++-- libc/include/brand.h | 36 +++++++++++++++--------------------- login/graphical.c | 2 +- 6 files changed, 22 insertions(+), 27 deletions(-) diff --git a/kernel/hostname.cpp b/kernel/hostname.cpp index 62e05f92..04f8fd2e 100644 --- a/kernel/hostname.cpp +++ b/kernel/hostname.cpp @@ -17,6 +17,7 @@ * System calls for managing the hostname of the current system. */ +#include #include #include diff --git a/kernel/kernel.cpp b/kernel/kernel.cpp index 79d7012d..e20135b6 100644 --- a/kernel/kernel.cpp +++ b/kernel/kernel.cpp @@ -172,7 +172,7 @@ extern "C" void KernelInit(unsigned long magic, multiboot_info_t* bootinfo_p) // Display the logo. Log::PrintF("\e[37;41m\e[2J"); - Log::Center(BRAND_MAXSI); + Log::Center(BRAND_LOGO); #if defined(__x86_64__) // TODO: Remove this hack when qemu 1.4.x and 1.5.0 are obsolete. diff --git a/kernel/panic.cpp b/kernel/panic.cpp index e6d9a222..dc98a3dd 100644 --- a/kernel/panic.cpp +++ b/kernel/panic.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013 Jonas 'Sortie' Termansen. + * Copyright (c) 2011, 2014, 2013, 2014, 2015, 2016 Jonas 'Sortie' Termansen. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -110,7 +110,7 @@ void PanicInit() if ( longpanic ) { Log::Print("\e[m\e[31;40m\e[2J\e[H"); - Log::Center(BRAND_MAXSI_DEAD); + Log::Center(BRAND_LOGO_PANIC); Log::Center("KERNEL PANIC"); Log::Print("\n\nThe operating system encountered an unrecoverable " "error.\n\nTechincal information:\n"); diff --git a/libc/dlfcn/dlfcn.c b/libc/dlfcn/dlfcn.c index 5a1d3bea..cbf727e0 100644 --- a/libc/dlfcn/dlfcn.c +++ b/libc/dlfcn/dlfcn.c @@ -26,7 +26,7 @@ void* dlopen(const char* filename, int mode) { (void) filename; (void) mode; - dlerrormsg = "Sortix does not yet support dynamic linking"; + dlerrormsg = "Dynamic linking is not implemented"; return NULL; } @@ -34,7 +34,7 @@ void* dlsym(void* handle, const char* name) { (void) handle; (void) name; - dlerrormsg = "Sortix does not yet support dynamic linking"; + dlerrormsg = "Dynamic linking is not implemented"; return NULL; } diff --git a/libc/include/brand.h b/libc/include/brand.h index bb4eacf4..8ffc76ae 100644 --- a/libc/include/brand.h +++ b/libc/include/brand.h @@ -20,6 +20,14 @@ #ifndef INCLUDE_BRAND_H #define INCLUDE_BRAND_H +/* + * The name 'Sortix' and the Sortix Logo are reserved for use by the official + * Sortix project. If you publish modified versions of this operating system, + * first edit this file to make no use of the 'Sortix' name and the Sortix logo + * in its definitions, then rebuild the whole operating system and ports to + * change the branding. + */ + /* The name of the distribution of the operation system. */ #define BRAND_DISTRIBUTION_NAME "Sortix" @@ -32,11 +40,14 @@ /* The name of the kernel. */ #define BRAND_KERNEL_NAME "Sortix" +/* The default hostname. */ +#define BRAND_DEFAULT_HOSTNAME "sortix" + /* The tagline of this release. */ #define BRAND_RELEASE_TAGLINE "\"I'd like to add you to my professional Sortix network\"" -/* Ascii version of the maxsi logo. */ -#define BRAND_MAXSI \ +/* The operating system logo as ascii art. */ +#define BRAND_LOGO \ " _ \n" \ " / \\ \n" \ " /\\ /\\ / \\\n" \ @@ -53,8 +64,8 @@ " /_____________\\ /____________\\ \n" \ " \n" \ -/* Dead version of the maxsi logo, used for panic screens and such. */ -#define BRAND_MAXSI_DEAD \ +/* The operating system logo for panic screens. */ +#define BRAND_LOGO_PANIC \ " _ \n" \ " / \\ \n" \ " /\\ /\\ / \\\n" \ @@ -71,21 +82,4 @@ " /_____________\\ /____________\\ \n" \ " \n" \ -/* Message printed when a critical error occurs and the system panics. */ -#define BRAND_PANIC_LONG \ -"\e[m\e[31;40m\e[2J\e[H" \ -BRAND_MAXSI_DEAD \ -" \n" \ -" RED MAXSI OF DEATH \n" \ -" \n" \ -"A critical error occured within the kernel of the operating system and it has\n" \ -"forcefully shut down as a last resort.\n" \ -"\n" \ -"Technical information:\n" \ - -/* Short version of the panic version that consumes minimal space. */ -#define BRAND_PANIC_SHORT \ -"\e[m\e[31m\e[0J" \ -"RED MAXSI OF DEATH\n" \ - #endif diff --git a/login/graphical.c b/login/graphical.c index aca5f96d..b4e5670e 100644 --- a/login/graphical.c +++ b/login/graphical.c @@ -222,7 +222,7 @@ static char* brand_line() kernelinfo("version", version, sizeof(version)); char* result = NULL; asprintf(&result, "%s %s - %s", - BRAND_OPERATING_SYSTEM_NAME, + BRAND_DISTRIBUTION_NAME, version, BRAND_DISTRIBUTION_WEBSITE); return result;