From 141c2c194ee12a4f61facef81238732917062e3c Mon Sep 17 00:00:00 2001 From: stefan Date: Thu, 4 Nov 2010 08:27:53 +0000 Subject: [PATCH] - add a unique build number git-svn-id: http://svn.lfbs.rwth-aachen.de/svn/scc/trunk/MetalSVM@227 315a16e6-25f9-4109-90ae-ca3045a26c18 --- Makefile.example | 2 +- kernel/main.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile.example b/Makefile.example index 57c6cd93..c7af6950 100644 --- a/Makefile.example +++ b/Makefile.example @@ -19,7 +19,7 @@ export AR = ar export ARFLAGS = rsv export RM = rm -rf LD = ld -LDFLAGS = -T link.ld -z max-page-size=4096 +LDFLAGS = -T link.ld -z max-page-size=4096 --defsym __BUILD_DATE=$(shell date +'%Y%m%d') --defsym __BUILD_TIME=$(shell date +'%H%M%S') --defsym __BUILD_VERSION=$(shell svnversion -cn ../ | sed -e "s/.*://" -e "s/\([0-9]*\).*/\1/" | grep "[0-9]") default: for i in $(SUBDIRS); do $(MAKE) -C $$i default; done diff --git a/kernel/main.c b/kernel/main.c index b2069b4d..95b40101 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -45,8 +45,16 @@ #endif extern int test_init(void); + +/* + * Note that linker symbols are not variables, they have no memory allocated for + * maintaining a value, rather their address is their value. + */ extern const void kernel_start; extern const void kernel_end; +extern char __BUILD_DATE; +extern char __BUILD_TIME; +extern char __BUILD_VERSION; static void list_fs(vfs_node_t* node, uint32_t depth) { @@ -135,7 +143,7 @@ int main(void) tid_t pc_id; #endif - kprintf("This is MetalSVM %s\n", METALSVM_VERSION); + kprintf("This is MetalSVM %s Build %u, %u, %u\n", METALSVM_VERSION, &__BUILD_VERSION, &__BUILD_DATE, &__BUILD_TIME); system_init(); irq_init();