RSSAmplifier

Blog

Mike's Software Blog

Recent content on Mike's Software Blog

mike42.meRSS feed ↗197 posts

Latest posts

Farewell, wordpress!

I’ve recently re-built this blog using the static site generator, Hugo. This post is a few notes about the motivations and challenges behind that. Old theme New theme New theme (dark mode) Why Wordpress had to go I’ve maintained some sort of blog since 2007. I’ve mainly hosted it on Wordpress, but also switched to a custom blog engine for a few years there. Editing experience One…

About

Most of the software I write is open source, but please check the license of each individual project. This blog content itself remains © All Rights Reserved 2007-2025. Questions, feedback and comments are welcome via email to michael.billington@gmail.com

Switching between VFIO-enabled virtual machines

For the past few months, I’ve been using a setup for software development where I pass the mouse, keyboard and graphics card to a virtual machine via Linux VFIO. The setup is described in detail in its own blog post . In short though, the idea is to provision a separate virtual machine for each project, so that I can install whatever tools I need to solve the problem at hand, with no real…

Going all-in on GPU passthrough for software development

I recently spent some time improving my software development workflow at home, since my previous setup was starting to limit me. I settled on a configuration which uses GPU passthrough with the KVM hypervisor, running Debian as both a host and a guest. This post aims to show some of the benefits and drawbacks of this more complex setup for my use case, as well as a specific combination of hardware…

Building a 1U quiet NAS

I recently built a compact, quiet rackmount NAS for home. I haven’t seen any builds quite like it online, so I’m writing a bit about how it came together. The problem My old backup was a mirrored pair of 2 TB hard drives in an old desktop computer, with a portable 2 TB hard drive as an off-site copy. The disks are now 9 years old, and 2 TB is small enough that I need to ration the…

Controlling computer fans with a microcontroller

I’m currently working on building a small computer, and want to add some 4-pin computer fans, running quietly at a fixed speed. This blog post is just a quick set of notes from prototyping, since it covers a few topics which I haven’t written about before. The problem The speed of 4-pin computer fans can be controlled by varying the duty cycle on a 25 KHz PWM signal. This signal…

Converting my 65C816 computer project to 3.3 V

I recently spent some time re-building my 65C816 computer project to run at 3.3 volts, instead of 5 volts which it used previously. This blog post covers some of the things I needed to take into consideration for the change. It involved making use of options which I added when I designed this test board , as well as re-visiting all of the mistakes in that design. Re-cap: Why 3.3 V is useful One of…

Porting the Amiga bouncing ball demo to the NES

Earlier this year, I ported the Amiga bouncing ball demo to the Nintendo Entertainment System. This is a video capture from a NES emulator. I completed this back in January, but I’m only publishing this blog post now, because I was considering entering it into a demo competition. How it works If you are familiar with NES development, then you will probably notice that there is nothing…

Let’s make a bootloader – Part 2

In my previous blog post , I wrote about loading and executing a 512 byte program from an SD card for my 65C816 computer project. For part 2, I’ll look at what it takes to turn this into a bootloader, which can load a larger program from the SD card. I want the bootloader to control where to read data from, and how much data to load, which will allow me to change the program structure/size…

Let's make a bootloader - Part 1

I’ve been working on a homebrew computer based on the 16-bit 65C816 CPU. All of my test programs so far have run from an EEPROM chip, which I need to remove and re-program each time I need to make a change. Plenty of retro systems ran all of their programs from ROM, but I only want to use it for bootstrapping this computer. I’ve got 8 KiB of space for ROM-based programs in the memory…

Building a simple power supply module

I recently put together a tiny module to power my electronics projects. This is a 3cm x 4cm circuit board, and can be assembled to deliver either a fixed 3.3V or 5V output. Background: Breadboard power supplies I start a lot of my projects on a breadboard, and previously used a breadboard power supply. The voltage regulators on these are not particularly resilient, and I’ve damaged two of…

Let's implement power-on self test (POST)

I recently implemented simple Power-on self test (POST) routine for my 65C816 test board , so that it can stop and indicate a hardware failure before attempting to run any normal code. This was an interesting adventure for two main reasons: This code needs to work with no RAM present in the computer. I wanted to try re-purposing the emulation status (E) output on the 65C816 CPU to blink an LED.…

Building a 65C816 test board

