Expand description
Inter-Process Communication (IPC) subsystem.
See also: IPC Mechanisms Guide for architecture diagrams and usage patterns.
Strat9-OS uses two complementary IPC mechanisms:
§1. IPC Ports (synchronous message-passing, service endpoints)
Each port has a bounded FIFO queue of 64-byte IpcMessages.
Senders block when the queue is full; receivers block when empty.
Ports are owned by a single task and accessed via syscalls:
SYS_IPC_CREATE_PORT(200) : create a new portSYS_IPC_SEND(201) : send a message to a portSYS_IPC_RECV(202) : receive a message from a portSYS_IPC_CALL(203) : send and wait for replySYS_IPC_REPLY(204) : reply to an IPC callSYS_IPC_BIND_PORT(205) : bind a port to the namespaceSYS_IPC_UNBIND_PORT(206) : unbind a port
§2. Typed MPMC sync-channels (IPC-02)
channel::channel<T>(capacity) creates a typed
Multi-Producer/Multi-Consumer channel for kernel-internal use.
channel::SyncChan provides a symmetric IpcMessage channel
exposed to userspace silos via:
SYS_CHAN_CREATE(220) : create a channelSYS_CHAN_SEND(221) : send (blocking)SYS_CHAN_RECV(222) : receive (blocking)SYS_CHAN_TRY_RECV(223) : receive (non-blocking)SYS_CHAN_CLOSE(224) : destroy the channel
§3. Transport layer (N1/N2/N3)
The transport module provides a unified trait-based IPC transport
layer with three levels of isolation (TypeSafe, LockFree, MMU).
lockfree_ring implements the N2 SPSC ring buffer.
mailbox implements the N1 intrusive mailbox.
Re-exports§
pub use channel::channel;pub use channel::create_channel;pub use channel::destroy_channel;pub use channel::get_channel;pub use channel::ChanId;pub use channel::ChannelError;pub use channel::Receiver;pub use channel::Sender;pub use channel::SyncChan;pub use lifecycle::MultiHandleDestroyError;pub use lifecycle::MultiHandleResource;pub use lockfree_ring::LockFreeRing;pub use mailbox::IntrusiveMailbox;pub use n3::allocate_pcid;pub use n3::pcid_available;pub use n3::MigrationFrame;pub use n3::MigrationState;pub use n3::N3MinimalContext;pub use n3::N3Tier;pub use n3::N3Transport;pub use n3::N3_SHARED_FRAME_VA;pub use port::create_port;pub use port::destroy_port;pub use port::get_port;pub use port::IpcError;pub use port::Port;pub use port::PortId;pub use quota::IpcQuota;pub use quota::QuotaExceeded;pub use semaphore::create_semaphore;pub use semaphore::destroy_semaphore;pub use semaphore::get_semaphore;pub use semaphore::PosixSemaphore;pub use semaphore::SemId;pub use semaphore::SemaphoreError;pub use shared_ring::create_ring;pub use shared_ring::destroy_ring;pub use shared_ring::get_ring;pub use shared_ring::RingError;pub use shared_ring::RingId;pub use transport::IpcConsumer;pub use transport::IpcNotification;pub use transport::IpcProducer;pub use transport::IpcTransport;pub use transport::TransportCapabilities;pub use transport::TransportConfig;pub use transport::TransportCreateResult;pub use transport::TransportEndpoint;pub use transport::TransportId;pub use transport::TransportLevel;pub use transport::TransportManager;
Modules§
- channel
- Typed MPMC blocking channel for IPC between kernel tasks and silos.
- lifecycle
- lockfree_
ring - Lock-free bounded message queue backed by [
crossbeam_queue::ArrayQueue]. - mailbox
- N1 IntrusiveMailbox : lock-free LIFO mailbox for kernel-internal IPC.
- message
- n1
- N1 Type-Safe IPC : annotation macro and kernel-internal wiring.
- n3
- N3 MMU Thread Migration : PCID-preserving (N3b) and Full Isolation (N3c).
- port
- IPC Port : a kernel-managed message queue with blocking send/recv.
- quota
- Per-process IPC resource quotas.
- reply
- IPC call/reply support : both synchronous (blocking) and async (ring-based).
- semaphore
- shared_
ring - test
- IPC ping-pong test (Port-based) + MPMC SyncChannel test (IPC-02).
- transport
- IPC transport layer: traits, dispatch enum, and manager.
Structs§
- IpcMessage
- Fixed-size IPC message (256 bytes, 64-byte aligned).