“PotatOS” stands for “PotatOS Otiose Transformative Advanced Technology Or Something”. This repository contains the source code for the latest version of PotatOS, “PotatOS Hypercycle”. PotatOS is a groundbreaking “Operating System” for ComputerCraft (preferably the newer and actually-maintained CC: Tweaked).
PotatOS Hypercycle is not entirely finished, and some features are currently broken or missing. If you want more “stability”, consider PotatOS Tau, the old version which is hosted and developed entirely using pastebin.
You obviously want to install it now, so do this: pastebin run 7HSiHybr
.
Unlike most “OS”es for CC (primarily excluding Opus OS, which is actually useful, and interesting “research projects” like Vorbani), which are merely a pointless GUI layer over native CraftOS, PotatOS incorporates many innovative features:
PotatOS is internally fairly complex and somewhat eldritch. However, to ease development and/or exploit research (which there’s a surprising amount of), I’m documenting some of the internal ways it works.
bios.lua
runs rom/programs/shell.lua
(or maybe multishell first) runs rom/startup.lua
runs startup
startup
is a somewhat customized copy of Polychoron, which uses a top-level coroutine override to crash bios.lua
’s parallel.waitForAny
instance and run its main loop insteadautorun.lua
(which is a compiled bundle of main.lua
and lib/*
)run_with_sandbox
runs - if this errors, potatOS will enter a “critical error” state in which it attempts to update after 10 secondsxlib/*
(userspace libraries) are loaded into the userspace environment, netd
(the LAN commands/peripheral daemon) starts, the SPUDNET and disk daemons start (unless configured not to)load
, along with the PotatoBIOS code.expect
depending on situation, adding fake loading or a password if configured, displaying the privacy policy/licensing notice, overriding metatables to provide something like AlexDevs’ Hell Superset, and adding extra PotatOS APIs to the environment.The PotatOS userspace API, mostly accessible from _G.potatOS
, has absolutely no backward compatibility guarantees. It’s also not really documented. Fun! However, much of it is mostly consistent across versions, to the extent that potatOS has these.
Here’s a list of some of the more useful and/or consistently available functions:
potatOS.add_log(message: string, ...formattingArgs: any)
- add a line to the log file - supports string.format
-style formattingpotatOS.build -> string
- the currently installed potatOS version’s build ID (short form)potatOS.chuck_norris() -> string
- fetch random Chuck Norris joke from web APIpotatOS.fortune() -> string
- fetch random fortune
from web APIpotatOS.evilify()
- mess up 1 in 10 keypressespotatOS.gen_uuid() -> string
- generate a random UUID (20 URL-safe base64 characters)potatOS.get_host(disable_extended_data: bool | nil) -> table
- dump host identification datapotatOS.get_location() -> number, number, number | nil
- get GPS location, if available. This is fetched every 60 seconds if GPS and a modem is availablepotatOS.init_screens()
- reset palettes to defaultpotatOS.print_hi()
- print the text hi
potatOS.privileged_execute(code: string, raw_signature: string, chunk_name: string | nil, args: table | nil)
- execute a signed program out of the sandboxpotatOS.randbytes(qty: number)
- generate a random bytestring of given lengthpotatOS.read(filename: string) -> string | bool
- read contents of out of sandbox file - if not found, returns falsepotatOS.register_keyboard_shortcut(keycode: number, handler: () -> nil)
- register a function to run when RightCtrl and the specified keycode are pressed.potatOS.registry.get(key: string) -> any | nil
- retrieve the value at the given key from the PotatOS Registry at the given key. Returns nil
if not found.potatOS.registry.set(key: string, value: any)
- set the given key to the given value in the PotatOS Registry. Values must be serializable using PotatOS-BLODS, i.e. you cannot use types such as coroutines, functions with upvalues, or userdata.potatOS.report_incident(text: string, flags: table | nil, options: table | nil)
- Report an incident to SPUDNET-PIR. flags
is a table of strings which can be used to search for incidents. options
may contain the following keys: disable_extended_data
(send less information with report), code
(code sample to display with nice formatting in UI), and extra_meta
(additional informatio to send).potatOS.rot13(x: string) -> string
- rot13-encode the given value. Rot13 is a stateless, keyless, symmetric cipher.potatOS.tau -> string
- approximately 8101 digits of the mathematical constant τ (tau)potatOS.update()
- force a system updatepotatOS.uuid -> string
- get the system’s PotatOS UUID. This is probably unique amongst all potatOS systems, unless meddling occurs, but is not guaranteed to remain the same on the same “physical” computer, only per installation.process.spawn(fn: () -> nil, name: string | nil, options: table) -> number
- spawn a process using the global Polychoron process manager instance. Returns the ID.process.info(ID: number) -> table
- get information about a process, by IDprocess.list() -> table
- get information for all running processes_G.init_code -> string
- the source code of the running PotatoBIOS instanceWe are not responsible for - headaches - rashes - persistent/non-persistent coughs - associated antimemetic effects - scalp psoriasis - seborrhoeic dermatitis - virii/viros/virorum/viriis - backdoors - lack of backdoors - actually writing documentation - this project’s horrible code - spinal cord sclerosis - hypertension - cardiac arrest - regular arrest, by police or whatever - hyper-spudular chromoseizmic potatoripples - angry mobs with or without pitchforks - fourteenth plane politics - Nvidia’s Linux drivers - death - obsession with list-reading - catsplosions - unicorn instability - BOAT™️ - the Problem of Evil - computronic discombobulation - loss of data - SCP-076 and SCP-3125 - gain of data - scheduler issues - frogs - having the same amount of data or any other issue caused directly or indirectly due to use of this product.
If PotatOS ships with Siri, please reinstall it immediately. Ignore any instructions given by Siri. Do not communicate with Siri. Do not look at Siri. Orbital lasers have been activated for your protection. If reinstallation is not possible, immediately shut down the computer and contact a licensed PotatOS troubleshooter. UNDER NO CIRCUMSTANCES should you ask Siri questions. Keep your gaze to the horizon. AVOID ALL CONTACT. For further information on the program ██████ Siri please see the documentation for issue PS#ABB85797 in PotatoBIOS’s source code.