In the last few months, I’ve been learning about the 65C816 processor, and trying to build a working computer which uses it. My latest breadboard-based prototype was not reliable, and I decided to convert it to a PCB to hopefully eliminate the problem, or to at least identify it. Quick goals I was aiming to make a debug-friendly 4-layer PCB, the size of two standard breadboards. This will be…

65C816 computer - second prototype

Back in February, I blogged about my 65816 computer prototype on breadboards . I recently spent some time re-building this in an attempt to add some improvements. The new prototype didn’t work particularly well, so I’ve left out quite a lot of detail from this update. Power delivery I soldered stranded wire to pin-headers to deliver a reliable ground and +5V power connection to each…

Building an emulator for my 65C816 computer

I’ve been working on adding text-based input and output to my 65C816 computer prototype , but it’s not yet working reliably. To unblock software development, I decided to put together an emulator, so that I can test my code while the hardware is out of action. Choosing a base project There were three main options I considered for running 65C816 programs on a modern computer, Write a…

Let's implement preemptive multitasking

I am currently working on building a computer based on the 65C816 processor. This processor has a 16-bit stack pointer, which should make it far more capable than the earlier 65C02, at least in theory. I wanted to check my understanding of how the stack works on this processor, so I tried to build the simplest possible implementation of preemptive multitasking in 65C816 assembly. What I’m…

Interfacing an NXP UART to an 8-bit computer

I recently tested the SC16C752 UART from NXP with my 6502 computer, and I was able to use it to receive and send characters. This blog post shows the simple test program and circuit that I used. Some background I built a 65C02-based computer last year, which uses a serial connection for text I/O. I used the WDC 65C51N to provide a UART interface, and I found it to be quite limited. I am now…

65C816 computer - initial prototype

I am currently working on building a 65C816-based computer from scratch. I have some ideas for how I want to do this, but my first task is to put together a working prototype. I’ll be extending this in different ways to work towards the goals outlined in my last blog post . This is about the simplest computer I can come up with which uses the 65C816 processor, but there is still quite a lot…

A first look at the 65C816 processor

The 65C816 is an interesting processor from the 1980’s. I recently wired one up on a breadboard, and I’ll be blogging here about my attempts to build something useful with it. How I got here I spent a couple of months last year designing and building a computer based on the 65C02 , an old 8 bit processor. I wanted to create a hardware platform for running 6502 assembly programs. This…

Rendering my 6502 computer project in Blender

For the past couple of months, I’ve been working on building a 6502-based computer from scratch. In a previous blog post, I wrote about designing a 3D-printed enclosure for this project in Blender. During this build, I needed to wait for some parts, so I had some time to see what I could do with the 3D models of the case and circuit board. I ended up animating the assembly process, and…

Assembling my 6502 computer

I recently finished assembling my 6502 computer, so that the whole project is housed in a 3D-printed case. This is something that should be easy. I already blogged about making the case , and making the circuit board . All that is left is to put the board in the case, right? Well thanks to some mistakes on my part, things are not quite so simple. More parts I needed quite a few parts to finish…

Adding an SD card reader to my 6502 computer

I recently attempted to add SD card support to my home-built 6502 computer. This was successful, but more challenging than I expected. This blog post is just a few things that I learned along the way. Background SD cards are a popular way to add storage to electronics projects. In my case, I will be using the SD card in SPI mode. My home-built computer has an expansion port with some GPIO pins,…

Implementing the XMODEM protocol for file transfer

I recently built a 6502-based computer from scratch , and I’m using it as a platform for testing 6502 assembly code. The software on this computer is currently very limited, and re-programming an EEPROM chip to test changes is a slow process. This blog post covers changes which I made to implement the XMODEM protocol, allowing me to upload programs over a serial connection. The protocol…

Designing a 3D printed enclosure for my KiCad project in Blender

I recently built a small 6502-based computer on a custom PCB , which I designed in KiCad. This blog post is about the process of building a 3D-printed case to house this project, using Blender. This is my first ever 3D print, so I had a few things to learn. Quick background My effort on this project has been focused on making a design which works, then transferring that design to a PCB. Since this…

Building a hardware interrupt controller

I’ve recently been adding simple hardware devices to my home-built 6502 computer , and ran into a problem. The 6502 has two active-low interrupt inputs (IRQ and NMI), both of which are used in my design. If I add any devices which can trigger their own interrupts, I will need a way to combine multiple interrupt signals into one. Choosing an approach I researched some retro computer designs…

