From 7d5a38ada35ac196919c26675f211adb995b84ae Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Fri, 18 May 2012 14:47:44 +0200 Subject: Added initrd. Status: VFS support, totally useless shell. --- src/kernel/vfs/vfile.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/kernel/vfs/vfile.h (limited to 'src/kernel/vfs/vfile.h') diff --git a/src/kernel/vfs/vfile.h b/src/kernel/vfs/vfile.h new file mode 100644 index 0000000..9b68b68 --- /dev/null +++ b/src/kernel/vfs/vfile.h @@ -0,0 +1,23 @@ +#ifndef DEF_VFS_VFILE_H +#define DEF_VFS_VFILE_H + +#include +#include "node.h" + +class vfile : public node { + char *data; + size_t size; + bool own_data; // did WE malloc the content of data ? + + public: + vfile(node* parent, char* data = 0, size_t size = 0); + virtual ~vfile(); + + // TODO: handle open(TRUNC) + virtual int read(size_t offset, size_t len, char* buffer); + virtual int write(size_t offset, size_t len, char* buffer); + virtual size_t get_size() { return size; } + +}; + +#endif -- cgit v1.2.3