diff options
author | Christian Cunningham <cc@localhost> | 2021-12-03 11:12:28 -0700 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2021-12-03 11:12:28 -0700 |
commit | 2cba0207a444fefcb886173e7a252e11a1871c2f (patch) | |
tree | cab86bf69ab568d8f34e086c1ce30bb1caa6e830 | |
parent | 0d37ddacb2f2e787ea1aa1878e0e5e39253f507b (diff) |
Added Makefile Versioning
-rw-r--r-- | Unix.mk | 2 | ||||
-rw-r--r-- | Win.mk | 2 | ||||
-rw-r--r-- | src/kernel.S | 6 | ||||
-rw-r--r-- | src/lib.c | 14 |
4 files changed, 19 insertions, 5 deletions
@@ -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 @@ -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 @@ -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; |