Hi Patrick,
First, apologies for my bad English grammar and email composing skills.
I tried your patch [7/8] to fix bugcheck 50 bsod on my Dell Latitude E6430 which is running Libreboot.
In short, your patch initially did not fix the bsod, but after an one-line change of code it successfully fixed bsod, although I still don't know the full situation.
According to my observation, _rom_header_size must be set to some value greater than 0x40, like 0x41.
Under vendor BIOS, igdkmd64 is observed to have a "reattempt memmap" logic only if _rom_header_size > 0x40. After this reattempt of memmap completed, the driver was loaded correctly and it won't bsod.
Otherwise, if _rom_header_size <= 0x40, such logic was seemed to be skipped, and then at certain breakpoint I observed that nothing but "??" representing unreadable bytes filled up windbg's memory peek window, because the vmaddr which was supposed to point to VBT actually pointed to invalid address. `!vtop` command confirmed this as well.
In vgasrc/cbvga.c, related lines:
/* Increment rom header size */
size +=3D (GET_FARVAR(0, vbt->hdr_vbt_size) + 512 - 1) >> 9;
SET_VGA(_rom_header_size, size);
I set `size` to at least 0x41, like:
size +=3D (GET_FARVAR(0, vbt->hdr_vbt_size) + 512 - 1) >> 9;
if (size <= 0x40) size = 0x40 + 1; // newly added line
SET_VGA(_rom_header_size, size);
and then the bsod is gone.
Cheers,
segfault