summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2015-05-23 21:39:42 +0200
committerMichal Idziorek <m.i@gmx.at>2015-05-23 21:39:42 +0200
commitdadd5202a3ccfd8c03fb9eb60e6a15b0fb987672 (patch)
tree3c4b818f90a4862f82ed2e03ceaaf9d7723d293d /fs
parent6c8be13c682a0aef520b2d3efeb67dcf078b1889 (diff)
filesystem stuff and experimenting with userspace tasks
Diffstat (limited to 'fs')
-rw-r--r--fs/file.c2
-rw-r--r--fs/file.h6
-rw-r--r--fs/foolfs.h0
-rw-r--r--fs/mount.c12
-rw-r--r--fs/mount.h14
5 files changed, 31 insertions, 3 deletions
diff --git a/fs/file.c b/fs/file.c
index 609da63..185c3a9 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -1,2 +1,4 @@
#include "file.h"
+
+
diff --git a/fs/file.h b/fs/file.h
index f8445a2..7734393 100644
--- a/fs/file.h
+++ b/fs/file.h
@@ -3,6 +3,8 @@
#include <stdint.h>
+#define FILE_MAX_FILES 100;
+
typedef struct
{
int(* seek)(int offset, int whence);
@@ -17,4 +19,8 @@ typedef struct
}file;
+
+
+
+
#endif
diff --git a/fs/foolfs.h b/fs/foolfs.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/fs/foolfs.h
diff --git a/fs/mount.c b/fs/mount.c
new file mode 100644
index 0000000..616262d
--- /dev/null
+++ b/fs/mount.c
@@ -0,0 +1,12 @@
+#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
index beece3c..372e051 100644
--- a/fs/mount.h
+++ b/fs/mount.h
@@ -3,15 +3,23 @@
#define MOUNT_MAX_MOUNTS 10
-typedef struct mount_strutc
+#include <stdint.h>
+#include "file.h"
+#include "fs.h"
+
+typedef struct mount_struct
{
char path[256]; // where are we mounted
- int (*getdents)(mount_struct*, uint32_t file_desciptor, fs_dirent *entries, uint32_t max_count);
- file (*open)ByName(mount_struct*,char *path);
+ 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