PC Emulating Visualizer

This project contains two programs: GitHub , site , page , download

Computers once had operator panels that provided an intimate overview of the machine's internal state at any given moment. The blinking lights would communicate the personality of each piece of software. Since our minds are great at spotting patterns, developers would intuitively understand based on which way the LEDs were flashing, if a program was sorting data, collating, caught in an infinite loop, etc. This is an aspect of the computing experience that modern machines haven't done a good job at recreating, until now.

What makes Blinkenlights unique is that its interface is designed under the assumption that terminal displays have grown larger than 80 columns. Therefore we can display many more panels of useful info than alternatives such as GDB. The most important panels are the ones that hexdump memory using Code Page 437. It's also able to automatically infer the type signatures of SSE registers based on the instructions. For example, here's an operating session screencast for a program that just prints images in the terminal. mp4

Watching this program execute (c / ctrl-c) at adjustable speed (ctrl-t / alt-t) it becomes clearer that the Process of Printing an Image is basically a pipeline that goes: IDCT → Y′CbCr to RGB → decimate → sharpen → block render. Thanks to Blinkenlights we can also see that the RGB conversion is going slower than it should, because code isn't benefiting from SSE register vectorization. Many other common issues concerning micro-optimization, such as register spillage, become super apparent as well.

Software is conventionally written with an abstract theory of mind that's rooted in computer science concepts such as time complexity. However sometimes we get lazy at inappropriate moments and make our code accidentally quadratic page . Modern CPUs have a feature called spectre that makes slow algorithms go as fast as good ones for small datasets, which unfortunately makes these issues difficult to spot. On the other hand, Blinkenlights behaves more like a conventional CPU so you concretely see the true impact of algorithms that are sloppy from a theoretical standpoint, thus saving you from the potential mistake of pushing that code into production to crunch data at scale.

Blinkenlights is also a proper emulator in the sense that it can emulate itself. This can be accomplished by simply passing the blinkenlights.com binary as an argument to itself. Blinkenlights doesn't need any system commands to be installed beforehand (e.g. gdb backend) so this does in fact emulate the entire emulation process.

bash blinkenlights.com -t blinkenlights.com

What are the tradeoffs? Blinkenlights is really good at creating a deterministic environment for program execution that can reproduce program state down to the finest detail across operating systems. It also runs as a first-class native binary on each system. But since it's an Actually Portable Executable it might not be able to perfectly conform to the conventions of your local operating system.

[…]

If all that sounds good, then please proceed to the download page. You can get started by reading the tutorial on the Real Mode page .

> Here's a first principles tutorial. You can program your emulator by doing the same thing that folks did back in the 1970's programming the Altair 8800: entering the raw octal instructions.

The only difference is we're using printf instead of those flip switches. Here's a simple program to get started:

printf '\100\353\375' >prog.bin blinkenlights.com -rt prog.bin

You should then see your program appear in a terminal interface that looks like the following:

You can then press the s key to step through your program. Be sure to make the terminal font size as small as possible, and to maximize the terminal window, so that you see all the panels. It’s also a good idea to enable SSH compression when accessing Linux via the net, since it’ll increase your framerate.