diff options
author | chandramouli narayanan <mouli@linux.intel.com> | 2012-06-25 12:51:08 -0700 |
---|---|---|
committer | chandramouli narayanan <mouli@linux.intel.com> | 2012-06-25 12:51:08 -0700 |
commit | d6036dc65284a63f08c1b75e8bb10d15a96b5286 (patch) | |
tree | 6f04d886ac93a4b0ad738da758baf9851790d930 | |
parent | a5759fa44611e372eccc01d85f2db1bc7050c77d (diff) | |
download | syslinux-d6036dc65284a63f08c1b75e8bb10d15a96b5286.tar.gz syslinux-d6036dc65284a63f08c1b75e8bb10d15a96b5286.tar.xz syslinux-d6036dc65284a63f08c1b75e8bb10d15a96b5286.zip |
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.
-rw-r--r-- | 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 fbcd9364..e6635909 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, |