36 std::unique_ptr<IMMU>
mmu;
42 std::unique_ptr<ICPU>
cpu;
80 [[nodiscard]]
Result<
void>
tick(std::
size_t tickBudget = 0) override;
81 [[nodiscard]]
Result<
void>
runForTicks(std::
size_t cycles, std::
size_t tickBudget = 0) override;
90 [[nodiscard]]
Tick now() const noexcept override;
Abstract clock interface for simulation time.
Interface for process lifecycle dispatch orchestration.
Abstract execution engine interface.
Abstract file-system interface.
Abstract interface for the Memory Management Unit.
Abstract interface for linear addressable memory.
Scheduler abstraction managing process state queues.
Strategy interface for scheduling algorithms.
Common interface for synchronization primitives.
Abstract interface for virtual memory management.
Registry/mediator for named IPC channels.
Result< void > tick(std::size_t tickBudget=0) override
Executes one dispatch cycle.
Result< RegisterValue > syscall(ProcessId pid, SyscallId id, std::span< const RegisterValue > args) override
Dispatches a syscall on behalf of a process.
std::unique_ptr< Impl > impl_
Tick now() const noexcept override
Returns current simulation time.
Result< void > terminateProcess(ProcessId pid) override
Terminates a process immediately.
Result< void > enterCritical(ProcessId pid, std::string_view primitiveName) override
Acquires a named synchronization primitive.
Kernel(Kernel &&) noexcept
Result< void > registerSyscallHandler(SyscallId id, SyscallHandlerFn handler) override
Registers or replaces syscall handler.
Result< void > runForTicks(std::size_t cycles, std::size_t tickBudget=0) override
Executes multiple dispatch cycles.
Result< void > leaveCritical(ProcessId pid, std::string_view primitiveName) override
Releases a named synchronization primitive.
Result< void > registerSyncPrimitive(const std::string &name, std::unique_ptr< ISyncPrimitive > primitive) override
Registers a named synchronization primitive.
Kernel(KernelDependencies deps)
Result< ProcessId > createProcess(const ProcessConfig &config) override
Creates and admits a process.
KernelSnapshot snapshot() const override
Returns a snapshot of current kernel state.
bool hasProcess(ProcessId pid) const noexcept override
Returns true when process exists in dispatcher.
Kernel(const Kernel &)=delete
std::size_t processCount() const noexcept override
Returns total managed process count.
Kernel & operator=(const Kernel &)=delete
A result type that holds either a success value of type T or an ErrorCode.
Dispatch table mapping SyscallId to handler functions.
IKernel facade interface for top-level kernel operations.
std::function< Result< RegisterValue >(std::span< const RegisterValue > args, ProcessImage &caller)> SyscallHandlerFn
Function signature used for syscall registration.
constexpr Tick DEFAULT_TIME_SLICE
Default time slice for Round Robin scheduling (in ticks).
std::uint64_t Tick
Simulation clock tick counter.
std::uint32_t ProcessId
Unique identifier for a process.
SyscallId
Numeric identifiers for system calls.
std::int32_t RegisterValue
Value stored in a CPU register.
Dependency bundle used to construct a Kernel.
std::unique_ptr< ICPU > cpu
CPU implementation used by execution engines.
std::unique_ptr< IMemory > memory
Physical memory backend.
std::unique_ptr< IpcManager > ipcManager
IPC manager service.
std::unique_ptr< IClock > clock
Simulation clock implementation.
std::unique_ptr< IExecutionEngine > executionEngine
Execution engine (interpreter or native).
std::unique_ptr< IDispatcher > dispatcher
Dispatcher orchestrating process lifecycle.
std::unique_ptr< SyscallTable > syscallTable
Syscall dispatch table.
std::unique_ptr< IMMU > mmu
Memory management unit implementation.
std::size_t defaultTickBudget
Default per-dispatch tick budget used when caller passes 0.
std::unique_ptr< IScheduler > scheduler
Scheduler implementation.
std::unique_ptr< IFileSystem > fileSystem
File system service.
std::unique_ptr< IVirtualMemory > virtualMemory
Virtual memory manager.
Lightweight kernel state snapshot for UI and diagnostics.
Configuration payload used to create a process.