boot: Add a shortcut to toggle video/text mode

This commit is contained in:
K. Lange 2021-10-27 08:17:38 +09:00
parent 393e6ff527
commit af2fd21788
2 changed files with 23 additions and 6 deletions

View File

@ -168,6 +168,11 @@ void show_menu(void) {
boot_mode = boot_mode_names[i].index;
break;
}
#ifndef EFI_PLATFORM
} else if (s == 0x2f) { /* v */
void bios_toggle_mode(void);
bios_toggle_mode();
#endif
} else if (!timeout) {
goto read_again;
}

View File

@ -77,12 +77,7 @@ int bios_text_mode(void) {
text_reset();
}
int bios_main(void) {
/* Zero BSS */
memset(&_bss_start,0,(uintptr_t)&_bss_end-(uintptr_t)&_bss_start);
text_reset();
int bios_video_mode(void) {
int best_match = 0;
int match_score = 0;
@ -122,6 +117,23 @@ int bios_main(void) {
}
init_graphics();
}
void bios_toggle_mode(void) {
if (in_graphics_mode) {
bios_text_mode();
} else {
bios_video_mode();
}
}
int bios_main(void) {
/* Zero BSS */
memset(&_bss_start,0,(uintptr_t)&_bss_end-(uintptr_t)&_bss_start);
text_reset();
bios_video_mode();
return kmain();
}