I'm a CS undergrad who likes the layer where software meets silicon. I've written an x86 operating system from the bootloader up, designed a drone flight-controller PCB and I'm bringing it up with hand-written ARM assembly, and I've had patches accepted into the mainline Linux kernel.
I learn by building the whole stack myself: no HAL, no RTOS, no external libraries. Then I debug it with GDB over SWD, a UART console and a lot of reference-manual reading until I can explain every cycle.
MetalBird (PCB + bare-metal ARM): Flight-controller PCB I designed and had fabricated, brought up with hand-written Cortex-M4 assembly.
PenguOS (x86 OS from scratch): Bootloader, paging, drivers, scheduler, a software 3D engine and a windowed desktop. It boots right here in your browser, and you can use it.
Linux kernel (4 commits in mainline): IIO and staging patches applied by Jonathan Cameron and Greg Kroah-Hartman.
Startup & clocks: Custom vector table and Reset_Handler: FLASH_ACR wait states + ART cache, HSE start-up, PLL (M=4, N=168, P=4) to 84 MHz, then SysTick timing.
USART debug console: Register-level USART with print helpers and a REG_CHECK macro that dumps expected vs. actual register values during bring-up.
I2C master driver: I2C2 in assembly: START/ADDR/ACK-failure handling, multi-byte register reads. It brings up the MPU-6050 (WHO_AM_I, reset, configuration).
Wireless debugging: Flashing and GDB over SWD through an ESP32 running CMSIS-DAP with OpenOCD, so the board can be debugged without a cable to the PC.
Timeline
First schematic
MP2331H buck converter: 7.4 V → 5.4 V
IMU section complete
Flight-controller schematic complete
Routing complete
Gerbers + BOM exported → v1 fabricated
Buck converter simulated in MPSmart (MP2331H, 7.4 V in → 5 V out)
A bootable 32-bit OS with no external libraries: my own two-stage bootloader, memory manager, drivers, preemptive scheduler, a software 3D renderer and a windowed GUI desktop.
Boot & CPU: Two-stage bootloader: real → protected mode, GDT, VBE mode selection, kernel loaded from disk with an ATA PIO reader. IDT with handlers for all 32 CPU exceptions and remapped PIC IRQs.
Memory: Bitmap physical page allocator, two-level paging, and salloc, my own kernel heap allocator.
Drivers: PS/2 keyboard (Shift/Caps/Ctrl) and mouse (3-byte packets), ATA PIO disk with a sector-bitmap file store, PIT, CMOS real-time clock, x87 FPU, UART serial logging.
Scheduling: PIT-driven preemptive context switching between kernel threads.
Graphics: VGA mode 13h and VBE linear-framebuffer graphics with double buffering; text drawn with an 8×16 bitmap font (data from the Linux console's VGA font).
Desktop GUI: A compositor that paints Z-ordered planes (each window has its own page-allocated buffer) into the back buffer at 60 FPS. Windows drag, minimise and close; the taskbar has window buttons and a clock read from the RTC; keys go to the focused window.
Apps: Terminal (runs the kernel shell), Paint, a memory visualiser that draws the physical page bitmap for the first 64 MB, a 3D viewer, and About.
3D engine: Parses .obj models (vertices, normals, UVs) embedded in the kernel image and renders them with perspective projection and rotation, all on the x87 FPU.
Boot path
BIOS: Loads sector 0 to 0x7C00
Stage 1: INT 13h extended read: 8 sectors → 0x7E00
Stage 2: VBE mode → GDT → protected mode → ATA PIO kernel load to 1 MB
Kernel: Serial → IDT → PIC → PMM → paging → salloc → VBE → mouse → STI → FPU
Desktop: gui_main(): input → windows → taskbar → composite planes → cursor, 60 times a second
Timeline
"Pengu says hello to world!!" (GRUB-booted kernel)
Keyboard driver + shell
Paging + physical memory manager
VGA graphics, mouse driver
ATA disk read/write
Preemptive multithreading with context switching
Own two-stage bootloader replaces GRUB
Bitmap file system
VBE mode enumeration
VBE linear framebuffer complete
Full FPU support
.obj parser
First .obj rendered
3D rotation
GUI skeleton
Boot fixes for newer QEMU (the ROM-shadow bug found while porting to this site)
In i2c_init there were two lines that re-read GPIOB->AFRH into R1, and R1 was overwritten three instructions later. Removing them made the firmware hang at the START-bit self-test.
I diffed the objdump output of both builds. Every instruction was identical; only the code after that point moved 6 bytes earlier. So the read itself didn't matter. Timing did.
STM32F4 flash is fetched in 16-byte lines with 2 wait states. In the working build, the instruction after the RCC_APB1ENR store started a fresh flash line and stalled for a few cycles. In the broken build it didn't.
Those few cycles were hiding the real bug: after enabling a peripheral clock, the store can still be in flight when the next instruction touches the peripheral. Writes to an unclocked APB peripheral are silently dropped, so I2C_CR2, CCR and TRISE never took effect. ST lists this in the errata ("Delay after an RCC peripheral clock enabling").
The correct fix is to read RCC_APB1ENR back (plus a DSB) before touching I2C2. That's correct by construction, not by where the code happens to land in flash.
Lesson: A fix you can't explain causally is a mask, not a fix.
Proving the IMU was dead, not my driver
MetalBird
Sensor readings were wrong, and with a hand-written I2C driver there were plenty of suspects. To take my own driver out of the picture, the diagnostic firmware bit-bangs I2C on the same pins.
It runs the factory self-test from the register map (±14 % pass limit, computed on the host), then streams the FIFO at exactly 1 kHz with a sequence counter, so a lost sample is a detected gap, not a guess.
Result, reproduced on 4 runs: accel Y stuck at 32767 (full scale) with zero noise and zero self-test response, accel X reading ≈ +1.96 g while flat, and gyro Z with a −43 °/s zero-rate offset (+271 % self-test). WHO_AM_I = 0x68, so it's a genuine part that's damaged.
Lesson: Build the tool that makes the bug impossible to argue with.
PenguOS vs. a read-only BIOS shadow
PenguOS
Stage 2 read the kernel-size sector into 0xFFE00, just below 1 MB. That's the BIOS ROM shadow region; on SeaBIOS it's read-only, so the size came back as BIOS code and the loader kept reading sectors until the ATA controller errored.
Moving the buffer into free conventional memory fixed it. The fix is upstream now (0x9000, right after stage 2, in commit d6ac8c1), together with padding the image to a whole number of sectors and accepting the 1280×720×32 VBE mode newer QEMU and v86 offer instead of 24 bpp.
Lesson: Every emulator is a new board. Bring-up never really ends.
Skills
Languages
C, ARM Thumb-2 assembly (GAS), x86 assembly (NASM), Python, Bash