prep: disable VBE extensions when executing client program

PReP payloads such as Linux expect to be able to set standard VGA modes
on startup, but VBE prevents certain modes such as text-only.

Disable VBE extensions when executing the client program to allow this
behaviour which also matches that of Open HackWare.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
This commit is contained in:
Mark Cave-Ayland
2018-05-26 20:09:22 +01:00
parent ce43b60d61
commit 8d96d0bbba
2 changed files with 27 additions and 0 deletions

View File

@ -613,10 +613,26 @@ static void arch_go(void);
static void
arch_go(void)
{
phandle_t ph;
xt_t xt;
/* Insert copyright property for MacOS 9 and below */
if (find_dev("/rom/macos")) {
fword("insert-copyright-property");
}
/* PReP machines expect a standard VGA console, so disable
VBE extensions just before we transfer control */
if (!is_apple()) {
ph = dt_iterate_type(find_dev("/"), "display");
if (ph != 0) {
xt = find_package_method("vbe-deinit", ph);
if (xt != 0) {
PUSH(xt);
fword("execute");
}
}
}
}
static void kvm_of_init(void)

View File

@ -226,6 +226,17 @@ defer mol-color!
loop
;
\
\ Cancel Bochs VBE mode
\
: vbe-deinit ( -- )
\ Switching VBE on and off clears the framebuffer
VBE_DISPI_DISABLED VBE_DISPI_INDEX_ENABLE vbe-iow!
VBE_DISPI_ENABLED VBE_DISPI_INDEX_ENABLE vbe-iow!
VBE_DISPI_DISABLED VBE_DISPI_INDEX_ENABLE vbe-iow!
;
headerless
\