mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-11 15:29:18 +00:00
Restructured and rewritten entire codebase
This commit is contained in:
@ -1,18 +1,18 @@
|
||||
/*
|
||||
This file is part of Fennix Kernel.
|
||||
This file is part of Fennix Kernel.
|
||||
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
Fennix Kernel is free software: you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License as
|
||||
published by the Free Software Foundation, either version 3 of
|
||||
the License, or (at your option) any later version.
|
||||
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
Fennix Kernel is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __FENNIX_KERNEL_FILESYSTEM_DEV_H__
|
||||
@ -22,9 +22,86 @@
|
||||
|
||||
#include <filesystem.hpp>
|
||||
|
||||
void Init_Null(VirtualFileSystem::Virtual *vfs_ctx);
|
||||
void Init_Random(VirtualFileSystem::Virtual *vfs_ctx);
|
||||
void Init_Teletype(VirtualFileSystem::Virtual *vfs_ctx);
|
||||
void Init_Zero(VirtualFileSystem::Virtual *vfs_ctx);
|
||||
namespace vfs
|
||||
{
|
||||
class vfsRoot : public Node
|
||||
{
|
||||
public:
|
||||
vfsRoot(const char *Name, Virtual *vfs_ctx);
|
||||
~vfsRoot() {}
|
||||
};
|
||||
|
||||
class NullDevice : public Node
|
||||
{
|
||||
public:
|
||||
virtual size_t read(uint8_t *Buffer,
|
||||
size_t Size,
|
||||
off_t Offset);
|
||||
virtual size_t write(uint8_t *Buffer,
|
||||
size_t Size,
|
||||
off_t Offset);
|
||||
|
||||
NullDevice();
|
||||
~NullDevice();
|
||||
};
|
||||
|
||||
class RandomDevice : public Node
|
||||
{
|
||||
public:
|
||||
virtual size_t read(uint8_t *Buffer,
|
||||
size_t Size,
|
||||
off_t Offset);
|
||||
virtual size_t write(uint8_t *Buffer,
|
||||
size_t Size,
|
||||
off_t Offset);
|
||||
|
||||
RandomDevice();
|
||||
~RandomDevice();
|
||||
};
|
||||
|
||||
class ZeroDevice : public Node
|
||||
{
|
||||
public:
|
||||
virtual size_t read(uint8_t *Buffer,
|
||||
size_t Size,
|
||||
off_t Offset);
|
||||
virtual size_t write(uint8_t *Buffer,
|
||||
size_t Size,
|
||||
off_t Offset);
|
||||
|
||||
ZeroDevice();
|
||||
~ZeroDevice();
|
||||
};
|
||||
|
||||
class TTYDevice : public Node
|
||||
{
|
||||
public:
|
||||
virtual size_t write(uint8_t *Buffer,
|
||||
size_t Size,
|
||||
off_t Offset);
|
||||
virtual int ioctl(unsigned long Request,
|
||||
void *Argp);
|
||||
|
||||
TTYDevice();
|
||||
~TTYDevice();
|
||||
};
|
||||
|
||||
class PTMXDevice : public Node
|
||||
{
|
||||
private:
|
||||
Node *pts = nullptr;
|
||||
|
||||
public:
|
||||
virtual size_t read(uint8_t *Buffer,
|
||||
size_t Size,
|
||||
off_t Offset);
|
||||
virtual size_t write(uint8_t *Buffer,
|
||||
size_t Size,
|
||||
off_t Offset);
|
||||
|
||||
PTMXDevice();
|
||||
~PTMXDevice();
|
||||
};
|
||||
}
|
||||
|
||||
#endif // !__FENNIX_KERNEL_FILESYSTEM_DEV_H__
|
||||
|
Reference in New Issue
Block a user