64 [[nodiscard]]
virtual std::size_t
totalFrames() const noexcept = 0;
67 [[nodiscard]] virtual std::
size_t freeFrames() const noexcept = 0;
Block — the fundamental unit of simulated memory.
Abstract interface for the Memory Management Unit.
virtual Result< MemoryAddress > allocate(ProcessId processId, std::size_t pageCount)=0
Allocates a range of frames for a process.
virtual Result< void > deallocate(ProcessId processId)=0
Deallocates all frames owned by a process.
virtual Result< Block > read(ProcessId processId, MemoryAddress virtualAddress) const =0
Reads a Block from a virtual address in a given process's address space.
virtual Result< void > swapIn(ProcessId processId, MemoryAddress virtualAddress)=0
Swaps a page into physical memory.
virtual std::size_t totalFrames() const noexcept=0
Returns the total number of physical frames managed.
virtual Result< void > swapOut(ProcessId processId, MemoryAddress virtualAddress)=0
Swaps a page out of physical memory (to simulated disk).
virtual Result< void > write(ProcessId processId, MemoryAddress virtualAddress, const Block &block)=0
Writes a Block to a virtual address in a given process's address space.
virtual std::size_t freeFrames() const noexcept=0
Returns the number of free (unallocated) physical frames.
A result type that holds either a success value of type T or an ErrorCode.
Error codes and Result<T> type for fallible operations.
std::uint32_t ProcessId
Unique identifier for a process.
std::uint32_t MemoryAddress
Represents a memory address (physical or virtual).
A single memory cell in the simulated architecture.
Common type aliases, sentinel constants, and forward declarations used throughout the Contur 2 kernel...