How vscode-player/phseos works
Phse OS is a Python-based pseudo-OS that models hardware state in JSON files and runs PhseX programs from its simulated disk. The main workflow initializes configured RAM and CPU state, then executes the disk shell: PhseX parses instructions, loads libraries, and dispatches operations that manipulate simulated state or produce output. The README documents configuration and initialization; sampled sources show arithmetic, data operations, file I/O, process requests, and output. Some referenced runtime helpers are absent from the tree, so their internal wiring is not expanded.
Main entry points: phsex.py PhseX interpreter · init.py State initializer · data_op.py Data operations · output_op.py Output operations
Components 22
Boot and configuration
- OS configuration
build.json - State initializer
init.py - OS launcher
os_start.py
PhseX runtime
- System shell
hardware/DISK/system/shell.phx - PhseX interpreter
phsex.py
Simulated hardware and disk
- RAM state
hardware/RAM/memory.json - RAM allocation state
hardware/RAM/status.json - CPU registers
hardware/CPU/register.json - Register status
hardware/CPU/status.json - CPU flags
hardware/CPU/F.json - Simulated disk
hardware/DISK - Character encoding
hardware/DISK/system/CharSet/PhseEncode.json
Instruction libraries
- Standard I/O package
hardware/DISK/system/phsex/library/stdio/package.py - Data operations
hardware/DISK/system/phsex/library/stdio/data_op.py - Math operations
hardware/DISK/system/phsex/library/stdio/math_op.py - Output operations
hardware/DISK/system/phsex/library/stdio/output_op.py - File I/O package
hardware/DISK/system/phsex/library/FileIO/package.py - File operations
hardware/DISK/system/phsex/library/FileIO/file_op.py - Process package
hardware/DISK/system/phsex/library/Process/package.py - Process requests
hardware/DISK/system/phsex/library/Process/request.py
Other components
- User
- Console
Connections 38
- User → OS launcher: starts
- OS launcher → State initializer: initializes
- State initializer → OS configuration: reads
- State initializer → RAM state: initializes
- State initializer → RAM allocation state: initializes
- State initializer → CPU registers: initializes
- State initializer → Register status: initializes
- State initializer → CPU flags: initializes
- OS launcher → PhseX interpreter: runs
- OS launcher → OS configuration: reads
- PhseX interpreter → System shell: reads
- PhseX interpreter → OS configuration: reads
- PhseX interpreter → Standard I/O package: loads on demand
- PhseX interpreter → File I/O package: loads on demand
- PhseX interpreter → Process package: loads on demand
- Standard I/O package → Data operations: exports
- Standard I/O package → Math operations: exports
- Standard I/O package → Output operations: exports
- File I/O package → File operations: exports
- Process package → Process requests: exports
- PhseX interpreter → Data operations: dispatches
- PhseX interpreter → Math operations: dispatches
- PhseX interpreter → Output operations: dispatches
- PhseX interpreter → File operations: dispatches
- PhseX interpreter → Process requests: dispatches
- Data operations → RAM state: reads and writes
- Data operations → CPU registers: reads and writes
- Data operations → RAM allocation state: checks allocation
- Data operations → Register status: checks allocation
- Data operations → CPU flags: reads and writes
- Math operations → RAM state: reads and writes
- Math operations → CPU registers: reads and writes
- Output operations → RAM state: reads
- Output operations → CPU registers: reads
- Output operations → Character encoding: loads encoding
- Output operations → Console: prints
- File operations → Simulated disk: reads and writes
- Process requests → PhseX interpreter: updates process state