stivale: Refuse to boot if text mode wanted on UEFI

This commit is contained in:
mintsuki 2021-03-31 01:48:27 +02:00
parent 383dd5ae7b
commit 59dd147bf4
2 changed files with 16 additions and 4 deletions

View File

@ -156,9 +156,9 @@ void stivale_load(char *config, char *cmdline) {
stivale_struct.epoch = time();
print("stivale: Current epoch: %U\n", stivale_struct.epoch);
term_deinit();
if (stivale_hdr.flags & (1 << 0)) {
term_deinit();
int req_width = stivale_hdr.framebuffer_width;
int req_height = stivale_hdr.framebuffer_height;
int req_bpp = stivale_hdr.framebuffer_bpp;
@ -183,6 +183,12 @@ void stivale_load(char *config, char *cmdline) {
stivale_struct.fb_green_mask_shift = fbinfo.green_mask_shift;
stivale_struct.fb_blue_mask_size = fbinfo.blue_mask_size;
stivale_struct.fb_blue_mask_shift = fbinfo.blue_mask_shift;
} else {
#if defined (uefi)
panic("stivale: Cannot use text mode with UEFI.");
#endif
term_deinit();
}
#if defined (uefi)

View File

@ -262,9 +262,9 @@ void stivale2_load(char *config, char *cmdline, bool pxe, void *efi_system_table
{
struct stivale2_header_tag_framebuffer *hdrtag = get_tag(&stivale2_hdr, STIVALE2_HEADER_TAG_FRAMEBUFFER_ID);
term_deinit();
if (hdrtag != NULL) {
term_deinit();
int req_width = hdrtag->framebuffer_width;
int req_height = hdrtag->framebuffer_height;
int req_bpp = hdrtag->framebuffer_bpp;
@ -306,6 +306,12 @@ void stivale2_load(char *config, char *cmdline, bool pxe, void *efi_system_table
mtrr_save();
}
}
} else {
#if defined (uefi)
panic("stivale2: Cannot use text mode with UEFI.");
#endif
term_deinit();
}
}