x86: serial: Don't print a \n with \r
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 14 Feb 2017 18:45:09 +0000 (13:45 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 14 Feb 2017 18:46:53 +0000 (13:46 -0500)
My old minicom seemed to need this, but it pops up as a problem with the
Linux guest over serial/minicom.  Every line would have two \ns, one for
the \n and one for the \r.

My current minicom and qemu work fine with the new settings, which also
works well with a Linux guest over minicom.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/x86/console.c

index 680471d..b1121f5 100644 (file)
@@ -89,10 +89,12 @@ static void serial_put_char(struct cons_dev *cdev, uint8_t c)
                #endif /* CONFIG_PRINTK_NO_BACKSPACE */
                        break;
                case '\n':
                #endif /* CONFIG_PRINTK_NO_BACKSPACE */
                        break;
                case '\n':
-               case '\r':
                        __serial_put_char(cdev->val, (uint8_t)('\n'));
                        __serial_put_char(cdev->val, (uint8_t)('\r'));
                        break;
                        __serial_put_char(cdev->val, (uint8_t)('\n'));
                        __serial_put_char(cdev->val, (uint8_t)('\r'));
                        break;
+               case '\r':
+                       __serial_put_char(cdev->val, (uint8_t)('\r'));
+                       break;
                default:
                        __serial_put_char(cdev->val, (uint8_t)(c & 0xff));
                        break;
                default:
                        __serial_put_char(cdev->val, (uint8_t)(c & 0xff));
                        break;