Do not try to display non-printable characters on the bootlog and
authorUlf Jordan <jordan@chalmers.se>
Tue, 30 Sep 2008 06:13:54 +0000 (06:13 +0000)
committerPeter Stuge <peter@stuge.se>
Tue, 30 Sep 2008 06:13:54 +0000 (06:13 +0000)
ramdump screens. This fixes unaligned display on serial console.

The current isprint() implementation assumes a C locale, so also
characters with the eigth bit set are supressed (they produced
inconsistant results on VGA and serial anyway).

Signed-off-by: Ulf Jordan <jordan@chalmers.se>
Acked-by: Peter Stuge <peter@stuge.se>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3621 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

payloads/coreinfo/bootlog_module.c
payloads/coreinfo/ramdump_module.c

index 74424e2df68d32c19994020414add1f24994fbab..1dc7bbec709cf3019e51436e8e8240ea9abb76bc 100644 (file)
@@ -63,7 +63,7 @@ static int bootlog_module_redraw(WINDOW *win)
 
        /* FIXME: Handle lines longer than 80 characters. */
        while (y <= 18) {
-               mvwaddnstr(win, y + 2, x, tmp, 1);
+               mvwaddch(win, y + 2, x, isprint(*tmp) ? *tmp : ' ');
                x++;
                tmp++;
                if (*tmp == '\n') {
index 019b3d9debafc4c3a7f019e27507ab1c3c5d82ac..04a9f0955d85442acb04eaf40eceaf0cc0d842e7 100644 (file)
@@ -44,7 +44,8 @@ static void dump_ram(WINDOW *win, uint32_t addr, int row, int col)
                        mvwaddch(win, row + y, col + 76, '|');
                }
                mvwprintw(win, row + y, col + x + 9, "%02x", ptr[i - 1]);
-               mvwprintw(win, row + y, 62 + count++, "%c", ptr[i - 1]);
+               mvwprintw(win, row + y, 62 + count++, "%c",
+                         isprint(ptr[i - 1]) ? ptr[i - 1] : ' ');
                x += 3;
                if (x == 24)    /* One more space after column/byte 8. */
                        x++;