diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-10-16 11:01:38 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-10-16 11:02:00 +0200 |
commit | 9396108034acd4bdd91532e13528f0b94af16653 (patch) | |
tree | 26d7870743b3276555db4f2408a4ce9c3f8ced9a /Kernel/FileSystem.h | |
parent | f6086297047b639ede6fc0e058e4efcfc09ea46f (diff) | |
download | serenity-9396108034acd4bdd91532e13528f0b94af16653.zip |
Import the "gerbert" kernel I worked on earlier this year.
It's a lot crappier than I remembered it. It's gonna need a lot of work.
Diffstat (limited to 'Kernel/FileSystem.h')
-rw-r--r-- | Kernel/FileSystem.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Kernel/FileSystem.h b/Kernel/FileSystem.h new file mode 100644 index 0000000000..7fff99868a --- /dev/null +++ b/Kernel/FileSystem.h @@ -0,0 +1,35 @@ +#pragma once + +#include "types.h" +#include "RefCounted.h" + +namespace FileSystem { + +void initialize(); + +class VirtualNode : public RefCounted<VirtualNode> { +public: + DWORD saneValue = 0x850209; + virtual ~VirtualNode(); + + DWORD index() const { return m_index; } + const String& path() const { return m_path; } + + virtual size_t size() const = 0; + virtual uid_t uid() const = 0; + virtual gid_t gid() const = 0; + virtual size_t mode() const = 0; + + virtual size_t read(BYTE* outbuf, size_t start, size_t maxLength) = 0; + +protected: + VirtualNode(DWORD index, String&& path); + +private: + DWORD m_index { 0 }; + String m_path; +}; + +RefPtr<VirtualNode> createVirtualNode(String&& path); + +} |