James Stanley's SCAMP Is a Homebrew 1MHz CPU Running a Custom OS and Programming Language
Developer James Stanley is working on a a homebrew 16-bit CPU, running his own UNIX-and-CP/M-like operating system: The Simple Computing and Arithmetic Microcoded Process, or SCAMP.
"The CPU is very primitive. It doesn't support interrupts, and has no MMU [Memory Management Unit], and no concept of privilege levels," Stanley writes by way of tempering expectations of the project.
"It currently runs at 1MHz, above that the CompactFlash interface falls over. It runs a homebrew operating system, with a homebrew programming language and compiler, and can self-host the kernel and all of the system utilities. The environment tastes a bit like an early Unix, but works like CP/M."
Like many homebrew processor projects, SCAMP started life in a hardware description language: Verilog. It didn't stay there for long, though: Stanley turned that Verilog implementation, runnable in simulation or on a field-programmable gate array, into equivalents implemented in 74xx-series logic chips — then built the multi-board stacked computer in hardware.
"It is a 16-bit CPU. The bus is 16-bit, registers are 16-bit, addresses are 16-bit, and memory contents are 16-bit," Stanley writes "The upper 8 bits of an instruction select the opcode, and the lower 8 bits are available for small immediate values. There is no support for: cache, interrupts, virtual memory, DMA, privilege rings, floating point, and ~anything else that is not strictly necessary."
While Stanley works on the operating system, programming language, and a selection of applications — including one which draws the Mandelbrot set to the terminal in ASCII art — on the real hardware, though, he has also released an emulator that lets anyone play with the technology in-browser.
There are plans for upgrades, too, including add-on boards, which would offer hardware multiplication and random number generation, better debugging facilities, additional fixed-point mathematics functions, and even a Z-machine interpreter to run classic interactive fiction games.
The source code for the project, released under the permissive Unlicense License, is available on GitHub; posts about the build are available on Stanley's blog; and the emulator is available on Stanley's website.