Symphony is not just an emulator. It is a complete ecosystem for exploring, building, and introspecting computing systems.
Born from a frustration with "black box" emulator designs and opaque backend services, Symphony is a highly modular, open-source framework written purely in Go. It allows you to build complex software and hardware architectures that are transparent, inspectable, and manipulable in real-time by design.
Symphony is built upon three distinct but perfectly integrated architectural pillars:
At its core, Symphony is a simulated microkernel operating system. It features an asynchronous message router that manages isolated user-space processes. It comes with a built-in SSH server, a VT100 retained-mode window manager, and a virtual filesystem. You can SSH into the running kernel and perform "open-heart surgery" on running processes without stopping the system.
Symphony includes a multi-pass compiler that translates a comprehensive subset of the Go language into a custom intermediate bytecode. This bytecode is executed by a microkernel-style Virtual Machine.
Compiler Specifications:
- Language Support: Compiles a massive subset of Go, including structs, methods, anonymous functions (closures),
defer, interfaces, dynamic type assertions, slices, and maps. - Concurrency: Full parsing for Go-like concurrency with
go func(), channels (make(chan)), and asynchronous<-operations. - Memory Layout: Built-in calculation of memory offsets and fixed sizes for interfaces and dynamic types, closely mirroring Go's internal
ifaceimplementation.
VM Specifications:
- Cooperative Scheduler: Implements a lock-free, cooperative scheduler for goroutines and channels. It handles blocking via IP manipulation rather than blocking OS-level threads.
- Near Zero Branch (NZB) Pattern: Instruction dispatch is handled via a function pointer array, entirely eliminating the branch prediction penalties.
- Interchangeable ISA: The VM can seamlessly transition from executing high-level Go scripts to acting as a cycle-accurate Z80 or MOS6510 CPU emulator, simply by swapping the instruction set module.
Hardware is not simulated via high-level traps or software hacks. Symphony models hardware topologically—like a software breadboard. Components (like the VIC-II, SID, PLA, and CPU) are isolated "black boxes" that communicate exclusively through standardized ISocket interfaces via electrical signals (e.g., pulling the DMA line low to trigger High-Z states on the bus).
Currently, Symphony implements a full Commodore 64 and an independent 1541 Floppy Drive (which runs as a completely separate parallel computer over a simulated IEC serial bus).
graph TD
Client[SSH Client / Terminal] <-->|SSH / VT100| Kernel[Symphony Microkernel]
subgraph Symphony OS
Kernel -->|Asynchronous Messages| VFS[Virtual File System]
Kernel -->|Process Isolation| Shell[xshell VT100]
Kernel -->|Spawns| VM[Universal Virtual Machine]
end
subgraph VM Execution Engine
VM -->|Bytecode| Sequencer[Sequencer / Dispatcher]
Sequencer -->|Execute / Compile| GoApp[Go Script Process]
Sequencer -->|Interchangeable ISA| Z80[Z80 Emulator Core]
end
graph TD
Board[c64_board_rev1] --> CPU[CPUSocket]
Board --> VIC[VICSocket]
Board --> SID[SIDSocket]
Board --> PLA[PLASocket]
Board --> CIA1[CIA1Socket]
CPU -.->|AEC, RDY, BA Pins| PLA
VIC -.->|DMA Request| CPU
PLA -.->|Memory Mapping| Board
- Live Introspection (WYSIWYG): Connect via SSH to the running kernel and inspect or modify the state of any component (CPU registers, variables, audio channels) at runtime using the
xshell. - Snapshot = State + Configuration: A single snapshot defines the entire hardware topology and its exact runtime state. Build, save, load, and share complex machine setups easily.
- Cycle-Accurate Timing: Hardware components (like the VIC-II and SID) respect the strict physical timing constraints of the original silicon.
- 100% Pure Go: No CGo dependencies, ensuring memory safety, immediate cross-compilation, and high portability.
- Headless by Default: Designed to run cleanly on servers without requiring a GPU or Audio interface, making it perfect for automated testing and CI/CD.
Symphony requires Go 1.21+ to build.
Clone the repository and build the binary:
git clone https://github.com/markel1974/symphony.git
cd symphony
go build -o symphony main.goRun a cartridge-based configuration:
./symphony -c [path/to/cartridge]Run the default Commodore 64 configuration with an OpenGL renderer:
./symphony -r gl -m c64Run in completely headless mode (perfect for SSH exploration):
./symphony -r none -a none -m c64(Note: SSH credentials and port configuration are managed via the OS configuration files. Check the src/kernel documentation for connection details).
🚀 Try Symphony Live in Your Browser! 🚀 https://markel1974.itch.io/symphony