[syslinux] [PATCH 16/19] ldlinux: Disable VGA graphics when loading a kernel

Matt Fleming matt at console-pimps.org
Fri Mar 23 11:02:50 PDT 2012


From: Matt Fleming <matt.fleming at intel.com>

The state of the graphics hardware is unknown when we're about to load
a new kernel. It could be running in VGA mode, so let's disable VGA
graphics before passing control to the kernel.

The old assembly version of this code made extensive used of
writestr(), which always calls vgaclearmode(). In the C version we're
using printf() and so need to call vgaclearmode() directly. Doing it
directly has the added advantage of documenting exactly where we need
to reset the graphics hardware.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>
---
 com32/elflink/ldlinux/kernel.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/com32/elflink/ldlinux/kernel.c b/com32/elflink/ldlinux/kernel.c
index 2438d11..ed91b76 100644
--- a/com32/elflink/ldlinux/kernel.c
+++ b/com32/elflink/ldlinux/kernel.c
@@ -68,6 +68,7 @@ int new_linux_kernel(char *okernel, char *ocmdline)
 	}
 	*/
 
+	vgaclearmode();
 	printf("cmdline = %s\n", cmdline);
 	/*
 	printf("VkernelEnd = %x\n", VKernelEnd);
-- 
1.7.4.4




More information about the Syslinux mailing list