The WHALE platform
Three and a half years of NSF EPSCoR funded research (the "Wisdom" team) into
open technology for remote environmental sensing and infrastructure
monitoring. The result is a complete open firmware platform for the RP2040:
solar-powered sensor nodes on sodium-ion cells, RFM69 packet radio to a
cellular gateway, MQTT out the far end. Deployed networks have 100% data
retention, including through a gateway failure.
Everything is open source and open hardware (CERN-OHL-W), designed so other
researchers can reproduce it from commonly available parts. There is no
vendor SDK anywhere in the stack. Startup code, linker scripts, register
definitions, build system, HAL, drivers, and transport are all first-party
Zig, grown bottom-up as independent libraries. Each library has its own
tests, its own documentation, and its own reason to exist.
- munch codeberg.org/e-mo/munch
- A lexer and parser toolkit for Zig. Grammars are plain Zig types and
comptime declarations; parse results are ordinary structs, unions, and
slices. 172 tests.
- fig codeberg.org/e-mo/fig-zig
- A small configuration format. Define the schema as a Zig type and fig
parses a
.fig file into that type, with typed errors and
rendered file:line:col diagnostics. 305 tests.
- jig codeberg.org/e-mo/jig
- Generates thin Zig register-access modules from fig hardware manifests,
wired directly into the build graph. 28 manifests describe the full RP2040
peripheral set. Hardware as data, not hand-maintained headers.
- rp2040-build codeberg.org/e-mo/rp2040-build
- Bare-metal build support for the RP2040: startup code, boot stage 2 CRC,
vector tables, UF2 conversion, and firmware build APIs for the Zig build
system.
- rp2040-drivers codeberg.org/e-mo/rp2040-drivers
- The HAL: 13 MCU peripheral modules and 8 device drivers (RFM69 radio,
SIM7080G cellular modem, ultrasonic and temperature sensors, accelerometer,
EEPROM, RTC, battery charger), with explicit ownership contracts. 324 tests.
- loom codeberg.org/e-mo/loom
- Reusable protocol frameworks. Currently a USB device stack with CDC ACM,
split so loom owns protocol state and the HAL owns registers. The framework
fell out of a driver the moment the seam became real.
- rp2040-rfm69-ota codeberg.org/e-mo/rp2040-rfm69-ota
- Over-the-air firmware updates across the RFM69 radio link: receiver boot
firmware, transmitter relay, and a host REPL. 101 tests.
- whale-build codeberg.org/WISDOM-Research/whale-build
- The board-level platform for the Whale v7, including RUDP, a reliable
transport for lossy low-power radio links: selective-repeat fragmentation,
duplicate suppression across reboots, EEPROM-durable acknowledgments, and
over-the-air wake of a dormant node in a measured 19 ms. Verified
byte-for-byte at 40% injected bidirectional loss. Every number in its
documentation names the bench firmware that produced it. 244 tests.
- whale-examples codeberg.org/WISDOM-Research/whale-examples
- 26 standalone, documented example firmwares. Reference material that
doubles as a standing audit of the platform's API ergonomics.
- wisdom_node_hardware codeberg.org/WISDOM-Research/wisdom_node_hardware
- Five revisions of custom sensor-node PCBs in KiCad, plus a 915 MHz
Yagi antenna. The beautiful, hand-routed work of the Wisdom team's hardware
engineer, designed in weekly collaboration. CERN-OHL-W.
This work won the Outstanding Student Presentation
Award at the AGU Fall Meeting 2025.
Embedded C drivers and HAL
codeberg.org/WISDOM-Research
The C side of the Wisdom work: device drivers written from the datasheet up for the
RP2040 and RP2350, each a standalone library. Every device protocol is implemented
from its datasheet, register maps, timing requirements, state machines and error
handling, built with CMake on the Pico SDK's peripheral layer. The from-scratch,
no-SDK work is the Zig platform above.
- rp2x_rfm69_rudp codeberg.org/WISDOM-Research/rp2x_rfm69_rudp
- RFM69 sub-GHz packet radio driver, with the reliable transport layer built on
top of it. The radio half of every deployed node.
- rp2x_sim7080g codeberg.org/WISDOM-Research/rp2x_sim7080g
- SIM7080G LTE-M cellular modem driver. Power sequencing, PDP context bring-up,
network registration, and the AT-command state machine underneath all of it.
- rp2x_pcf8523 codeberg.org/WISDOM-Research/rp2x_pcf8523
- PCF8523 real-time clock driver over I2C. Timestamps every reading the network
produces, synced over cellular NTP.
- rp2x_cat24m01 codeberg.org/WISDOM-Research/rp2x_cat24m01
- CAT24M01 EEPROM driver. The durable buffer that held every reading through a
gateway failure and shipped them when the link came back.
- whale codeberg.org/WISDOM-Research/whale
- The Wisdom HAL Extender: high-level modular peripheral APIs over the raw
registers, so application code never touches a register map directly.
- wisdom_sensor_net codeberg.org/WISDOM-Research/wisdom_sensor_net
- The datalogger application built on all of the above. The C codebase that ran
in the field.
Wine
gitlab.winehq.org/wine/wine
Contributor to Wine, the compatibility layer that runs Windows software on Linux.
Thirty years of accumulated small problems, each one some specific program
depending on some specific behavior, fixed one conformance test at a time. It is
the largest grown system I have worked in and my favorite kind of codebase.
- !11763
ntdll: Return the object manager status from NtQueryFullAttributesFile
merged
NtQueryFullAttributesFile returned an internal status,
STATUS_BAD_DEVICE_TYPE, for names that are not filesystem paths,
where Windows returns STATUS_OBJECT_NAME_INVALID. The fix asks the
server to open the object and reports its status, the same lookup
NtCreateFile already performs for those names.
- !11788
server: Rewind the directory stream when checking if it is empty
merged
- The directory emptiness check read through a
dup(), which shares
the file offset, so POSIX leaves it unspecified whether recent entries appear. A
non-empty directory could be reported as empty. Filesystem dependent, so CI never
saw it: on btrfs the ntdll:file suite went from 54 failures and a crash on the
second run against the same prefix, to 1 failure and stable. Reproducible outside
Wine in about thirty lines. The fix is one call, in the one ordering the standard
actually guarantees.
- !11826
ntdll: Require SYNCHRONIZE access for the synchronous I/O options
merged
- A
todo_wine carried since 2010. Windows rejects
FILE_SYNCHRONOUS_IO_NONALERT without SYNCHRONIZE in the
access mask; Wine returned a path error instead and validated the combination
nowhere. The marker survived sixteen years partly because the original test's
subject line blamed the filename, which is not what causes the status. I measured
the real behavior on TestBot (the access mask outranks the path, generic rights do
not satisfy the requirement, neither does MAXIMUM_ALLOWED), which
decided where the check belongs. Three commits across seven files: the fix cannot
land alone, so an audit of all 252 call sites found ten passing a synchronous
option without SYNCHRONIZE, fixed first, and the check added after
with zero breakage.
- !11863
ddraw: Stage execute buffer vertices at execute time
merged
- Incoming (1998) crashed shortly after the intro animation, on the demo, Steam
and GOG versions alike. The crash is a null write in wined3d: the destination
buffer had a
resource.size of about 975 MiB, its sysmem allocation
failed in a 32-bit address space, and the caller never checked. The size came from
a vertex count read before it was initialized. The reporter's bisect named an
innocent commit that only moved memory layout around, which I had to demonstrate
separately before the real cause would hold up.
- !12190
d3d8: Do not decrease texture refcount when it is already 0
merged
- Pure Pinball (bug 7054) releases a texture one time too many while tearing
down a menu screen, then tests the return value as if it were an HRESULT. Windows
returns 0 for a release of an object already at zero, so the game is happy there.
Wine returned 0xffffffff, the game read it as a failure and took an error path
that faulted, showed three error dialogs and hung. I measured every d3d8 object
type on every TestBot Windows image: all return 0 at refcount zero, and Wine matched only
for surfaces. The guard went in the shared texture release, and the other types
were left alone because no application is known to hit them. This fixes Wine's
half of the problem. The game still releases the texture twice, which nothing in
Wine can cure.
- !12533
d3d8: Reject vertex shaders that read undeclared input registers
merged
- The second Pure Pinball fix: the ball drew as black planes. Two of the game's
vertex shaders read input registers their declaration does not provide. On
Windows
CreateVertexShader fails with D3DERR_INVALIDCALL
for both, so the game has always silently fallen back to fixed function. Wine ran
the shaders with the missing registers zeroed. I did not want to duplicate the
parser in d3d8 or build a shader just to destroy it, so
wined3d_extract_shader_input_registers() walks the byte code and
returns the register mask, and d3d8 validates before creating anything. The
existing failure path and the creation API are untouched.
- !12546
wined3d: Upload the whole buffer on writes unless it is managed
merged
- The third Pure Pinball fix: the ball's texture stretched over large flat
planes. The game locks 4 or 16 bytes of a vertex buffer of about 10 KB with no
flags, then writes all of it. wined3d marked only the locked range dirty, so the
rest kept stale data from earlier draws. I measured pool, usage, flag and offset
combinations in d3d8 and d3d9 on every TestBot image. Windows uploads the whole
buffer for every write lock except on managed buffers, so that rule replaces a
special case, with new tests in both. With this and !12533, Pure Pinball plays
correctly on Wine, which it does not on my Windows 11 machine.
limpet
codeberg.org/e-mo/limpet
An IO monitor that holds on. A tmux-style client/server tool in Go that
watches many serial (USB CDC) and MQTT streams at once, survives disconnects
and reconnects, names every stream uniformly
(type:watch@unit), and formats output through pluggable
formatters. Built as daily-driver tooling for sensor-network development.
About 12k lines, with tests.
Fortran vs. C: an ECS performance study
The core of an entity component system, implemented twice: once in C, once in
modern Fortran, a language I learned for the project. The goal was to test
Fortran's claims of superior compiler auto-vectorization. Across hundreds of
thousands of transformations of large data vectors, repeated thousands of
times with randomized data, the Fortran implementation was consistently
10-15% faster than the C.