From d8ce3aad1f66e69d66c7f04834c91f181f160cf9 Mon Sep 17 00:00:00 2001 From: Matt Fleming Date: Fri, 27 May 2011 17:57:32 +0100 Subject: [PATCH] ldlinux: Support "kbdmap" Add support to the ldlinux config file parser for the "kbdmap" directive. Signed-off-by: Matt Fleming --- com32/elflink/ldlinux/readconfig.c | 19 +++++++++++++++++++ core/conio.inc | 1 + 2 files changed, 20 insertions(+) diff --git a/com32/elflink/ldlinux/readconfig.c b/com32/elflink/ldlinux/readconfig.c index 61da2ff..408fe03 100644 --- a/com32/elflink/ldlinux/readconfig.c +++ b/com32/elflink/ldlinux/readconfig.c @@ -728,6 +728,7 @@ static inline void io_delay(void) extern void get_msg_file(void); extern void loadfont(void); +extern void loadkeys(void); extern char syslinux_banner[]; extern char copyright_str[]; @@ -1156,7 +1157,25 @@ do_include: refstr_put(filename); } else if (looking_at(p, "kbdmap")) { + com32sys_t reg; + char *filename, *dst = KernelName; + size_t len = FILENAME_MAX - 1; + + filename = refstrdup(skipspace(p + 4)); + + while (len-- && not_whitespace(*filename)) + *dst++ = *filename++; + *dst = '\0'; + memset(®, 0, sizeof(reg)); + reg.edi.w[0] = OFFS_WRT(KernelName, 0); + call16(core_open, ®, ®); + if (!(reg.eflags.l & EFLAGS_ZF)) + call16(loadkeys, ®, NULL); + else + printf("File not found\n"); + + refstr_put(filename); } /* * subset 2: pc_setint16 diff --git a/core/conio.inc b/core/conio.inc index 46183fb..ec2aa2a 100644 --- a/core/conio.inc +++ b/core/conio.inc @@ -26,6 +26,7 @@ ; section .text16 + global loadkeys loadkeys: mov cx,256 mov di,trackbuf -- 2.7.4