πŸ’½ 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 IBootTarget interface.
  • 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.

  1. BIOS/Computer sends boot signal
    β†’ OperatingSystemHost.Initialize()
  2. Core PowerOn()
    β†’ Prepares subsystems, logs startup messages.
  3. DesktopEnvironment created and initialized
    β†’ Loads AppSystem, UIWindowSystem, UIFloatingPanelSystem.
  4. Transition to active desktop mode
    β†’ Enables user input and opens the Taskbar.

On shutdown, this reverses:

  1. Shutdown initiated (by Power button or BIOS event)
  2. AppSystem terminates all processes
  3. DesktopEnvironment fades out and destroys root instance
  4. 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


πŸ”— See Also