space-sim#
SpaceOS flight simulator for two-partition demo.
space-sim is a minimal init process (PID 1) for the flight partition (P0)
in a SpaceOS two-partition VM setup. It mounts essential filesystems, opens
a virtio-serial IPC port, and streams continuous telemetry frames to the
SpaceOS partition. The simulator propagates ISS orbital position using SGP4
and generates a realistic mix of telemetry (TM), health (HEALTH), and event
(EVR) frames at approximately 1 Hz.
When run outside a VM (not as PID 1), it prints a description of what it would do in a real environment.
Installation#
opam install space-sim
Usage#
The binary is designed to run as PID 1 inside a guest VM booted by
space run. It is not typically invoked directly.
Inside the VM, it:
- Mounts
/proc,/sys,/devviaPid1.setup_filesystems - Waits for the
/dev/virtio-ports/ipcdevice (5-second timeout) - Propagates the ISS orbit using an embedded TLE and SGP4
- Streams a continuous mix of frames over the IPC port:
TM(APID 0x101): orbital position (lat, lon, alt, velocity)TM(APID 0x100, 0x102, 0x103): heartbeat, sensor readings, statusHEALTH(APID 0x100): CPU, memory, uptimeEVR(APID 0x200): system events (orbit updates, command acks, watchdog)
API#
This package is a standalone binary with no public library. It depends on:
space-wire-- frame encoding viaSpace_wire.Msgzephyr-- virtio-serial port I/Opid1-- PID 1 filesystem setup and signal handlingsgp4(viazephyr) -- SGP4 orbit propagation