summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-09-16 11:39:36 +0200
committerMiguel <m.i@gmx.at>2018-09-16 11:39:36 +0200
commit740ae2e69995df37c44fe61f57642ee642982ca2 (patch)
treeb84ec79e9243fd0fe103fab1c1acc1e91e60f53d /fs
parente0449c5adc89eec9f378cb40a56762bf314a80ea (diff)
cleanup and starting improve mounts and file access (pipes, sysfiles, ext2)
Diffstat (limited to 'fs')
-rw-r--r--fs/fd.h16
-rw-r--r--fs/file.c4
-rw-r--r--fs/file.h26
-rw-r--r--fs/mount.c12
-rw-r--r--fs/mount.h23
5 files changed, 16 insertions, 65 deletions
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 <stdint.h>
-
-#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 <stdint.h>
-#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