tos library / TrashOS Reborn

TrashOS Reborn

TrashOS Reborn is a Python-based pseudo-operating-system that runs as a single script (boot.py) on top of a real host OS. It boots into an interactive shell, manages users, and runs apps from the tosapps/ directory. The tos library is the public API those apps use.

Version

  • TrashOS Reborn 1.1.0
  • Bootloader: TrashLoader 1.0.2
  • Security patch: SUBPRCSPTCH

Boot sequence

  1. POST.
  2. Detect CPU/GPU via wmic (falls back to generic strings off-Windows).
  3. Load the kernel image trosreb.bin into RAMDISK.
  4. Load CPU, GPU, fan-control drivers.
  5. Load bash.
  6. Prompt for username/password.

Built-in shell commands

CommandDescription
helpList all commands.
rootEnter root shell (password: root).
verPrint TrashOS version info.
browserOpen the system web browser at google.com.
calcLaunch calculator.py.
hostosPrint the underlying host OS.
echoEcho a line of text.
appsList apps installed in tosapps/.
usrmgrUser manager (add, change credentials).
ls / mkdir / rmdir / rm / touchBasic filesystem ops. Most are guarded for non-root users.
changelogPrint recent changes.
logoutReturn to the login prompt.
shutdownPower off (exits the Python process).

App resolution

Any unknown command is treated as an app name. The shell looks up tosapps/<name>.py and runs it with the current Python interpreter:

subprocess.run([sys.executable, app_exec])

If no file matches, difflib.get_close_matches is used to suggest the closest existing command.

Users

Accounts are stored in users.json. The defaults shipped with the system are root (password root), trash, and sys.

Warning: Passwords are stored in plain text. Treat users.json as sensitive.

Relationship to tos

Apps under tosapps/ are expected to import tos for filesystem layout (tos.appdata) and to honour root mode via tos.is_root(). The shell is expected to export TOS_ROOT_ACTIVE=TRUE when a root shell is active.