Hi. As talked with phcoder in #grub on freenode, there is a cleaner version of the first patch, taking in consideration the recent changes in ofconsole. There is also a little fix to get the "~" character when the "DEL" key is pressed.
On Thu, 2010-02-11 at 16:36 -0200, Manoel Rebelo Abraches wrote: > Hello. > We have made those simple patches to fix some problems with > unimplemented keys in ieee1275 terminals. > The first patch (ofconsole_keys) implements the "backspace" and "delete" > keys. > The second one (ofconsole_unimplemented_keys) will clean the buffer of > unknown keys and prevent garbage to show up in the screen. This patch > was tested in both P5 and P6 machines. > Please review and let me know your opinion about it. > Thank you. > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel -- Best Regards, Manoel Rebelo Abranches Software engineer IBM - Linux Technology Center - Brazil
=== modified file 'ChangeLog' --- ChangeLog 2010-02-14 17:36:26 +0000 +++ ChangeLog 2010-02-16 16:41:50 +0000 @@ -130,6 +130,11 @@ * util/grub-mkrawimage.c (generate_image): Add forgotten ALIGN_UP. +2010-02-16 Manoel Rebelo Abranches <mrab...@br.ibm.com> + + * term/ieee1275/ofconsole.c (grub_ofconsole_readkey): Add some + unimplemented keys. + 2010-02-10 Vladimir Serbinenko <phco...@gmail.com> Pass SIMPLE framebuffer size in bytes and not 64K blocks. === modified file 'term/ieee1275/ofconsole.c' --- term/ieee1275/ofconsole.c 2010-02-14 13:52:10 +0000 +++ term/ieee1275/ofconsole.c 2010-02-16 19:15:34 +0000 @@ -202,9 +202,16 @@ grub_ieee1275_read (stdin_ihandle, &c, 1, &actual); - if (actual > 0 && c == '\e') + if (actual > 0) + switch(c) { grub_uint64_t start; + case 0x7f: + /* Backspace: Ctrl-h. */ + c=8; + break; + case '\e': + grub_ieee1275_read (stdin_ihandle, &c, 1, &actual); /* On 9600 we have to wait up to 12 milliseconds. */ @@ -247,7 +254,25 @@ /* Left: Ctrl-b. */ c = GRUB_TERM_LEFT; break; + case '3': + + grub_ieee1275_read (stdin_ihandle, &c, 1, &actual); + /* On 9600 we have to wait up to 12 milliseconds. */ + start = grub_get_time_ms (); + while (actual <= 0 && grub_get_time_ms () - start < 12) + grub_ieee1275_read (stdin_ihandle, &c, 1, &actual); + + if (actual <= 0) + return 0; + + /* Delete: Ctrl-d. */ + if (c == '~') + c = 4; + else + return 0; + break; } + break; } *key = c;
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel