multiboot1: Support TEXTMODE config as with Linux/mb2 protocols
diff --git a/common/protos/multiboot1.c b/common/protos/multiboot1.c
index 808cd657..d370c084 100644
--- a/common/protos/multiboot1.c
+++ b/common/protos/multiboot1.c
@@ -307,6 +307,16 @@ noreturn void multiboot1_load(char *config, char *cmdline) {
size_t req_width = 0;
size_t req_height = 0;
size_t req_bpp = 0;
+#if defined (BIOS)
+ {
+ char *textmode_str = config_get_value(config, 0, "TEXTMODE");
+ bool textmode = textmode_str != NULL && strcmp(textmode_str, "yes") == 0;
+ if (textmode) {
+ goto textmode;
+ }
+ }
+#endif
+
if (header.flags & (1 << 2)) {
req_width = header.fb_width;
