From 740ae2e69995df37c44fe61f57642ee642982ca2 Mon Sep 17 00:00:00 2001 From: Miguel Date: Sun, 16 Sep 2018 11:39:36 +0200 Subject: cleanup and starting improve mounts and file access (pipes, sysfiles, ext2) --- fs/fd.h | 16 ++++++++++++++++ fs/file.c | 4 ---- fs/file.h | 26 -------------------------- fs/mount.c | 12 ------------ fs/mount.h | 23 ----------------------- 5 files changed, 16 insertions(+), 65 deletions(-) delete mode 100644 fs/file.c delete mode 100644 fs/file.h delete mode 100644 fs/mount.c delete mode 100644 fs/mount.h (limited to 'fs') diff --git a/fs/fd.h b/fs/fd.h index a3bdb5a..429387b 100644 --- a/fs/fd.h +++ b/fs/fd.h @@ -8,6 +8,22 @@ #include "fifo.h" +/* +typedef struct +{ + int(* seek)(int offset, int whence); + + int(* read)(char *buf, int len); + int(* wrtie)(char *buf, int len); + + int(* close)(); + int(* stat)(void *buf); + + void *data; //opaque + +}file; +*/ + enum FD_TYPE{ FD_TYPE_FIFO_BUFFERED=1, FD_TYPE_EXT2_FILE=2 diff --git a/fs/file.c b/fs/file.c deleted file mode 100644 index 185c3a9..0000000 --- a/fs/file.c +++ /dev/null @@ -1,4 +0,0 @@ -#include "file.h" - - - diff --git a/fs/file.h b/fs/file.h deleted file mode 100644 index 53c96d8..0000000 --- a/fs/file.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef FILE_H -#define FILE_H - -#include - -#define FILE_MAX_FILES 100; - -typedef struct -{ - int(* seek)(int offset, int whence); - - int(* read)(char *buf, int len); - int(* wrtie)(char *buf, int len); - - int(* close)(); - int(* stat)(void *buf); - - void *data; //opaque - -}file; - - - - - -#endif diff --git a/fs/mount.c b/fs/mount.c deleted file mode 100644 index cb741f9..0000000 --- a/fs/mount.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "mount.h" - -void mount_add(char *path, void *data, - file (*open) (struct mount_struct*,char *path), - int (*getdents)(struct mount_struct*, uint32_t file_desciptor, fs_dirent *entries, uint32_t max_count)) -{ -} - -mount *mounts_get() -{ - return 0; -} diff --git a/fs/mount.h b/fs/mount.h deleted file mode 100644 index a327e2e..0000000 --- a/fs/mount.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef MOUNT_H -#define MOUNT_H - -#define MOUNT_MAX_MOUNTS 10 - -#include -#include "file.h" -#include "interface/fs.h" - -typedef struct mount_struct -{ - char path[256]; // where are we mounted - int (*getdents) (struct mount_struct*, uint32_t file_desciptor, fs_dirent *entries, uint32_t max_count); - file (*open) (struct mount_struct*,char *path); - void *data; //opaque - -}mount; - -mount *mounts_get(); -void mount_add(char *path, void *data,file (*open)(struct mount_struct*,char *path),int (*getdents)(struct mount_struct*, uint32_t file_desciptor, fs_dirent *entries, uint32_t max_count)); - -// -#endif -- cgit v1.2.3