From 2cba0207a444fefcb886173e7a252e11a1871c2f Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Fri, 3 Dec 2021 11:12:28 -0700 Subject: Added Makefile Versioning --- Unix.mk | 2 ++ Win.mk | 2 ++ src/kernel.S | 6 +----- src/lib.c | 14 ++++++++++++++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Unix.mk b/Unix.mk index 1cfaebe..6f8be6e 100644 --- a/Unix.mk +++ b/Unix.mk @@ -24,6 +24,8 @@ ifeq ($(BSP),2) CFLAGS += -DBSP23 endif +CFLAGS += -DVERSION="\"0.0b\"" + .PHONY: clean run run-debug debug export tree default: clean build/kernel7.img diff --git a/Win.mk b/Win.mk index b992692..09d3195 100644 --- a/Win.mk +++ b/Win.mk @@ -24,6 +24,8 @@ ifeq ($(BSP),2) CFLAGS += -DBSP23 endif +CFLAGS += -DVERSION="\"0.0b\"" + .PHONY: clean run run-debug debug export tree default: clean build/kernel7.img diff --git a/src/kernel.S b/src/kernel.S index 4877c4a..452de10 100644 --- a/src/kernel.S +++ b/src/kernel.S @@ -7,17 +7,13 @@ kernel_main: bl enable_irq bl enable_fiq bl chk_irq_stat - ldr r0, =os_info - bl uart_string + bl postinit kernel_main.loop: bl io_halt b kernel_main.loop pop {lr} .section ".data" -.globl os_info -os_info: - .asciz "\033[93mInitialized the Real Time Operating System\033[0m\n\033[96mName\033[0m: \033[94mTarvaOS\033[0m\n\033[96mVersion\033[0m: \033[95m0.0a\033[0m\n\nQEMU\n====\n Exit : Ctrl-A x\n Monitor : Ctrl-A c\n\n" .globl cntfrq cntfrq: .word 0,0,0,0 diff --git a/src/lib.c b/src/lib.c index eb3833b..15f5c80 100644 --- a/src/lib.c +++ b/src/lib.c @@ -14,6 +14,14 @@ void uart_10(unsigned long); extern unsigned long cntfrq; +static char* os_info_h = "\033[93mInitialized the Real Time Operating System\033[0m\n\033[96mName\033[0m: \033[94mTarvaOS\033[0m\n\033[96mVersion\033[0m: \033[95m"; +static char* os_info_t = "\033[0m\n\nQEMU\n====\n Exit : Ctrl-A x\n Monitor : Ctrl-A c\n\n"; +#ifndef VERSION +static char* os_info_v = "?"; +#else +static char* os_info_v = VERSION; +#endif + static char* irq_on = " \033[92mEnabled\033[0m\n"; static char* irq_off = " \033[91mDisabled\033[0m\n"; @@ -134,6 +142,12 @@ void chk_irq_stat() { uart_char(0x0a); } +void postinit() { + uart_string(os_info_h); + uart_string(os_info_v); + uart_string(os_info_t); +} + void uart_10(unsigned long val) { unsigned long t = val; unsigned long c; -- cgit v1.2.1