|
contur2
|
Classes | |
| struct | Block |
| A single memory cell in the simulated architecture. More... | |
| class | RegisterFile |
| The CPU's register bank — holds REGISTER_COUNT (16) registers. More... | |
| class | IClock |
| Abstract clock interface for simulation time. More... | |
| class | SimulationClock |
| Concrete simulation clock — a simple monotonic tick counter. More... | |
| class | Result |
| A result type that holds either a success value of type T or an ErrorCode. More... | |
| class | Result< void > |
| Specialization of Result for void — operations that produce no value on success. More... | |
| class | Event |
| Type-safe event dispatcher supporting multiple subscribers. More... | |
| class | ALU |
| Arithmetic Logic Unit — performs all computational operations. More... | |
| class | Cpu |
| Concrete CPU implementation. More... | |
| class | ICPU |
| Abstract CPU interface. More... | |
| class | Dispatcher |
| Uniprocessor dispatcher implementation. More... | |
| class | IDispatcher |
| Interface for process lifecycle dispatch orchestration. More... | |
| class | MPDispatcher |
| Multiprocessor dispatcher delegating to child dispatchers. More... | |
| struct | ExecutionResult |
| Result of an execution burst returned by IExecutionEngine::execute(). More... | |
| class | IExecutionEngine |
| Abstract execution engine interface. More... | |
| class | InterpreterEngine |
| Bytecode interpreter execution engine. More... | |
| class | BlockAllocator |
| Allocates and frees fixed-size disk blocks. More... | |
| struct | DirectoryEntry |
| One child entry in a directory. More... | |
| struct | FileDescriptor |
| Descriptor handle returned by open(). More... | |
| struct | OpenFileState |
| Runtime state for one open descriptor. More... | |
| class | FileDescriptorTable |
| Descriptor table mapping integer handles to open-file state. More... | |
| struct | InodeInfo |
| Public inode metadata returned by stat(). More... | |
| class | IFileSystem |
| Abstract file-system interface. More... | |
| struct | Inode |
| Persistent metadata describing a filesystem node. More... | |
| class | SimpleFS |
| In-memory educational filesystem with inode + block allocation model. More... | |
| class | ConsoleDevice |
| Console output device. More... | |
| class | DeviceManager |
| Registry and dispatcher for I/O devices. More... | |
| class | IDevice |
| Abstract interface for a simulated I/O device. More... | |
| class | NetworkDevice |
| Simulated network (LAN) device. More... | |
| class | IIpcChannel |
| Common interface for IPC channels. More... | |
| class | IpcManager |
| Registry/mediator for named IPC channels. More... | |
| struct | Message |
| Typed message used by MessageQueue. More... | |
| class | MessageQueue |
| FIFO/priority message queue IPC channel. More... | |
| class | Pipe |
| Unidirectional byte-stream IPC channel with bounded capacity. More... | |
| class | SharedMemory |
| Named shared-memory IPC channel. More... | |
| struct | ProcessConfig |
| Configuration payload used to create a process. More... | |
| struct | KernelSnapshot |
| Lightweight kernel state snapshot for UI and diagnostics. More... | |
| class | IKernel |
| Top-level kernel facade. More... | |
| struct | KernelDependencies |
| Dependency bundle used to construct a Kernel. More... | |
| class | Kernel |
| Concrete kernel facade. More... | |
| class | KernelBuilder |
| Fluent builder that assembles Kernel dependencies. More... | |
| class | ClockReplacement |
| Clock (Second Chance) page replacement. More... | |
| class | FifoReplacement |
| First-In First-Out page replacement. More... | |
| class | IMemory |
| Abstract interface for linear addressable memory. More... | |
| class | IMMU |
| Abstract interface for the Memory Management Unit. More... | |
| class | IPageReplacementPolicy |
| Abstract interface for page replacement algorithms. More... | |
| class | IVirtualMemory |
| Abstract interface for virtual memory management. More... | |
| class | LruReplacement |
| Least Recently Used page replacement. More... | |
| class | Mmu |
| Concrete Memory Management Unit implementation. More... | |
| class | OptimalReplacement |
| Optimal page replacement (Belady's algorithm). More... | |
| struct | PageTableEntry |
| Entry in the page table — maps one virtual page to a physical frame. More... | |
| class | PageTable |
| Page table mapping virtual page numbers to physical frames. More... | |
| class | PhysicalMemory |
| Simulated physical RAM — a linear array of Block cells. More... | |
| class | VirtualMemory |
| Concrete virtual memory manager. More... | |
| class | IProcess |
| Read-only interface for inspecting process metadata. More... | |
| struct | ProcessTiming |
| Aggregate holding process timing statistics. More... | |
| struct | ProcessAddressInfo |
| Aggregate holding virtual memory address mapping for a process. More... | |
| class | PCB |
| Process Control Block — stores all metadata for a single process. More... | |
| struct | Priority |
| Composite priority descriptor for a process. More... | |
| class | ProcessImage |
| Full in-memory representation of a process. More... | |
| class | FcfsPolicy |
| First Come First Served (FCFS) scheduling policy. More... | |
| class | HrrnPolicy |
| Highest Response Ratio Next (HRRN) scheduling policy. More... | |
| class | IScheduler |
| Scheduler abstraction managing process state queues. More... | |
| class | ISchedulingPolicy |
| Strategy interface for scheduling algorithms. More... | |
| class | MlfqPolicy |
| Multilevel Feedback Queue (MLFQ) scheduling policy. More... | |
| class | PriorityPolicy |
| Dynamic-priority scheduling policy. More... | |
| class | RoundRobinPolicy |
| Round Robin scheduling policy. More... | |
| class | Scheduler |
| Scheduler host that manages process queues and policy decisions. More... | |
| class | SpnPolicy |
| Shortest Process Next (SPN) scheduling policy. More... | |
| class | SrtPolicy |
| Shortest Remaining Time (SRT) scheduling policy. More... | |
| class | Statistics |
| Tracks per-process burst history and EWMA burst prediction. More... | |
| class | CriticalSection |
| Critical-section adapter over a synchronization primitive. More... | |
| struct | ResourceAllocation |
| Per-process resource vector used by Banker's safety check. More... | |
| class | DeadlockDetector |
| Deadlock detection/prevention helper. More... | |
| class | ISyncPrimitive |
| Common interface for synchronization primitives. More... | |
| class | Mutex |
| Reentrant mutex with ownership tracking. More... | |
| class | Semaphore |
| Counting semaphore synchronization primitive. More... | |
| class | ISyscallHandler |
| Interface for syscall handling. More... | |
| class | SyscallTable |
| Dispatch table mapping SyscallId to handler functions. More... | |
Typedefs | |
| using | ProcessId = std::uint32_t |
| Unique identifier for a process. | |
| using | MemoryAddress = std::uint32_t |
| Represents a memory address (physical or virtual). | |
| using | Tick = std::uint64_t |
| Simulation clock tick counter. | |
| using | RegisterValue = std::int32_t |
| Value stored in a CPU register. | |
| using | DeviceId = std::uint16_t |
| Unique identifier for an I/O device. | |
| using | SubscriptionId = std::uint64_t |
| Unique identifier for an event subscription. | |
| using | ResourceId = std::uint32_t |
| Unique identifier for a synchronization resource (mutex, semaphore, etc.). | |
| using | InodeId = std::uint32_t |
| Unique identifier for a filesystem inode. | |
| using | FrameId = std::uint32_t |
| Frame number in physical memory. | |
| using | SyscallHandlerFn |
| Function signature used for syscall registration. | |
Enumerations | |
| enum class | Instruction : std::uint8_t { Nop = 0 , Mov , Add , Sub , Mul , Div , And , Or , Xor , ShiftLeft , ShiftRight , Compare , JumpEqual , JumpNotEqual , JumpGreater , JumpLess , JumpGreaterEqual , JumpLessEqual , Push , Pop , Call , Return , ReadMemory , WriteMemory , Interrupt , Halt } |
| CPU instruction opcodes for the simulated architecture. More... | |
| enum class | Interrupt : std::int32_t { Ok = 0 , Error = -1 , DivByZero = 3 , SystemCall = 11 , PageFault = 14 , Exit = 16 , NetworkIO = 32 , Timer = 64 , DeviceIO = 254 } |
| Interrupt codes used by the CPU and kernel. More... | |
| enum class | Register : std::uint8_t { R0 = 0 , R1 , R2 , R3 , R4 , R5 , R6 , R7 , R8 , R9 , R10 , R11 , R12 , R13 , ProgramCounter = 14 , StackPointer = 15 } |
| CPU register identifiers. More... | |
| enum class | ErrorCode : std::int32_t { Ok = 0 , OutOfMemory , InvalidPid , InvalidAddress , DivisionByZero , InvalidInstruction , SegmentationFault , DeviceError , ProcessNotFound , PermissionDenied , Timeout , DeadlockDetected , InvalidState , InvalidArgument , ResourceBusy , NotFound , AlreadyExists , BufferFull , BufferEmpty , EndOfFile , NotImplemented } |
| Error codes returned by kernel subsystem operations. More... | |
| enum class | InodeType : std::uint8_t { File , Directory } |
| Type of filesystem node. More... | |
| enum class | StopReason : std::uint8_t { BudgetExhausted , ProcessExited , Error , Interrupted , Halted } |
| Reason why the execution engine returned control to the dispatcher. More... | |
| enum class | OpenMode : std::uint8_t { None = 0 , Read = 1U << 0 , Write = 1U << 1 , Create = 1U << 2 , Truncate = 1U << 3 , Append = 1U << 4 } |
| Open mode bit flags. More... | |
| enum class | PriorityLevel : std::int8_t { Realtime = 0 , High = 1 , AboveNormal = 2 , Normal = 3 , BelowNormal = 4 , Low = 5 , Idle = 6 } |
| Discrete priority levels, from highest (Realtime) to lowest (Idle). More... | |
| enum class | ProcessState : std::uint8_t { New , Ready , Running , Blocked , Suspended , Terminated } |
| All possible states in a process lifecycle. More... | |
| enum class | SyscallId : std::uint16_t { Exit = 0 , Write = 1 , Read = 2 , Fork = 3 , Exec = 4 , Wait = 5 , Open = 10 , Close = 11 , CreatePipe = 20 , SendMessage = 21 , ReceiveMessage = 22 , ShmCreate = 23 , ShmAttach = 24 , MutexLock = 30 , MutexUnlock = 31 , SemWait = 32 , SemSignal = 33 , GetPid = 40 , GetTime = 41 , Yield = 42 } |
| Numeric identifiers for system calls. More... | |
Functions | |
| constexpr std::string_view | instructionName (Instruction instr) noexcept |
| Returns the human-readable mnemonic for an instruction. | |
| constexpr std::string_view | interruptName (Interrupt intr) noexcept |
| Returns the human-readable name for an interrupt code. | |
| constexpr bool | isArithmetic (Instruction instr) noexcept |
| Returns true if the instruction is an arithmetic operation (Add, Sub, Mul, Div). | |
| constexpr bool | isLogic (Instruction instr) noexcept |
| Returns true if the instruction is a logic/bitwise operation (And, Or, Xor, Shift). | |
| constexpr bool | isJump (Instruction instr) noexcept |
| Returns true if the instruction is a conditional or unconditional jump. | |
| constexpr bool | isStackOp (Instruction instr) noexcept |
| Returns true if the instruction affects the stack (Push, Pop, Call, Return). | |
| constexpr bool | isMemoryOp (Instruction instr) noexcept |
| Returns true if the instruction involves memory access (ReadMemory, WriteMemory). | |
| constexpr bool | isHalt (Instruction instr) noexcept |
| Returns true if the instruction terminates execution flow (Halt, Interrupt with Exit). | |
| constexpr std::string_view | registerName (Register reg) noexcept |
| Returns the human-readable name of a register (e.g., "R0", "PC", "SP"). | |
| constexpr std::string_view | errorCodeToString (ErrorCode code) noexcept |
| Returns a human-readable name for the given error code. | |
| constexpr OpenMode | operator| (OpenMode lhs, OpenMode rhs) noexcept |
| Returns bitwise OR combination of open-mode flags. | |
| constexpr OpenMode | operator& (OpenMode lhs, OpenMode rhs) noexcept |
| Returns bitwise AND combination of open-mode flags. | |
| constexpr bool | hasOpenMode (OpenMode value, OpenMode flag) noexcept |
| Returns whether the provided mode set contains a flag. | |
| constexpr std::string_view | priorityLevelName (PriorityLevel level) noexcept |
| Returns a human-readable name for the given priority level. | |
| constexpr bool | isValidTransition (ProcessState from, ProcessState to) noexcept |
| Validates whether a transition from one process state to another is legal. | |
| constexpr std::string_view | processStateName (ProcessState state) noexcept |
| Returns a human-readable name for the given process state. | |
Variables | |
| constexpr std::uint8_t | INSTRUCTION_COUNT = 25 |
| Total number of defined instructions. | |
| constexpr ProcessId | INVALID_PID = 0 |
| Sentinel value indicating an invalid/unassigned process ID. | |
| constexpr MemoryAddress | NULL_ADDRESS = 0xFFFFFFFF |
| Sentinel value indicating an invalid/null memory address. | |
| constexpr FrameId | INVALID_FRAME = 0xFFFFFFFF |
| Sentinel value indicating an invalid frame. | |
| constexpr InodeId | INVALID_INODE_ID = 0 |
| Sentinel value indicating an invalid inode identifier. | |
| constexpr std::uint8_t | REGISTER_COUNT = 16 |
| Maximum number of CPU registers. | |
| constexpr Tick | DEFAULT_TIME_SLICE = 4 |
| Default time slice for Round Robin scheduling (in ticks). | |
| constexpr ProcessId | MAX_PROCESSES = 1024 |
| Maximum number of processes the kernel can manage. | |
| constexpr std::int32_t | NICE_MIN = -20 |
| Minimum nice value (highest boost). | |
| constexpr std::int32_t | NICE_MAX = 19 |
| Maximum nice value (lowest boost). | |
| constexpr std::int32_t | NICE_DEFAULT = 0 |
| Default nice value (no adjustment). | |
| using contur::DeviceId = std::uint16_t |
| using contur::FrameId = std::uint32_t |
| using contur::InodeId = std::uint32_t |
| using contur::MemoryAddress = std::uint32_t |
| using contur::ProcessId = std::uint32_t |
| using contur::RegisterValue = std::int32_t |
| using contur::ResourceId = std::uint32_t |
| using contur::SubscriptionId = std::uint64_t |
| using contur::SyscallHandlerFn |
Function signature used for syscall registration.
Definition at line 71 of file i_kernel.h.
| using contur::Tick = std::uint64_t |
|
strong |
Error codes returned by kernel subsystem operations.
|
strong |
|
strong |
CPU instruction opcodes for the simulated architecture.
Each instruction is a single byte, decoded by the CPU during the fetch-decode-execute cycle. The interpreter engine steps through these one at a time.
Definition at line 15 of file instruction.h.
|
strong |
Interrupt codes used by the CPU and kernel.
Positive values represent hardware/timer interrupts. Negative values indicate error conditions. The CPU generates these during execution; the dispatcher and kernel handle them to drive process state transitions.
Definition at line 16 of file interrupt.h.
|
strong |
Open mode bit flags.
| Enumerator | |
|---|---|
| None | |
| Read | |
| Write | |
| Create | |
| Truncate | |
| Append | |
Definition at line 39 of file file_descriptor.h.
|
strong |
Discrete priority levels, from highest (Realtime) to lowest (Idle).
Numerically lower values represent higher priority. This ordering allows natural comparison: Realtime < High < Normal < Low < Idle.
Definition at line 19 of file priority.h.
|
strong |
All possible states in a process lifecycle.
|
strong |
CPU register identifiers.
14 general-purpose registers (R0–R13) plus two special-purpose:
| Enumerator | |
|---|---|
| R0 | |
| R1 | |
| R2 | |
| R3 | |
| R4 | |
| R5 | |
| R6 | |
| R7 | |
| R8 | |
| R9 | |
| R10 | |
| R11 | |
| R12 | |
| R13 | |
| ProgramCounter | |
| StackPointer | |
Definition at line 25 of file register_file.h.
|
strong |
Reason why the execution engine returned control to the dispatcher.
| Enumerator | |
|---|---|
| BudgetExhausted | Tick budget ran out (preemption / time slice expired). |
| ProcessExited | Process executed Halt or Int Exit — normal termination. |
| Error | An unrecoverable error occurred (invalid instruction, segfault, etc.). |
| Interrupted | A software/hardware interrupt requires kernel attention (syscall, I/O, page fault). |
| Halted | Process was forcibly halted via halt(). |
Definition at line 19 of file execution_context.h.
|
strong |
Numeric identifiers for system calls.
Definition at line 11 of file syscall_ids.h.
|
nodiscardconstexprnoexcept |
Returns whether the provided mode set contains a flag.
| value | Composite open mode. |
| flag | Single flag to test. |
Definition at line 65 of file file_descriptor.h.
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
Validates whether a transition from one process state to another is legal.
Legal transitions:
| from | Current state. |
| to | Target state. |
Returns bitwise AND combination of open-mode flags.
Definition at line 56 of file file_descriptor.h.
Returns bitwise OR combination of open-mode flags.
Definition at line 50 of file file_descriptor.h.
|
nodiscardconstexprnoexcept |
Returns a human-readable name for the given priority level.
Definition at line 108 of file priority.h.
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
Returns the human-readable name of a register (e.g., "R0", "PC", "SP").
Definition at line 111 of file register_file.h.
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
Default nice value (no adjustment).
Definition at line 37 of file priority.h.
|
constexpr |
Maximum nice value (lowest boost).
Definition at line 34 of file priority.h.
|
constexpr |
Minimum nice value (highest boost).
Definition at line 31 of file priority.h.
|
constexpr |