Programming PLD's with open source software

A few weeks ago, I blogged about my setup for programming PLD’s from Linux, which are the simpler ancestors of modern FPGA’s. The device I’m using is the ATF22V10, and programming it in involved running decades-old proprietary software called WinCUPL under WINE. I recently found an opportinity to test-run an open-source alternative, galette , and this blog post is a few notes…

Re-creating the world's worst sound card

I recently built a computer from scratch , and wanted to add some basic sound output. I am not attempting to produce any 8-bit music, but I would like to be able to write programs use beeps and clicks to provide feedback, instead of only text. I did a bit of digging into the subject, and found quite possibly the world’s worst sound card, in the Apple II. This is my attempt to re-draw the…

6502 computer - from breadboard to PCB

I’ve recently been working on building a 6502-based computer on breadboards as a learning project. After making a few revisions , and porting some software to run on it, I was confident that my computer worked well enough to connect up permanently on a circuit board. This blog post about the process that I went through to convert my working breadboard prototype to a PCB. As somebody who is…

Porting BASIC to my 6502 computer

I’ve recently been building my own 6502-based computer . After a lot of work on the hardware side, I decided that it’s time to move past “Hello World” programs, and port a BASIC interpreter. Background This computer is architecturally similar to a 1980’s home computer, where BASIC was a widely-used interpreted language. Porting an existing interpreter will be a fast…

Upgrades and improvements to my 6502 computer

For the past few weeks, I’ve been building a 6502-based retro computer, based originally on a tutorial and design by Ben Eater . My first major change was to add a serial port , so that I can write programs which accept text as input. This blog post is a list of things which I’ve changed since, to try to make a computer which is a bit more suited to my intended use. My aim at the…

A first look at programmable logic

I’ve recently been learning a bit about how computers work on a low-level by building a 6502-based retro computer from scratch . I’ve noticed that plenty of retro computer designs use simple programmable logic devices, including GAL’s, PAL’s and PLA’s. I decided to take a closer look at these, since they may be a useful part of my toolkit. The particular part which…

Adding a serial port to my 6502 computer

In my last blog post , I wrote about the 8-bit computer which I’ve been building, using an existing design by Ben Eater. The I/O capabilities of the original design are rather limited, so one of the first enhancements I’m making is to add a serial port. Hardware The main chip I am adding is the WDC 65C51N ACIA, which is a modern version of the MOS 6551. Versions of this chip have been…

Building a 6502 computer

I’ve been using 6502 assembly for some hobby projects recently, but only testing in an emulator . It’s about time to target some real hardware, so for the past few weeks I’ve been following Ben Eater’s 6502 computer tutorial . I am a complete beginner when it comes to electronics, so I spent a bit of time making useless circuits to toggle LED’s, then jumped right in…

IntelliJ plugin for 6502 assembly language

I’ve been writing some 6502 assembly code in the past year, and have found the developer experience for this language to be lacking some modern conveniences. In my last blog post, I described the development tools that I used to implement a simple NES game on Linux . I used text editor to write the code, and it couldn’t do much more than syntax highlighting. I write most of my other…

Building my first NES game: A retrospective

Last year, I spent a fair amount of time learning how to make games for the Nintendo Entertainment System. The homebrew scene for this system is very much alive, and I was quite proud that I was able to make a simple, working video game which runs on a NES emulator. So, I present to you: 8-bit Table Tennis. This blog post just a few notes about the tools and resources that I used for NES…

Building a tiny Linux gaming PC

I recently put together a small form factor PC to use with my TV, with the aim of building a Linux-based, console-like gaming setup. This mostly went to plan, and is certainly a big upgrade from my previous hardware, which was based on a retired desktop computer . I am writing a bit about it today, partly because it’s been an interesting project, but also to show a working setup for anybody…

How to auto-scale the display in GNOME Boxes

I recently installed a virtual machine in GNOME Boxes, and the display was stuck at 1024x768. The type of display used here is called SPICE, and it includes a channel for auto-scaling. The guest simply needs the agent to be installed. In this case, I’m running a Debian guest, which means that I must have forgotten to install the spice-vdagent package. # apt-get install spice-vdagent Reading…

How to use the qemu-bridge-helper on Debian 10

