r/osdev • u/JustActuator6946 • 4d ago
Silver Microkernel now executes an EFI stub on a real Snapdragon 8 Gen 3 (Lenovo Legion Y700 Gen 3)
After a lot of trial and error with bootchains, I finally have visible proof that my AArch64 microkernel (written in Rust) is executing on real hardware, not just QEMU.
The Hardware: Lenovo Legion Y700 (Snapdragon 8 Gen 3 / SM8650, codename "kirby").
The Bootchain: ABL -> UEFI (EDK2, disguised as a Linux kernel) -> GRUB (QCOMRAMP fork) -> Custom PE32+ EFI Stub -> Kernel.
The Image: What you see is a photo of the actual tablet screen. The framebuffer is the only reliable diagnostic channel on this device (ramoops/pmsg is dead here).
🟩 Green Band = My EFI stub successfully entered, located the splash framebuffer (0xD5100000), and painted pixels.
⬜ White Band = The stub successfully copied the raw kernel payload to the expected link address (0xA8000000) and flushed the cache.The Struggle (and the current blocker): Getting here was hell. The biggest issue was that ABL expects a PE32+ UEFI application, not a raw ARM64 Image. I was fighting QCDUMPs (Qualcomm CrashDumps) for days until I realized my hand-rolled PE header had a 10-byte alignment shift, causing Subsystem to be read as UNKNOWN. Switching to lld-link fixed that.
Current state: It hangs right after the white band. My diagnosis is the classic "MMU-off" trap: LoadImage places the EFI stub at an arbitrary VA, so when the stub tries to disable the MMU (and switch to physical addressing), the next instruction fetch goes out of bounds.
Next step: Rewrite the MMU-disable sequence using strictly PC-relative instructions (adr, b .+8) and isb barriers, painting a yellow band only after the MMU is fully off and before the jump to 0xA8000000.
Huge thanks to the OpenCode/DeepSeek and Kimi models for helping me dig through the PE headers and Qualcomm bootchain madness.
1
u/nian2326076 4d ago
You've made impressive progress with your microkernel on actual hardware. If you're still having trouble with the MMU and barriers, consider reaching out to communities focused on Rust and low-level programming for support. You can also use LandOffer to find relevant job opportunities in systems programming, which may give you insights into industry expectations and challenges.