Skip to content

Commit

Permalink
Merge pull request contiki-os#1139 from oliverschmidt/master
Browse files Browse the repository at this point in the history
Several minor retrocomputing configuration changes.
  • Loading branch information
oliverschmidt committed Jun 22, 2015
2 parents ac3b8b0 + a70fbf1 commit 08be27b
Show file tree
Hide file tree
Showing 17 changed files with 118 additions and 33 deletions.
28 changes: 15 additions & 13 deletions apps/shell/shell-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion cpu/6502/6502def.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cpu/6502/Makefile.customrules-6502
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cpu/6502/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/telnet-server/Makefile.apple2enh.defines
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_CLIENT,WITH_DNS,WITH_PFS
DEFINES = CONNECTIONS=3,WITH_LOGGING,WITH_CLIENT,WITH_DNS,MTU_SIZE=1000
2 changes: 1 addition & 1 deletion examples/telnet-server/Makefile.atarixl.defines
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_CLIENT,WITH_DNS
DEFINES = CONNECTIONS=3,WITH_LOGGING,WITH_CLIENT,WITH_DNS
2 changes: 1 addition & 1 deletion examples/telnet-server/Makefile.c128.defines
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_CLIENT,WITH_DNS,WITH_PFS,CONNECTIONS=2,MTU_SIZE=500
DEFINES = WITH_LOGGING
2 changes: 1 addition & 1 deletion examples/telnet-server/Makefile.c64.defines
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_CLIENT,WITH_DNS,WITH_PFS
DEFINES = CONNECTIONS=3,WITH_LOGGING,WITH_CLIENT,WITH_DNS
11 changes: 4 additions & 7 deletions examples/telnet-server/telnet-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion examples/webserver/Makefile.apple2enh.defines
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_BOOST,CONNECTIONS=5
DEFINES = CONNECTIONS=4,WITH_LOGGING,WITH_BOOST
2 changes: 1 addition & 1 deletion examples/webserver/Makefile.atarixl.defines
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_BOOST
DEFINES = CONNECTIONS=4,WITH_LOGGING,WITH_BOOST
2 changes: 1 addition & 1 deletion examples/webserver/Makefile.c128.defines
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_BOOST,WITH_PFS,CONNECTIONS=5
DEFINES = CONNECTIONS=4,WITH_LOGGING,WITH_BOOST,WITH_PFS
2 changes: 1 addition & 1 deletion examples/webserver/Makefile.c64.defines
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DEFINES = WITH_LOGGING,WITH_BOOST,WITH_PFS
DEFINES = CONNECTIONS=4,WITH_LOGGING,WITH_BOOST,WITH_PFS
2 changes: 1 addition & 1 deletion platform/c128/Makefile.c128
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# Author: Oliver Schmidt <[email protected]>
#

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
Expand Down
43 changes: 43 additions & 0 deletions platform/c128/lib/lseek.c
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*
*/

#include <unistd.h>

/*-----------------------------------------------------------------------------------*/
off_t
__fastcall__ lseek(int fd, off_t offset, int whence)
{
return (off_t)-1;
}
/*-----------------------------------------------------------------------------------*/
2 changes: 1 addition & 1 deletion platform/c64/Makefile.c64
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# Author: Oliver Schmidt <[email protected]>
#

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
Expand Down
43 changes: 43 additions & 0 deletions platform/c64/lib/lseek.c
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
*
*/

#include <unistd.h>

/*-----------------------------------------------------------------------------------*/
off_t
__fastcall__ lseek(int fd, off_t offset, int whence)
{
return (off_t)-1;
}
/*-----------------------------------------------------------------------------------*/

0 comments on commit 08be27b

Please sign in to comment.