From 50be40768bc56a8e4670a259e474af134dcebe5a Mon Sep 17 00:00:00 2001 From: oliverschmidt Date: Wed, 10 Feb 2010 07:43:25 +0000 Subject: [PATCH] Removed closing of stdin, stdout (and stderr on the Apple2). It was introduced in order to maximize the number of available file handles for the webserver. However none of the target machine DOSes allows to open a single file several times diminishing the intended effect very much. One the other hand not being able to "just printf() something" causes trouble over and again - i.e. hello-world seemingly not working...after all a typical case of german over-enigneering ;-) --- {platform => backyard/platform}/apple2enh/lib/log-asm.S | 2 +- {platform => backyard/platform}/apple2enh/lib/log.c | 2 +- cpu/6502/README | 4 ---- platform/apple2enh/Makefile.apple2enh | 4 ++-- platform/apple2enh/contiki-conf.h | 4 ++-- platform/apple2enh/contiki-main.c | 8 +------- platform/c128/contiki-conf.h | 4 ++-- platform/c128/contiki-main.c | 8 +------- platform/c64/contiki-conf.h | 4 ++-- platform/c64/contiki-main.c | 8 +------- 10 files changed, 13 insertions(+), 35 deletions(-) rename {platform => backyard/platform}/apple2enh/lib/log-asm.S (97%) rename {platform => backyard/platform}/apple2enh/lib/log.c (97%) diff --git a/platform/apple2enh/lib/log-asm.S b/backyard/platform/apple2enh/lib/log-asm.S similarity index 97% rename from platform/apple2enh/lib/log-asm.S rename to backyard/platform/apple2enh/lib/log-asm.S index 35c9ee7f7..b5935e3a6 100644 --- a/platform/apple2enh/lib/log-asm.S +++ b/backyard/platform/apple2enh/lib/log-asm.S @@ -30,7 +30,7 @@ ; ; Author: Oliver Schmidt ; -; $Id: log-asm.S,v 1.1 2007/12/21 00:43:57 oliverschmidt Exp $ +; $Id: log-asm.S,v 1.1 2010/02/10 07:43:25 oliverschmidt Exp $ ; ;--------------------------------------------------------------------- .importzp ptr1 diff --git a/platform/apple2enh/lib/log.c b/backyard/platform/apple2enh/lib/log.c similarity index 97% rename from platform/apple2enh/lib/log.c rename to backyard/platform/apple2enh/lib/log.c index 73ad2d9c4..38d14732c 100644 --- a/platform/apple2enh/lib/log.c +++ b/backyard/platform/apple2enh/lib/log.c @@ -30,7 +30,7 @@ * * Author: Oliver Schmidt * - * $Id: log.c,v 1.1 2007/12/21 00:43:57 oliverschmidt Exp $ + * $Id: log.c,v 1.1 2010/02/10 07:43:25 oliverschmidt Exp $ */ #include "net/uip.h" diff --git a/cpu/6502/README b/cpu/6502/README index 837106a37..ae314d0ee 100644 --- a/cpu/6502/README +++ b/cpu/6502/README @@ -25,10 +25,6 @@ bootable floppy disk image containing the project binary, a sample configuration file and the Ethernet card drivers. -The 6502-based targets do in general not support keyboard input or screen output -through stdin, stdout and stderr. - - The build for 6502-based machines supports so-called high-level configuration macros which allow to customize Contiki on a per-project basis. They are set in form of a comma-separated list as value of the make variable DEFINES on the diff --git a/platform/apple2enh/Makefile.apple2enh b/platform/apple2enh/Makefile.apple2enh index 3a139e49b..6f7a4ccde 100644 --- a/platform/apple2enh/Makefile.apple2enh +++ b/platform/apple2enh/Makefile.apple2enh @@ -30,10 +30,10 @@ # # Author: Oliver Schmidt # -# $Id: Makefile.apple2enh,v 1.11 2010/01/31 18:21:41 oliverschmidt Exp $ +# $Id: Makefile.apple2enh,v 1.12 2010/02/10 07:43:25 oliverschmidt Exp $ # -CONTIKI_SOURCEFILES += log-asm.S pfs.S +CONTIKI_SOURCEFILES += pfs.S HIGHCODE_SOURCEFILES = process.c etimer.c uip_arp.c CONTIKI_CPU = $(CONTIKI)/cpu/6502 diff --git a/platform/apple2enh/contiki-conf.h b/platform/apple2enh/contiki-conf.h index 1cfc17625..aedd3ef9b 100644 --- a/platform/apple2enh/contiki-conf.h +++ b/platform/apple2enh/contiki-conf.h @@ -30,7 +30,7 @@ * * Author: Oliver Schmidt * - * $Id: contiki-conf.h,v 1.18 2010/01/31 21:50:11 oliverschmidt Exp $ + * $Id: contiki-conf.h,v 1.19 2010/02/10 07:43:25 oliverschmidt Exp $ */ #ifndef __CONTIKI_CONF_H__ @@ -56,7 +56,7 @@ #define IRC_CONF_HEIGHT 23 #define WEBSERVER_CONF_CGI_CONNS UIP_CONNS -#define WEBSERVER_CONF_CFS_CONNS 7 +#define WEBSERVER_CONF_CFS_CONNS 8 - 3 #define WWW_CONF_WEBPAGE_WIDTH 80 #define WWW_CONF_WEBPAGE_HEIGHT 19 diff --git a/platform/apple2enh/contiki-main.c b/platform/apple2enh/contiki-main.c index 44fc31d46..c074ab4c8 100644 --- a/platform/apple2enh/contiki-main.c +++ b/platform/apple2enh/contiki-main.c @@ -30,7 +30,7 @@ * * Author: Oliver Schmidt * - * $Id: contiki-main.c,v 1.19 2009/10/18 09:37:37 oliverschmidt Exp $ + * $Id: contiki-main.c,v 1.20 2010/02/10 07:43:25 oliverschmidt Exp $ */ #include "contiki-net.h" @@ -73,12 +73,6 @@ main(void) rebootafterexit(); videomode(VIDEOMODE_80COL); -#if !WITH_PFS - close(STDIN_FILENO); - close(STDOUT_FILENO); - close(STDERR_FILENO); -#endif /* !WITH_PFS */ - process_init(); #if 1 diff --git a/platform/c128/contiki-conf.h b/platform/c128/contiki-conf.h index dbe10e00e..337895a29 100644 --- a/platform/c128/contiki-conf.h +++ b/platform/c128/contiki-conf.h @@ -30,7 +30,7 @@ * * Author: Oliver Schmidt * - * $Id: contiki-conf.h,v 1.9 2010/02/03 23:19:39 oliverschmidt Exp $ + * $Id: contiki-conf.h,v 1.10 2010/02/10 07:43:25 oliverschmidt Exp $ */ #ifndef __CONTIKI_CONF_H__ @@ -64,7 +64,7 @@ #define IRC_CONF_HEIGHT 24 #define WEBSERVER_CONF_CGI_CONNS UIP_CONNS -#define WEBSERVER_CONF_CFS_CONNS 7 +#define WEBSERVER_CONF_CFS_CONNS 8 - 3 #define WWW_CONF_WEBPAGE_WIDTH 80 #define WWW_CONF_WEBPAGE_HEIGHT 20 diff --git a/platform/c128/contiki-main.c b/platform/c128/contiki-main.c index a7d473f48..0a1cb47c9 100644 --- a/platform/c128/contiki-main.c +++ b/platform/c128/contiki-main.c @@ -30,7 +30,7 @@ * * Author: Oliver Schmidt * - * $Id: contiki-main.c,v 1.7 2009/10/18 09:35:07 oliverschmidt Exp $ + * $Id: contiki-main.c,v 1.8 2010/02/10 07:43:25 oliverschmidt Exp $ */ #include @@ -89,12 +89,6 @@ main(void) videomode(VIDEOMODE_80COL); - close(STDIN_FILENO); - close(STDOUT_FILENO); -#if !UIP_LOGGING && !LOG_CONF_ENABLED - close(STDERR_FILENO); -#endif /* !UIP_LOGGING && !LOG_CONF_ENABLED */ - process_init(); #if 1 diff --git a/platform/c64/contiki-conf.h b/platform/c64/contiki-conf.h index 439735fff..6aba57f61 100644 --- a/platform/c64/contiki-conf.h +++ b/platform/c64/contiki-conf.h @@ -30,7 +30,7 @@ * * Author: Oliver Schmidt * - * $Id: contiki-conf.h,v 1.19 2010/01/31 21:50:11 oliverschmidt Exp $ + * $Id: contiki-conf.h,v 1.20 2010/02/10 07:43:25 oliverschmidt Exp $ */ #ifndef __CONTIKI_CONF_H__ @@ -64,7 +64,7 @@ #define IRC_CONF_HEIGHT 24 #define WEBSERVER_CONF_CGI_CONNS UIP_CONNS -#define WEBSERVER_CONF_CFS_CONNS 8 +#define WEBSERVER_CONF_CFS_CONNS 8 - 3 #define WWW_CONF_WEBPAGE_WIDTH 40 #define WWW_CONF_WEBPAGE_HEIGHT 20 diff --git a/platform/c64/contiki-main.c b/platform/c64/contiki-main.c index 76286549e..3e8bacd3a 100644 --- a/platform/c64/contiki-main.c +++ b/platform/c64/contiki-main.c @@ -30,7 +30,7 @@ * * Author: Oliver Schmidt * - * $Id: contiki-main.c,v 1.22 2009/02/27 07:57:14 oliverschmidt Exp $ + * $Id: contiki-main.c,v 1.23 2010/02/10 07:43:25 oliverschmidt Exp $ */ #include @@ -87,12 +87,6 @@ main(void) { struct ethernet_config *ethernet_config; - close(STDIN_FILENO); - close(STDOUT_FILENO); -#if !UIP_LOGGING && !LOG_CONF_ENABLED - close(STDERR_FILENO); -#endif /* !UIP_LOGGING && !LOG_CONF_ENABLED */ - process_init(); #if 1