[syslinux:firmware] Console input initiated by com32 modules and sample programs hang on both i386 and x86_64 . The issue is traced to the implementation of get_key() underlying firmware. For stdin file descriptor, the console read finally resolves to __rawcon_read() implemented in com32/ lib/sys/rawcon_read.c. This file is firmware-dependent and currently has only BIOS-specific code As a temporary fix , in EFI, __rawcon_read() is implemented using getchar(). The implementation of getchar() in EFI is guided by the firmware structure that points to efi_getchar(). With this temporary fix, com32 command modules that wait on console input work.

syslinux-bot for chandramouli narayanan mouli at linux.intel.com
Fri Nov 9 09:06:23 PST 2012


Commit-ID:  d6036dc65284a63f08c1b75e8bb10d15a96b5286
Gitweb:     http://www.syslinux.org/commit/d6036dc65284a63f08c1b75e8bb10d15a96b5286
Author:     chandramouli narayanan <mouli at linux.intel.com>
AuthorDate: Mon, 25 Jun 2012 12:51:08 -0700
Committer:  chandramouli narayanan <mouli at linux.intel.com>
CommitDate: Mon, 25 Jun 2012 12:51:08 -0700

Console input initiated by com32 modules and sample programs hang on both i386 and x86_64. The issue is traced to the implementation of get_key() underlying firmware. For stdin file descriptor, the console read finally resolves to __rawcon_read() implemented in com32/lib/sys/rawcon_read.c. This file is firmware-dependent and currently has only BIOS-specific code As a temporary fix, in EFI, __rawcon_read() is implemented using getchar(). The implementation of getchar() in EFI is guided by the firmware structure that points to efi_getchar(). With this temporary fix, com32 command modules that wait on console input work.

Remanants of the unused old i386-only files, if any, need to be pruned.

---
 com32/lib/sys/rawcon_read.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/com32/lib/sys/rawcon_read.c b/com32/lib/sys/rawcon_read.c
index fbcd936..e663590 100644
--- a/com32/lib/sys/rawcon_read.c
+++ b/com32/lib/sys/rawcon_read.c
@@ -39,12 +39,14 @@
 #include "file.h"
 
 /* Global, since it's used by stdcon_read */
+#ifndef SYSLINUX_EFI
 ssize_t __rawcon_read(struct file_info *fp, void *buf, size_t count)
 {
     com32sys_t ireg, oreg;
     char *bufp = buf;
     size_t n = 0;
 
+printf("__rawcon_read... enter\n");
     (void)fp;
 
     memset(&ireg, 0, sizeof ireg);
@@ -65,6 +67,19 @@ ssize_t __rawcon_read(struct file_info *fp, void *buf, size_t count)
 
     return n;
 }
+#else
+ssize_t __rawcon_read(struct file_info *fp, void *buf, size_t count)
+{
+    extern char getchar();
+    char *bufp = buf;
+    size_t n = 0;
+    while (n < count) {
+	*bufp++ = getchar();
+	n++;
+    }
+    return n;
+}
+#endif
 
 const struct input_dev dev_rawcon_r = {
     .dev_magic = __DEV_MAGIC,


More information about the Syslinux-commits mailing list