瀏覽代碼

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)
Idan Horowitz 4 年之前
父節點
當前提交
be57c424f3
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Kernel/Devices/SerialDevice.cpp

+ 2 - 2
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
 }