boot/bios_ia32: check that the vga mode was successfully set
before trying to write to the frame buffer. * QEMU can now be started without a standard vga output (-vga none). Change-Id: Id46cd4d70ce16e2156e0b0668fb88f09112067a0 Reviewed-on: https://review.haiku-os.org/c/haiku/+/7667 Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org> Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
parent
205b8694e5
commit
baa67e1184
|
@ -708,13 +708,14 @@ video_mode_menu()
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
static status_t
|
||||
set_vga_mode(void)
|
||||
{
|
||||
// sets 640x480 16 colors graphics mode
|
||||
bios_regs regs;
|
||||
regs.eax = 0x0012;
|
||||
call_bios(0x10, ®s);
|
||||
return (regs.eax == 0x4f) ? B_OK : B_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
|
||||
|
@ -872,8 +873,11 @@ platform_switch_to_logo(void)
|
|||
gKernelArgs.frame_buffer.physical_buffer.start = modeInfo.physical_base;
|
||||
} else {
|
||||
fallback:
|
||||
// use standard VGA mode 640x480x4
|
||||
set_vga_mode();
|
||||
// try to use standard VGA mode 640x480x4
|
||||
if (set_vga_mode() != B_OK) {
|
||||
dprintf("no standard VGA output\n");
|
||||
return;
|
||||
}
|
||||
|
||||
gKernelArgs.frame_buffer.width = 640;
|
||||
gKernelArgs.frame_buffer.height = 480;
|
||||
|
|
Loading…
Reference in New Issue