Kernel: Add procfs that contains only pids

This commit is contained in:
Bananymous
2023-09-30 21:19:36 +03:00
parent 56bb419884
commit 8f630a97df
9 changed files with 135 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
#pragma once
#include <kernel/FS/RamFS/FileSystem.h>
#include <kernel/FS/RamFS/Inode.h>
#include <kernel/Process.h>
namespace Kernel
{
class ProcFileSystem final : public RamFileSystem
{
public:
static void initialize();
static ProcFileSystem& get();
BAN::ErrorOr<void> on_process_create(Process&);
void on_process_delete(Process&);
private:
ProcFileSystem(size_t size);
private:
BAN::RefPtr<RamDirectoryInode> m_root_inode;
};
}

View File

@@ -0,0 +1,23 @@
#pragma once
#include <kernel/FS/RamFS/FileSystem.h>
#include <kernel/FS/RamFS/Inode.h>
#include <kernel/Process.h>
namespace Kernel
{
class ProcPidInode final : public RamDirectoryInode
{
public:
static BAN::ErrorOr<BAN::RefPtr<ProcPidInode>> create(Process&, RamFileSystem&, mode_t, uid_t, gid_t);
~ProcPidInode() = default;
private:
ProcPidInode(Process&, RamFileSystem&, const FullInodeInfo&);
private:
Process& m_process;
};
}