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.

SectionDescriptionDone
ProcessorEvaluates program bytecode.
Program memoryContains the current program.
StacksContains temporary program state.
Device busProvides communication with devices.

Device interfaces specification

This specification describes a set of interfaces for generic peripheral devices.

SlotDeviceDescriptionDone
0x0SystemSystem information and sleep.
0x1MemoryAdditional expansion memory.
0x2MathComplex math operations.
0x3ClockReal-time clock and timers.
0x4InputHuman input devices.
0x5Screen16-colour resizable screen.
0x6ToneTone synthesizer.
0x7SamplerSample playback.
0x8StreamBytestream-based communication.
0x9ClipboardShared clipboard access.
0xAFileFilesystem access.
0xBSettingsPersistent shared data.
0xCCustom device 1Implementation defined.
0xDCustom device 2Implementation defined.
0xECustom device 3Implementation defined.
0xFCustom device 4Implementation 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

SpecificationDescriptionDone
Program metadataInclude structured metadata in a Bedrock program.
Bedrock pathEnvironment variable for Bedrock program directories.