Skip to main content

Module ipc

Module ipc 

Source
Expand description

Inter-Process Communication (IPC) subsystem.

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 port
  • SYS_IPC_SEND (201) — send a message to a port
  • SYS_IPC_RECV (202) — receive a message from a port
  • SYS_IPC_CALL (203) — send and wait for reply
  • SYS_IPC_REPLY (204) — reply to an IPC call
  • SYS_IPC_BIND_PORT (205) — bind a port to the namespace
  • SYS_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 channel
  • SYS_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

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 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 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 shared_ring::SharedRing;

Modules§

channel
Typed MPMC blocking channel for IPC between kernel tasks and silos.
message
port
IPC Port — a kernel-managed message queue with blocking send/recv.
reply
IPC synchronous call/reply support.
semaphore
shared_ring
test
IPC ping-pong test (Port-based) + MPMC SyncChannel test (IPC-02).

Structs§

IpcMessage