From a13e1c0911c0627184bc38f18c7fdda64447b3ad Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Sun, 23 Mar 2025 19:13:48 +0100 Subject: meta(kernel): Reworked repository's filesystem structure. Removing useless parts of the project too. Signed-off-by: Amlal El Mahrouss --- dev/kernel/SystemKit/SwapDisk.h | 46 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 dev/kernel/SystemKit/SwapDisk.h (limited to 'dev/kernel/SystemKit') diff --git a/dev/kernel/SystemKit/SwapDisk.h b/dev/kernel/SystemKit/SwapDisk.h new file mode 100644 index 00000000..11cc6332 --- /dev/null +++ b/dev/kernel/SystemKit/SwapDisk.h @@ -0,0 +1,46 @@ + +/* ------------------------------------------- + + Copyright (C) 2024-2025 Amlal EL Mahrouss Labs, all rights reserved. + +------------------------------------------- */ + +#pragma once + +#include +#include + +#define kSwapBlockMaxSize (mib_cast(16)) +#define kSwapPageFile "/boot/pagefile.sys" + +/// @file SwapDisk.h +/// @brief Virtual memory swap disk. + +namespace NeOS +{ + struct SWAP_DISK_HEADER; + + /// @brief This class is a disk swap delegate for any data. available as a syscall too. + class SwapDisk final + { + public: + explicit SwapDisk() = default; + ~SwapDisk() = default; + + NE_COPY_DEFAULT(SwapDisk); + + BOOL Write(const Char* fork_name, const SizeT fork_name_len, SWAP_DISK_HEADER* data, const SizeT data_len); + SWAP_DISK_HEADER* Read(const Char* fork_name, const SizeT fork_name_len, const SizeT data_len); + }; + + typedef struct SWAP_DISK_HEADER + { + UInt32 fMagic; + SizeT fHeaderSz; + UInt64 fTeamID; + UInt64 fProcessID; + UInt64 fVirtualAddress; + SizeT fBlobSz; + Char fBlob[]; + } PACKED SWAP_DISK_HEADER; +} // namespace NeOS -- cgit v1.2.3