Skip to content

Commit

Permalink
Added a pfs_remove() function and a pfs_seek() stub to the Commodore …
Browse files Browse the repository at this point in the history
…platforms.

- "Normalized" some Assembly code.
- Implemented CFS_APPEND in pfs_open().
- Made CFS_WRITE work in VICE's virtual disk/file system.
  • Loading branch information
oliverschmidt committed Mar 28, 2016
1 parent 3b9fa19 commit 4f28289
Show file tree
Hide file tree
Showing 12 changed files with 798 additions and 530 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ contiki-cc2530dk.lib
*.dsc

#cc65 build artifacts
*.S
*.s
*.eth
*.dsk
*.po
Expand Down
16 changes: 9 additions & 7 deletions cpu/6502/lib/pfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,21 @@
* SUCH DAMAGE.
*
* This file is part of the Contiki operating system.
*
*
* Author: Oliver Schmidt <[email protected]>
*
*/

#ifndef PFS_H_
#define PFS_H_

int __fastcall__ pfs_open(const char* name, int flags);
void __fastcall__ pfs_close(int fd);
int __fastcall__ pfs_read(int fd, void* buf, unsigned int len);
int __fastcall__ pfs_write(int fd, void* buf, unsigned int len);
int __fastcall__ pfs_seek(int fd, int offset, int whence);
int __fastcall__ pfs_remove(const char *name);
#include <sys/types.h>

int __fastcall__ pfs_open(const char *name, int flags);
void __fastcall__ pfs_close(int fd);
int __fastcall__ pfs_read(int fd, void *buf, unsigned int len);
int __fastcall__ pfs_write(int fd, const void *buf, unsigned int len);
off_t __fastcall__ pfs_seek(int fd, off_t offset, int whence);
int __fastcall__ pfs_remove(const char *name);

#endif /* PFS_H_ */
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 += lseek.c pfs.S pfs_write.S
CONTIKI_TARGET_SOURCEFILES += lseek.c pfs.S pfs_remove.S pfs_seek.S pfs_write.S

CONTIKI_CPU = $(CONTIKI)/cpu/6502
include $(CONTIKI_CPU)/Makefile.6502
Expand Down
Loading

0 comments on commit 4f28289

Please sign in to comment.