From 499e349afa57536ce80497aa99f61c5492e3733e Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 29 Jan 2011 03:15:44 +0100 Subject: More filesystem stuff working. devfs is now in place with stdin, stdout, and stderr. --- os/include/filesystem.h | 14 ++++++++++++++ os/include/fio.h | 2 ++ os/include/hash-djb2.h | 8 ++++++++ 3 files changed, 24 insertions(+) create mode 100644 os/include/filesystem.h create mode 100644 os/include/hash-djb2.h (limited to 'os/include') diff --git a/os/include/filesystem.h b/os/include/filesystem.h new file mode 100644 index 0000000..4b50600 --- /dev/null +++ b/os/include/filesystem.h @@ -0,0 +1,14 @@ +#ifndef __FILESYSTEM_H__ +#define __FILESYSTEM_H__ + +#include +#include + +#define MAX_FS 16 + +typedef int (*fs_open_t)(void * opaque, const char * fname, int flags, int mode); + +int register_fs(const char * mountpoint, fs_open_t callback, void * opaque); +int fs_open(const char * path, int flags, int mode); + +#endif diff --git a/os/include/fio.h b/os/include/fio.h index a1a1c1f..e4ba659 100644 --- a/os/include/fio.h +++ b/os/include/fio.h @@ -25,4 +25,6 @@ ssize_t fio_write(int fd, const void * buf, size_t count); off_t fio_seek(int fd, off_t offset, int whence); int fio_close(int fd); +void register_devfs(); + #endif diff --git a/os/include/hash-djb2.h b/os/include/hash-djb2.h new file mode 100644 index 0000000..413222e --- /dev/null +++ b/os/include/hash-djb2.h @@ -0,0 +1,8 @@ +#ifndef __HASH_DJB2_H__ +#define __HASH_DJB2_H__ + +#include + +uint32_t hash_djb2(const uint8_t * str, ssize_t max); + +#endif -- cgit v1.2.3