90 lines
2.1 KiB
Diff
90 lines
2.1 KiB
Diff
|
--- elilo/x86_64/config.c
|
||
|
+++ elilo/x86_64/config.c
|
||
|
@@ -33,15 +33,23 @@
|
||
|
|
||
|
typedef struct {
|
||
|
UINTN legacy_free_boot;
|
||
|
+ UINTN text_mode;
|
||
|
} x86_64_global_config_t;
|
||
|
|
||
|
|
||
|
+#define x86_64_opt_offsetof(option) (&((sys_img_options_t *)(0x0))->option)
|
||
|
+
|
||
|
static x86_64_global_config_t x86_64_gconf;
|
||
|
|
||
|
static config_option_t sysdeps_global_options[]={
|
||
|
{OPT_BOOL, OPT_GLOBAL, L"legacy-free", NULL, NULL, &x86_64_gconf.legacy_free_boot}
|
||
|
};
|
||
|
|
||
|
+static config_option_t sysdeps_image_options[]={
|
||
|
+ {OPT_BOOL, OPT_IMAGE_SYS, L"text-mode", NULL, NULL, x86_64_opt_offsetof(text_mode)}
|
||
|
+};
|
||
|
+
|
||
|
+
|
||
|
/*
|
||
|
* X86_64 operations that need to be done only once and just before
|
||
|
* entering the main loop of the loader
|
||
|
@@ -81,6 +89,14 @@
|
||
|
return x86_64_gconf.legacy_free_boot ? 1 : 0;
|
||
|
}
|
||
|
|
||
|
+
|
||
|
+INTN
|
||
|
+x86_64_text_mode(VOID)
|
||
|
+{
|
||
|
+ return (elilo_opt.sys_img_opts &&
|
||
|
+ elilo_opt.sys_img_opts->text_mode == TRUE) ? 1 : 0;
|
||
|
+}
|
||
|
+
|
||
|
INTN
|
||
|
sysdeps_register_options(VOID)
|
||
|
{
|
||
|
@@ -89,14 +105,11 @@
|
||
|
ret = register_config_options(sysdeps_global_options,
|
||
|
sizeof(sysdeps_global_options)/sizeof(config_option_t),
|
||
|
OPTIONS_GROUP_GLOBAL);
|
||
|
-#if 0
|
||
|
- /* no per image options yet */
|
||
|
if (ret == -1 ) return ret;
|
||
|
|
||
|
ret = register_config_options(sysdeps_image_options,
|
||
|
sizeof(sysdeps_image_options)/sizeof(config_option_t),
|
||
|
OPTIONS_GROUP_IMAGE);
|
||
|
-#endif
|
||
|
|
||
|
return ret;
|
||
|
}
|
||
|
--- elilo/x86_64/sysdeps.h
|
||
|
+++ elilo/x86_64/sysdeps.h
|
||
|
@@ -369,6 +369,7 @@
|
||
|
extern UINTN rmswitch_size;
|
||
|
|
||
|
extern INTN x86_64_use_legacy_free_boot();
|
||
|
+extern INTN x86_64_text_mode();
|
||
|
|
||
|
/*
|
||
|
* How to jump to kernel code
|
||
|
@@ -471,7 +472,8 @@
|
||
|
}
|
||
|
|
||
|
typedef struct sys_img_options {
|
||
|
- UINT8 nothing_yet;
|
||
|
+ UINT8 dummy; /* forces non-zero offset for first field */
|
||
|
+ UINT8 text_mode; /* do not try to initialize Graphics Output Protocol */
|
||
|
} sys_img_options_t;
|
||
|
|
||
|
#endif /* __ELILO_SYSDEPS_X86_64_H__ */
|
||
|
--- elilo/x86_64/system.c
|
||
|
+++ elilo/x86_64/system.c
|
||
|
@@ -198,6 +198,10 @@
|
||
|
UINTN size1;
|
||
|
UINT8 i;
|
||
|
|
||
|
+ if (x86_64_text_mode() == 1) {
|
||
|
+ Print((L"Skip GOP init, force text-mode.\n"));
|
||
|
+ return -1;
|
||
|
+ }
|
||
|
efi_status = uefi_call_wrapper(
|
||
|
BS->LocateHandle,
|
||
|
5,
|