:: commit 483cb4655dfd1d0e65e4bebf2b03b746ba69bfae

mintsuki <mintsuki@protonmail.com> — 2021-08-22 16:29

parents: 712f4c02e6

misc: Add copyright notice at boot

diff --git a/stage23/LICENSE.md b/stage23/LICENSE.md
new file mode 120000
index 00000000..7eabdb1c
--- /dev/null
+++ b/stage23/LICENSE.md
@@ -0,0 +1 @@
+../LICENSE.md
\ No newline at end of file
diff --git a/stage23/Makefile b/stage23/Makefile
index 02c936dc..cd651d4b 100644
--- a/stage23/Makefile
+++ b/stage23/Makefile
@@ -48,6 +48,7 @@ E9_OUTPUT = false
 
 BUILD_ID := $(shell dd if=/dev/urandom count=8 bs=1 2>/dev/null | od -An -t x4 | sed 's/^ /0x/g;s/ //g')
 LIMINE_VERSION := $(shell cat ../version 2>/dev/null || ( git describe --exact-match --tags `git log -n1 --pretty='%h'` 2>/dev/null || ( git log -n1 --pretty='%h' && echo -n "(`git branch --show-current`)" ) ) )
+LIMINE_COPYRIGHT := $(shell grep Copyright LICENSE.md)
 
 WERROR = -Werror
 CFLAGS ?= -O3 -g -pipe -Wall -Wextra $(WERROR)
@@ -71,6 +72,7 @@ INTERNAL_CFLAGS := \
 	-MMD \
 	-DBUILD_ID=$(BUILD_ID) \
 	-DLIMINE_VERSION='"$(LIMINE_VERSION)"' \
+	-DLIMINE_COPYRIGHT='"$(LIMINE_COPYRIGHT)"' \
 	-DCOM_OUTPUT=$(COM_OUTPUT) \
 	-DE9_OUTPUT=$(E9_OUTPUT) \
 	-I. \
diff --git a/stage23/entry.s2.c b/stage23/entry.s2.c
index 3bfa588d..a63a7c8b 100644
--- a/stage23/entry.s2.c
+++ b/stage23/entry.s2.c
@@ -75,7 +75,7 @@ void entry(uint8_t boot_drive, int boot_from) {
 
     term_textmode();
 
-    print("Limine " LIMINE_VERSION "\n\n");
+    copyright_notice();
 
     if (!a20_enable())
         panic("Could not enable A20 line");
diff --git a/stage23/entry.s3.c b/stage23/entry.s3.c
index fdd2985c..c8ef5c39 100644
--- a/stage23/entry.s3.c
+++ b/stage23/entry.s3.c
@@ -58,7 +58,7 @@ void uefi_entry(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) {
     term_vbe(0, 0);
     early_term = true;
 
-    print("Limine " LIMINE_VERSION "\n\n");
+    copyright_notice();
 
     disk_create_index();
 
diff --git a/stage23/lib/blib.h b/stage23/lib/blib.h
index d9ce48ae..bce166c2 100644
--- a/stage23/lib/blib.h
+++ b/stage23/lib/blib.h
@@ -23,6 +23,8 @@ extern bool efi_boot_services_exited;
 bool efi_exit_boot_services(void);
 #endif
 
+void copyright_notice(void);
+
 extern struct volume *boot_volume;
 
 #if bios == 1
diff --git a/stage23/lib/blib.s2.c b/stage23/lib/blib.s2.c
index de3d3762..053d0c17 100644
--- a/stage23/lib/blib.s2.c
+++ b/stage23/lib/blib.s2.c
@@ -1,6 +1,13 @@
 #include <stdint.h>
 #include <stddef.h>
 #include <lib/blib.h>
+#include <lib/print.h>
+
+void copyright_notice(void) {
+    print("Limine " LIMINE_VERSION "\n");
+    print(LIMINE_COPYRIGHT "\n");
+    print("This bootloader is distributed under the terms of the BSD-2-Clause license.\n\n");
+}
 
 uint8_t bcd_to_int(uint8_t val) {
     return (val & 0x0f) + ((val & 0xf0) >> 4) * 10;
diff --git a/stage23/menu.c b/stage23/menu.c
index b66697da..9e5c5efb 100644
--- a/stage23/menu.c
+++ b/stage23/menu.c
@@ -539,6 +539,8 @@ char *menu(char **cmdline) {
         if (menu_resolution != NULL)
             parse_resolution(&req_width, &req_height, &req_bpp, menu_resolution);
 
+        print("menu: Loading...");
+
         term_vbe(req_width, req_height);
     }
 
tab: 248 wrap: offon