π½ OperatingSystem
A simulated software core responsible for managing the an in-game Computer's boot, runtime, and shutdown sequences.
The OperatingSystem represents the logical layer beneath the DesktopEnvironment.
It coordinates the initialization of critical systems β such as the AppSystem, UIWindowSystem, and ConsoleSystem and ensures a stable lifecycle similar to a real-world OS kernel.
β¨ Features
- Handles complete boot β runtime β shutdown lifecycle.
- Communicates with the BIOS or hardware layer through an
IBootTargetinterface. - Initializes and tears down the DesktopEnvironment cleanly.
- Manages power state through
PowerOn()/PowerOff()logic. - Supports simulated boot text sequence (like DOS or Linux-style startup logs).
- Integrates with Computers to mimic a full bootable machine.
- Exposes hooks for custom startup scripts or splash sequences.
π§© Architecture Overview
The OperatingSystem sits between the hardware (Computer/BIOS) and user environment (DesktopEnvironment).
Itβs the central coordinator that ensures every subsystem comes online in the right order.
π½ CosterGraphics.Systems.OperatingSystem
β
βββ βοΈ OperatingSystemCore β Handles boot, runtime, and shutdown logic
β βββ Initializes DesktopEnvironment and AppSystem
β βββ Registers itself as IBootTarget for BIOS communication
β βββ Calls PowerOn() and PowerOff() methods to control state
β
βββ π§ OperatingSystemHost β MonoBehaviour wrapper to instantiate and manage the Core
β βββ Exists as a scene-level entry point
β βββ Handles Unity lifecycle and persistence
β
βββ π₯οΈ DesktopEnvironment β User-facing shell spawned and managed by OSCore
π Boot Lifecycle
The OperatingSystemCore controls a structured boot sequence designed to feel like a real OS startup.
- BIOS/Computer sends boot signal
βOperatingSystemHost.Initialize() - Core PowerOn()
β Prepares subsystems, logs startup messages. - DesktopEnvironment created and initialized
β Loads AppSystem, UIWindowSystem, UIFloatingPanelSystem. - Transition to active desktop mode
β Enables user input and opens the Taskbar.
On shutdown, this reverses:
- Shutdown initiated (by Power button or BIOS event)
- AppSystem terminates all processes
- DesktopEnvironment fades out and destroys root instance
- OSCore signals Computer: power-down complete
π§ Key Responsibilities
| Responsibility | Description |
|---|---|
| Boot Management | Handles BIOS signals and initialization order. |
| Subsystem Initialization | Creates and configures AppSystemHost, UIWindowSystemHost, ConsoleSystemHost, etc. |
| Power State Control | Responds to hardware events (e.g., power button press) through BIOS interface. |
| Graceful Shutdown | Calls IAppShutdownable.Shutdown() on all managed components and clears active processes. |
| User Shell Activation | Spawns the DesktopEnvironment as the visible interface. |
π‘ Inter-System Communication
| Partner | Purpose |
|---|---|
| 𧬠Computers | Sends boot and shutdown signals to the OS. |
| π§© BIOS | Provides the IBootTarget interface for OS handshaking. |
| π¬ ConsoleSystem | Displays boot logs and diagnostic messages. |
| π§ AppSystem | Handles runtime process and app management. |
| πͺ DesktopEnvironment | The graphical shell managed by the OS. |
π¦ Namespace
CosterGraphics.Systems.OperatingSystem