From 9751ad52e7ec6d05575522bca540cc877798f54c Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 1 Sep 2016 22:16:00 +0100 Subject: [PATCH] uname: fix the 6809 sysinfo problem --- Kernel/Makefile | 6 ++++-- Kernel/include/kernel.h | 17 +---------------- Kernel/start.c | 2 +- Kernel/syscall_fs3.c | 2 +- 4 files changed, 7 insertions(+), 20 deletions(-) diff --git a/Kernel/Makefile b/Kernel/Makefile index 43dcee67..05ea9370 100644 --- a/Kernel/Makefile +++ b/Kernel/Makefile @@ -170,8 +170,10 @@ $(CS5OBJS): %$(BINEXT): %.c $(AOBJS): %$(BINEXT): %$(ASMEXT) $(CROSS_AS) $(ASOPTS) -o $*$(BINEXT) $< -version.c: makeversion - ./makeversion $(VERSION) $(SUBVERSION) $(TARGET) +version.c: tools/makeversion + tools/makeversion $(VERSION) $(SUBVERSION) $(TARGET) + +tools/makeversion: tools/makeversion.c tools/filesizes: tools/filesizes.c diff --git a/Kernel/include/kernel.h b/Kernel/include/kernel.h index a2cf72fe..6b8e9eef 100644 --- a/Kernel/include/kernel.h +++ b/Kernel/include/kernel.h @@ -648,22 +648,7 @@ struct s_argblk { /* * System info shared with user space */ -struct sysinfoblk { - uint8_t infosize; /* For expandability */ - uint8_t banks; /* Banks in our 64K (and thus pagesize) */ - uint8_t max_open; - uint8_t nproc; /* Number of processes */ - uint16_t ticks; /* Tick rate in HZ */ - uint16_t memk; /* Memory in KB */ - uint16_t usedk; /* Used memory in KB */ - uint16_t config; /* Config flag mask */ -#define CONF_PROFIL 1 -#define CONF_NET 2 /* Hah.. 8) */ -#define CONF_LEVEL_2 4 - uint16_t loadavg[3]; - uint32_t spare2; - /* Followed by uname strings */ -}; +#include /* Select: if we do the map optimisation trick then we will want one bit free for optimising, so ideal PTABSIZE will become 1 below a multiple of 8 */ diff --git a/Kernel/start.c b/Kernel/start.c index 41dab583..6545ceb9 100644 --- a/Kernel/start.c +++ b/Kernel/start.c @@ -322,7 +322,7 @@ void fuzix_main(void) "Copyright (c) 1997-2001 by Arcady Schekochikhin, Adriano C. R. da Cunha\n" "Copyright (c) 2013-2015 Will Sowerbutts \n" "Copyright (c) 2014-2015 Alan Cox \nDevboot\n", - uname_str); + sysinfo.uname); #ifndef SWAPDEV #ifdef PROC_SIZE diff --git a/Kernel/syscall_fs3.c b/Kernel/syscall_fs3.c index 1473f174..634c9c66 100644 --- a/Kernel/syscall_fs3.c +++ b/Kernel/syscall_fs3.c @@ -294,7 +294,7 @@ with node name. Rest is up to the libc. arg_t _uname(void) { - uint16_t size = sizeof(sysinfo) + uname_len; + uint16_t size = sizeof(sysinfo); if (size > len) size = len; sysinfo.memk = procmem; -- 2.34.1