Bedrock
Bedrock is a computer architecture designed for running compact graphical programs on resource-constrained systems.
Bedrock comprises a stack-based CPU architecture, a minimal Forth-like assembly language, and a set of interfaces for communicating with common peripheral devices. Bedrock is designed such that a single programmer can create an implementation for any computer system with minimal effort, after which any Bedrock program ever written can be used on that system.
Background
Bedrock originated as a fork of the Uxn virtual machine and Varvara computing stack, with the aim of creating a system which has greater performance on extremely resource-constrained host systems.
The core goal of Bedrock is to find an optimal point between being fast, being resource efficient, being enjoyable to use, and being straightforward to implement. Bedrock should enable any PDA, salvaged microcontroller, or 30-year-old games console to be usable as a first-class workstation for application users and developers, with the usability of a device limited only by the ergonomics of its physical interface.
The name Bedrock comes from the concept of a ‘bedrock abstraction’ coined by this blog post (mirrored), though it admittedly takes a different approach to the one for which the post advocates. Bedrock achieves habitability not by producing a higher-level instruction set, but by reducing the complexity of the program environment.
Architecture specification
This specification describes the core Bedrock architecture.
Section | Description | Done |
---|---|---|
Processor | Evaluates program bytecode. | ✓ |
Program memory | Contains the current program. | ✓ |
Stacks | Contains temporary program state. | ✓ |
Device bus | Provides communication with devices. | ✓ |
Device interfaces specification
This specification describes a set of interfaces for generic peripheral devices.
Slot | Device | Description | Done |
---|---|---|---|
0x0 | System | System information and sleep. | ✓ |
0x1 | Memory | Additional expansion memory. | ✓ |
0x2 | Math | Complex math operations. | ✓ |
0x3 | Clock | Real-time clock and timers. | ✓ |
0x4 | Input | Human input devices. | ✓ |
0x5 | Screen | 16-colour resizable screen. | ✓ |
0x6 | Tone | Tone synthesizer. | ✗ |
0x7 | Sampler | Sample playback. | ✗ |
0x8 | Stream | Bytestream-based communication. | ✗ |
0x9 | Clipboard | Shared clipboard access. | ✗ |
0xA | File | Filesystem access. | ✗ |
0xB | Settings | Persistent shared data. | ✗ |
0xC | Custom device 1 | Implementation defined. | ✗ |
0xD | Custom device 2 | Implementation defined. | ✗ |
0xE | Custom device 3 | Implementation defined. | ✗ |
0xF | Custom device 4 | Implementation defined. | ✗ |
The interfaces of the four custom devices are implementation defined, and will not be portable across Bedrock systems.
Assembler specification
This specification describes an assembly language and assembler for generating Bedrock bytecode.
Auxillary specifications
Specification | Description | Done |
---|---|---|
Program metadata | Include structured metadata in a Bedrock program. | ✓ |
Bedrock path | Environment variable for Bedrock program directories. | ✗ |