[syslinux:elflink] ldlinux: Parse "display" in config files

syslinux-bot for Matt Fleming matt.fleming at linux.intel.com
Tue Jul 12 20:03:22 PDT 2011


Commit-ID:  26c1f437deb4b1ebe1df75e3613f24da62b73ae1
Gitweb:     http://syslinux.zytor.com/commit/26c1f437deb4b1ebe1df75e3613f24da62b73ae1
Author:     Matt Fleming <matt.fleming at linux.intel.com>
AuthorDate: Fri, 27 May 2011 17:49:39 +0100
Committer:  Matt Fleming <matt.fleming at linux.intel.com>
CommitDate: Tue, 7 Jun 2011 20:02:55 +0100

ldlinux: Parse "display" in config files

Teach ldlinux to parse the "display" directive.

Signed-off-by: Matt Fleming <matt.fleming at linux.intel.com>


---
 com32/elflink/ldlinux/readconfig.c |   21 +++++++++++++++++++++
 core/conio.inc                     |    1 +
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/com32/elflink/ldlinux/readconfig.c b/com32/elflink/ldlinux/readconfig.c
index f0e45e9..906cbe0 100644
--- a/com32/elflink/ldlinux/readconfig.c
+++ b/com32/elflink/ldlinux/readconfig.c
@@ -30,6 +30,7 @@
 #include "config.h"
 #include "getkey.h"
 #include "core.h"
+#include "fs.h"
 
 const struct menu_parameter mparm[NPARAMS] = {
     [P_WIDTH] = {"width", 0},
@@ -725,6 +726,8 @@ static inline void io_delay(void)
 	outb(0, 0x80);
 }
 
+extern void get_msg_file(void);
+
 extern char syslinux_banner[];
 extern char copyright_str[];
 
@@ -1112,7 +1115,25 @@ do_include:
 	 * display/font/kbdmap are rather similar, open a file then do sth
 	 */
 	else if (looking_at(p, "display")) {
+		com32sys_t reg;
+		char *filename, *dst = KernelName;
+		size_t len = FILENAME_MAX - 1;
+
+		filename = refstrdup(skipspace(p + 7));
+
+		while (len-- && not_whitespace(*filename))
+			*dst++ = *filename++;
+		*dst = '\0';
+
+		memset(&reg, 0, sizeof(reg));
+		reg.edi.w[0] = OFFS_WRT(KernelName, 0);
+		call16(core_open, &reg, &reg);
+		if (!(reg.eflags.l & EFLAGS_ZF))
+			call16(get_msg_file, &reg, NULL);
+		else
+			printf("File not found\n");
 
+		refstr_put(filename);
 	} else if (looking_at(p, "font")) {
 
 	} else if (looking_at(p, "kbdmap")) {
diff --git a/core/conio.inc b/core/conio.inc
index 6d6f234..46183fb 100644
--- a/core/conio.inc
+++ b/core/conio.inc
@@ -53,6 +53,7 @@ loadkeys:
 ;
 ;		Assumes CS == DS == ES.
 ;
+		global get_msg_file
 get_msg_file:
                 mov byte [TextAttribute],07h	; Default grey on white
 		mov byte [DisplayMask],07h	; Display text in all modes



More information about the Syslinux-commits mailing list