diff -urN grub2.org/term/ieee1275/ofconsole.c grub2/term/ieee1275/ofconsole.c --- grub2.org/term/ieee1275/ofconsole.c 2007-10-01 18:06:33.000000000 +0200 +++ grub2/term/ieee1275/ofconsole.c 2007-10-01 18:11:58.000000000 +0200 @@ -70,20 +70,38 @@ static void grub_ofconsole_putchar (grub_uint32_t c) { - char chr = c; - - if (c == '\n') - { + char chr; + + switch(c) + { + case '\a': + break; + case '\n': + grub_putcode ('\r'); grub_curr_y++; + if(grub_curr_y > (grub_ofconsole_height - 1)) + grub_curr_y -= 4; /* Is this realy correct for all OF versions around ? */ + break; + case '\r': grub_curr_x = 0; - } - else - { + break; + case '\b': + if(grub_curr_x > 0) + grub_curr_x--; + break; + + default: + if(c == '\t') + c = ' '; + + if (grub_curr_x >= (grub_ofconsole_width - 1)) + grub_putcode ('\n'); + grub_curr_x++; - if (grub_curr_x > grub_ofconsole_width) - grub_putcode ('\n'); - } + break; + } + chr = c; grub_ieee1275_write (stdout_ihandle, &chr, 1, 0); }