40 std::unique_ptr<IMMU>
mmu;
46 std::unique_ptr<ICPU>
cpu;
77 std::unique_ptr<IDispatchRuntime>
runtime;
112 [[nodiscard]]
Result<
void>
tick(std::
size_t tickBudget = 0) override;
115 [[nodiscard]]
Result<
void>
runForTicks(std::
size_t cycles, std::
size_t tickBudget = 0) override;
125 [[nodiscard]]
Result<
void>
138 [[nodiscard]]
Tick now() const noexcept override;
Registry and dispatcher for I/O devices.
Abstract clock interface for simulation time.
Strategy interface that executes dispatch/tick across dispatcher lanes.
Interface for process lifecycle dispatch orchestration.
Abstract execution engine interface.
Abstract file-system interface.
Kernel I/O manager 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.
Tracer interface used by kernel subsystems.
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
Move-constructs kernel facade.
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)
Constructs kernel facade from fully prepared dependencies.
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
Copy construction is disabled.
std::size_t processCount() const noexcept override
Returns total managed process count.
~Kernel() override
Destroys kernel facade and owned subsystem graph.
Kernel & operator=(const Kernel &)=delete
Copy assignment is disabled.
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< IDispatchRuntime > runtime
Optional dispatch runtime whose lifetime is managed by the kernel.
std::unique_ptr< DeviceManager > deviceManager
Device registry service.
std::unique_ptr< IIoManager > ioManager
Unified I/O manager service.
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::unique_ptr< ITracer > tracer
Tracer used for kernel-level event instrumentation.
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.