These changes make serial controller working at real hardware and BOCHS: - Disable interrupts - Set up LCR, FCR, MCR properly Signed-off-by: Eugene Korenevsky <ekorenevsky@xxxxxxxxx> --- lib/x86/io.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/x86/io.c b/lib/x86/io.c index 7e1c16d..f697161 100644 --- a/lib/x86/io.c +++ b/lib/x86/io.c @@ -39,6 +39,15 @@ static void serial_init(void) lcr = inb(serial_iobase + 0x03); lcr &= ~0x80; outb(lcr, serial_iobase + 0x03); + + /* IER: disable interrupts */ + outb(0x00, serial_iobase + 0x01); + /* LCR: 8 bits, no parity, one stop bit */ + outb(0x03, serial_iobase + 0x03); + /* FCR: disable FIFO queues */ + outb(0x00, serial_iobase + 0x02); + /* MCR: RTS, DTR on */ + outb(0x03, serial_iobase + 0x04); } static void print_serial(const char *buf) -- 2.18.0