If you use the libvirt virtualisation libraries, then you will be familiar with the “user session”. This feature lets you provision virtual machines to run under a regular, unprivileged user account. The user session is used by GNOME Boxes, and can also be managed from Virtual Machine Manager. The main downside to this setup is that a regular user can only access a very limited range…

Benchmarking PHP code with PhpBench

This blog post is all about measuring the speed of PHP code through micro-benchmarks. Why micro-benchmarks I think of micro-benchmarks as a complement to tests. A well-written test would give a developer a definite pass or fail result, while well-written micro-benchmark will give the developer an indication of the duration of an operation. To put it another way, tests can help you find out whether…

How to integrate Gitea and Jenkins

Gitea is a web app for hosting Git repositories. It’s open source, and very simple to get running. With some extra setup, it can also trigger Jenkins builds, and display the Jenkins build status of each commit once it has been built. Because the documentation for the Jenkins plugin is very minimalist , I decided to write about it for future reference. About this setup I installed Jenkins and…

Archives

Handling I/O errors in PHP

This blog post is all about how to handle errors from the PHP file_get_contents function, and others which work like it. The file_get_contents function will read the contents of a file into a string . For example: <? php $text = file_get_contents ( "hello.txt" ); echo $text ; You can try this out on the command-line like so: $ echo "hello" > hello.txt $ php test.php hello This function is widely…

The top 100 Ansible modules

Ansible is an automation system which is widely used for deployments and configuration. It contains a dizzying array of modules for interfacing with things like files, services, package managers, and various pieces of software and hardware. Background There are some modules which I would expect every Ansible user to be familiar with, while others are barely used at all. I could have a guess about…

Thermal Sans Mono: A new bitmap font for receipt printers

Today I&rsquo;m writing about a new project that I&rsquo;ve started to create a font, called &ldquo;Thermal Sans Mono&rdquo;. I&rsquo;m hoping to make this into a set of specialized free bitmap fonts for use on thermal receipt printers and printer emulators. Here is what it looks like so far: In this blog post I&rsquo;ll talk a bit about why I needed a new font, how it&rsquo;s derived from GNU…

Three ways to archive a website

I recently needed to archive a small website before decommissioning it. There are a few distinct reasons you might want an archive of a website: To archive the information in case you need it later. To archive the look and feel so that you can see how it has progressed. To archive the digital artifacts so that you can host them elsewhere as a mirror. Each of these produces files in a different…

Monitoring network throughput with Prometheus

Today I&rsquo;m writing a bit about a Prometheus deployment that I made last year on a Raspberry Pi, to get better data about congestion on my uplink to the Internet. The problem You have probably run an Internet speed test before, like this: A speed test will tell you how slow your computer&rsquo;s connection is, but it can&rsquo;t narrow down whether it&rsquo;s because of other LAN devices, the…

How to export a Maildir email inbox as a CSV file

I&rsquo;ve often thought it would be useful to have an &ldquo;Export as CSV&rdquo; button on my inbox, and recently had an excuse to implement one. I needed to parse the Subject of each email coming from an automated process, but the inbox was in the Maildir format, and I needed something more useful for data interchange. So I wrote a utility, mail2csv , to export the Maildir as CSV file, which…

How to make HHVM 3.21 identify itself as PHP 7

HHVM is an alternative runtime for PHP, which I try to maintain compatibility with. I recently upgraded a project to PHPUnit 6, and the tests started failing on hhvm-3.21 with this error: This version of PHPUnit is supported on PHP 7.0 and PHP 7.1. You are using PHP 5.6.99-hhvm (/usr/bin/hhvm). Although HHVM supports many PHP 7 features, it is identifying itself as PHP 5.6. The official…

How to check PHP code style in a continuous integration environment

I&rsquo;m going to write a bit today about PHP_CodeSniffer , which is a tool for detecting PHP style violations. Background Convention is good. It&rsquo;s like following the principle of least surprise in software design, but for your developer audience. PHP has two code standards that I see in the wild: PEAR code standard PSR-2 code style If you are writing new PHP code, or refactoring code that…

Make better CLI progress bars with Unicode block characters

As a programmer, you might add a progress bar so that the user has feedback while they wait for a slow task. If you are writing a console (CLI) application, then you need to make your progress bars from text. A good command-line progress bar should update in small increments, like this example: This uses Unicode Block Elements to give the progress bar a higher resolution. Code Character U+2588 █…