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
↫ BugCheck2Linux GitHub pagehorriblesimple polling based PS/2 keyboard driver.
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.
Doom possible?
Doom probable! is history is any guide.