From be57c424f3b74cf35097308bfcc1fbd99d7d9217 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sat, 15 May 2021 00:36:13 +0300 Subject: [PATCH] Kernel: Swap baud rate divisor registers in SerialDevice::set_baud These were accidentally the wrong way around (LSB part of the divisor into the MSB register, MSB part of the divisor into the LSB register) as can be seen in the specification (and in the comments themselves) --- Kernel/Devices/SerialDevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/Devices/SerialDevice.cpp b/Kernel/Devices/SerialDevice.cpp index a2dff8d8f8..aa25c4bb66 100644 --- a/Kernel/Devices/SerialDevice.cpp +++ b/Kernel/Devices/SerialDevice.cpp @@ -87,8 +87,8 @@ void SerialDevice::set_baud(Baud baud) m_baud = baud; IO::out8(m_base_addr + 3, IO::in8(m_base_addr + 3) | 0x80); // turn on DLAB - IO::out8(m_base_addr + 0, ((u8)(baud)) >> 2); // lower half of divisor - IO::out8(m_base_addr + 1, ((u8)(baud)) & 0xff); // upper half of divisor + IO::out8(m_base_addr + 0, ((u8)(baud)) & 0xff); // lower half of divisor + IO::out8(m_base_addr + 1, ((u8)(baud)) >> 2); // upper half of divisor IO::out8(m_base_addr + 3, IO::in8(m_base_addr + 3) & 0x7f); // turn off DLAB }