Merge pull request #1139 from oliverschmidt/master

Several minor retrocomputing configuration changes.
This commit is contained in:
Oliver Schmidt 2015-06-22 07:59:25 +02:00
commit 08be27b602
17 changed files with 118 additions and 33 deletions

View File

@ -51,7 +51,7 @@
PROCESS(shell_ls_process, "ls");
SHELL_COMMAND(ls_command,
"ls",
"ls: list files",
"ls <dirname>: list files",
&shell_ls_process);
PROCESS(shell_append_process, "append");
SHELL_COMMAND(append_command,
@ -82,19 +82,21 @@ PROCESS_THREAD(shell_ls_process, ev, data)
char buf[32];
PROCESS_BEGIN();
if(cfs_opendir(&dir, "/") != 0) {
shell_output_str(&ls_command, "Cannot open directory", "");
} else {
totsize = 0;
while(cfs_readdir(&dir, &dirent) == 0) {
totsize += dirent.size;
sprintf(buf, "%lu ", (unsigned long)dirent.size);
/* printf("'%s'\n", dirent.name);*/
shell_output_str(&ls_command, buf, dirent.name);
if(data != NULL) {
if(cfs_opendir(&dir, data) != 0) {
shell_output_str(&ls_command, "Cannot open directory", "");
} else {
totsize = 0;
while(cfs_readdir(&dir, &dirent) == 0) {
totsize += dirent.size;
sprintf(buf, "%lu ", (unsigned long)dirent.size);
/* printf("'%s'\n", dirent.name);*/
shell_output_str(&ls_command, buf, dirent.name);
}
cfs_closedir(&dir);
sprintf(buf, "%lu", (unsigned long)totsize);
shell_output_str(&ls_command, "Total size: ", buf);
}
cfs_closedir(&dir);
sprintf(buf, "%lu", (unsigned long)totsize);
shell_output_str(&ls_command, "Total size: ", buf);
}
PROCESS_END();
}

View File

@ -84,7 +84,7 @@ typedef unsigned short uip_stats_t;
#if CONNECTIONS
#define UIP_CONF_MAX_CONNECTIONS CONNECTIONS
#else /* CONNECTIONS */
#define UIP_CONF_MAX_CONNECTIONS 10
#define UIP_CONF_MAX_CONNECTIONS 2
#endif /* CONNECTIONS */
#if WITH_LOGGING

View File

@ -6,7 +6,7 @@ $(OBJECTDIR)/%.o: %.c | $(OBJECTDIR)
CUSTOM_RULE_C_TO_CO = 1
%.co: %.c
$(TRACE_CC)
$(Q)$(CC) -c -o $@ $(CFLAGS) -DAUTOSTART_ENABLE --create-dep $(@:.o=.d) $<
$(Q)$(CC) -c -o $@ $(CFLAGS) -DAUTOSTART_ENABLE $<
CUSTOM_RULE_LINK = 1
%.$(TARGET): %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a

View File

@ -37,7 +37,7 @@ high-level configuration macros may be set:
- Purpose: Set the Maximum Transfer Unit size.
- CONNECTIONS
- Default: 10
- Default: 2
- Purpose: Set the maximum number of concurrent TCP connections.
- ETHERNET

View File

@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_CLIENT,WITH_DNS,WITH_PFS
DEFINES = CONNECTIONS=3,WITH_LOGGING,WITH_CLIENT,WITH_DNS,MTU_SIZE=1000

View File

@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_CLIENT,WITH_DNS
DEFINES = CONNECTIONS=3,WITH_LOGGING,WITH_CLIENT,WITH_DNS

View File

@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_CLIENT,WITH_DNS,WITH_PFS,CONNECTIONS=2,MTU_SIZE=500
DEFINES = WITH_LOGGING

View File

@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_CLIENT,WITH_DNS,WITH_PFS
DEFINES = CONNECTIONS=3,WITH_LOGGING,WITH_CLIENT,WITH_DNS

View File

@ -48,21 +48,18 @@ PROCESS_THREAD(shell_init_process, ev, data)
{
PROCESS_BEGIN();
#ifdef __CC65__
shell_ps_init();
shell_netstat_init();
shell_wget_init();
shell_memdebug_init();
#else /* __CC65__ */
shell_file_init();
#ifndef __CC65__
shell_httpd_init();
shell_irc_init();
shell_ps_init();
shell_run_init();
shell_text_init();
shell_time_init();
#endif /* !__CC65__ */
#ifndef __C128__
shell_wget_init();
#endif /* __CC65__ */
#endif /* !__C128__ */
PROCESS_END();
}

View File

@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_BOOST,CONNECTIONS=5
DEFINES = CONNECTIONS=4,WITH_LOGGING,WITH_BOOST

View File

@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_BOOST
DEFINES = CONNECTIONS=4,WITH_LOGGING,WITH_BOOST

View File

@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_BOOST,WITH_PFS,CONNECTIONS=5
DEFINES = CONNECTIONS=4,WITH_LOGGING,WITH_BOOST,WITH_PFS

View File

@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_BOOST,WITH_PFS
DEFINES = CONNECTIONS=4,WITH_LOGGING,WITH_BOOST,WITH_PFS

View File

@ -31,7 +31,7 @@
# Author: Oliver Schmidt <ol.sc@web.de>
#
CONTIKI_TARGET_SOURCEFILES += pfs.S pfs_write.S
CONTIKI_TARGET_SOURCEFILES += lseek.c pfs.S pfs_write.S
CONTIKI_CPU = $(CONTIKI)/cpu/6502
include $(CONTIKI_CPU)/Makefile.6502

43
platform/c128/lib/lseek.c Normal file
View File

@ -0,0 +1,43 @@
/*
* Copyright (c) 2007, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*
* Author: Oliver Schmidt <ol.sc@web.de>
*
*/
#include <unistd.h>
/*-----------------------------------------------------------------------------------*/
off_t
__fastcall__ lseek(int fd, off_t offset, int whence)
{
return (off_t)-1;
}
/*-----------------------------------------------------------------------------------*/

View File

@ -31,7 +31,7 @@
# Author: Oliver Schmidt <ol.sc@web.de>
#
CONTIKI_TARGET_SOURCEFILES += pfs.S pfs_write.S
CONTIKI_TARGET_SOURCEFILES += lseek.c pfs.S pfs_write.S
CONTIKI_CPU = $(CONTIKI)/cpu/6502
include $(CONTIKI_CPU)/Makefile.6502

43
platform/c64/lib/lseek.c Normal file
View File

@ -0,0 +1,43 @@
/*
* Copyright (c) 2007, Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*
* Author: Oliver Schmidt <ol.sc@web.de>
*
*/
#include <unistd.h>
/*-----------------------------------------------------------------------------------*/
off_t
__fastcall__ lseek(int fd, off_t offset, int whence)
{
return (off_t)-1;
}
/*-----------------------------------------------------------------------------------*/