On 21/07/2018 20:59, Eugene Korenevsky wrote: > When '\n' (line feed) is put to serial port, put '\r' (carriage return) as > well. This makes the serial port output to look properly (without stairs) at > real hardware. Also the output looks well at QEMU/KVM and BOCHS emulators. > > Signed-off-by: Eugene Korenevsky <ekorenevsky@xxxxxxxxx> > --- > lib/x86/io.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/lib/x86/io.c b/lib/x86/io.c > index f697161..edac5bc 100644 > --- a/lib/x86/io.c > +++ b/lib/x86/io.c > @@ -22,6 +22,14 @@ static void serial_outb(char ch) > outb(ch, serial_iobase + 0x00); > } > > +static void serial_put(char ch) > +{ > + /* Force carriage return to be performed on \n */ > + if (ch == '\n') > + serial_outb('\r'); > + serial_outb(ch); > +} > + > static void serial_init(void) > { > u8 lcr; > @@ -61,7 +69,7 @@ static void print_serial(const char *buf) > } > > for (i = 0; i < len; i++) { > - serial_outb(buf[i]); > + serial_put(buf[i]); > } > #else > asm volatile ("rep/outsb" : "+S"(buf), "+c"(len) : "d"(0xf1)); > Applied both, thanks. Paolo