x86: realmode: fix serial_init()
PATCH 1/1 x86: realmode: fix serial_init()
In some setups serial output from the real-mode tests is corrupted.
I do not know the serial port initialization code well, but the protected mode initialization code is different than the real-mode code. Using the protected mode serial port initialization fixes the problem.
Keeping the tradition of code duplication between real-mode and protected mode, this patch copies the missing initialization into real-mode serial port initialization.
Signed-off-by Nadav Amit <[email protected]>
--- x86/realmode.c | 9 +++++++++ 1 file changed, 9 insertions(+)
x86/realmode.c +9 -0
@@ -77,6 +77,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); }#endif
Signature · 1 line
2.17.1