Brighton's Blog
← All Series

MIPS

7 - MR18 Deep Dive: Hand-Encoded MIPS Assembly

MerakiMR18MIPSAssemblyJTAGOpenWrtdeep-dive

Encoding instructions by hand like it’s 1985

They said “use a tool,” I said “nah I got this”

Post 4 mentioned that I hand-encoded every MIPS instruction as hex constants directly in Python. I figured it’s worth breaking down what that actually looks like in practice. So here’s the deep dive—every trampoline, every encoding decision, and the one-bit typo that almost ruined everything.

Read more →

11 - MR18 Deep Dive: Verification

MerakiMR18PythonJTAGOpenWrtMIPSdeep-dive

CPU-executed XOR verification

Trust none of what you hear and less of what you see / I had to verify the data runnin through the memory

Post 10 covered phases 0 through 2—flush, load, flush again. At that point we have 6.9 MB of initramfs sitting in DRAM, and now we need to answer a simple question: is it correct? This post covers phase 3, the XOR verification pipeline, including the approach that didn’t work and the one that does.

Read more →

14 - MR18 Deep Dive: Bare-Metal C

MerakiMR18CMIPSAssemblyAR8035PHYdeep-dive

Writing a PHY driver without libc

I don’t need a feature, I just need a fix / raw register writes and a couple syscall tricks

Post 6 mentioned a standalone C program that pokes two MDIO registers to fix the AR8035 PHY’s broken RGMII RX clock delay. This deep dive rips open the actual source—ar8035_start.S, ar8035.c, and the Makefile—and walks through every layer from the assembly entry point down to the register writes that make Ethernet work. If you’ve ever wondered what bare-metal Linux userspace programming looks like on MIPS with zero library dependencies, this is it.

Read more →