It looks like filo has some problems with serial console.
1. left arrow: reboots the system 2. tab: carriage return 3. backspace: leaves B characters
Marc
On 20/10/08 17:16 -0600, Marc Jones wrote:
It looks like filo has some problems with serial console.
- left arrow: reboots the system
Lots of left arrows - presumably any escape related key would be affected. This has been reported before, but it doesn't seem to break in qemu, only on real hardware.
- tab: carriage return
- backspace: leaves B characters
Marc
-- Marc Jones Senior Firmware Engineer (970) 226-9684 Office mailto:Marc.Jones@amd.com http://www.amd.com/embeddedprocessors
-- coreboot mailing list: coreboot@coreboot.org http://www.coreboot.org/mailman/listinfo/coreboot
Jordan Crouse schrieb:
On 20/10/08 17:16 -0600, Marc Jones wrote:
It looks like filo has some problems with serial console.
- left arrow: reboots the system
Lots of left arrows - presumably any escape related key would be affected. This has been reported before, but it doesn't seem to break in qemu, only on real hardware.
Fails on qemu, too. I work on it (and on the stuff you mentioned on IRC once)
- tab: carriage return
- backspace: leaves B characters
Regards, Patrick
Jordan Crouse schrieb:
On 20/10/08 17:16 -0600, Marc Jones wrote:
It looks like filo has some problems with serial console.
- left arrow: reboots the system
Lots of left arrows - presumably any escape related key would be affected. This has been reported before, but it doesn't seem to break in qemu, only on real hardware.
The attached patch limits the amount of characters read for escape handling to the size of the buffer. It also changes the recursion to a while loop. A compiler "should" resolve the tail recursion, but I'd rather be sure.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
Regards, Patrick
=== libpayload/curses/keyboard.c ================================================================== --- libpayload/curses/keyboard.c (revision 2258) +++ libpayload/curses/keyboard.c (local) @@ -50,21 +50,24 @@ do the cooking in here, but we should probably eventually pass it to dedicated vt100 code */
-static int getkeyseq(char *buffer, int len) +static int getkeyseq(char *buffer, int len, int max) { int i;
- for(i = 0; i < 75; i++) { - if (serial_havechar()) - break; - mdelay(1); - } + while (1) { + for(i = 0; i < 75; i++) { + if (serial_havechar()) + break; + mdelay(1); + }
- if (i == 75) - return len; + if (i == 75) + return len;
- buffer[len++] = serial_getchar(); - return getkeyseq(buffer, len); + buffer[len++] = serial_getchar(); + if (len == max) + return len; + } }
static struct { @@ -99,7 +102,7 @@ static int handle_escape(void) { char buffer[5]; - int len = getkeyseq(buffer, 0); + int len = getkeyseq(buffer, 0, sizeof(buffer)); int i, t;
if (len == 0)
Patrick Georgi wrote:
Jordan Crouse schrieb:
On 20/10/08 17:16 -0600, Marc Jones wrote:
It looks like filo has some problems with serial console.
- left arrow: reboots the system
Lots of left arrows - presumably any escape related key would be affected. This has been reported before, but it doesn't seem to break in qemu, only on real hardware.
The attached patch limits the amount of characters read for escape handling to the size of the buffer. It also changes the recursion to a while loop. A compiler "should" resolve the tail recursion, but I'd rather be sure.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de
This is a lot better. It doesn't just reboot if I use the left arrow. If hold the back arrow down for a few seconds it will reboot when I on the release.
Based on the improvement Acked-by: Marc Jones marc.jones@amd.com
Marc