BugCheck2Linux: run Linux in a tiny RISC-V emulator during a Windows BSOD

Running into a blue screen of death, but don’t want your journey to end? Well, how about dropping into a Linux shell when you hit a BSOD in Windows?

We simply register a BugCheck callback. The callback function runs a tiny RISC V emulator running linux.

For the video output we use bootvid.dll and for input we have a horrible simple polling based PS/2 keyboard driver.

↫ BugCheck2Linux GitHub page

The gist here is that during a BSOD, drivers can reset a device to a known working state and gather diagnostic data, so what the BugCheck2Linux “driver” does is load up an incredibly small RISC-V emulator, boot a Linux kernel, and drop you in a shell. An incredibly limited shell that can barely do anything, but a shell nonetheless. And when I say “limited”, I really do mean “limited”: it only works on BIOS systems, runs at 640×480 in 16 colours, the shift key doesn’t work (you’ll need to use caps lock for that), and you can’t use backspace either.

Still, this is an incredibly cool proof of concept, and I wonder if more is possible here. Who knows – this could become a valuable troubleshooting tool.

2 Comments

  1. 2024-01-20 11:04 pm
    • 2024-01-21 3:56 am