[syslinux] Enumeration of ISA serial ports inconsistent between Linux and Syslinux

Gene Cumm gene.cumm at gmail.com
Sun Oct 9 05:49:29 PDT 2016


On Sun, Oct 9, 2016 at 7:25 AM, Oliver Mangold via Syslinux
<syslinux at zytor.com> wrote:
> Hi,
>
> I would like to point out an issue with the enumeration of ISA serial
> devices in Syslinux. If I interpret the snippet below correctly, Syslinux
> looks up the device order with the BIOS, while Linux uses the fixed order
> 3F8,2F8,3E8,2E8.
>
> Note that this inconsistency is a real problem, as some motherboards (like
> e.g. a Supermicro X10DRi with default BIOS settings) have a different order
> stored in BIOS:
>
> ---
> # hexdump -s 0x400 -n 8 /dev/mem
> 0000400 02f8 03f8 0000 0000
> ---
>
>
> Best regards,
>
> Oliver
>
> --- /syslinux/core/include/bios.h ---
> #define SERIAL_BASE     0x0400  /* Base address for 4 serial ports */
> ...
> static inline uint16_t get_serial_port(uint16_t port)
> {
>      /* Magic array in BIOS memory, contains four entries */
>      const uint16_t * const serial_ports = (const uint16_t *)SERIAL_BASE;
>
>      /*
>       * If port > 3 then the port is simply the I/O base address
>       */
>      if (port > 3)
>          return port;
>
>      /* Get the I/O port from the BIOS */
>      return serial_ports[port];
> }
> ---

Excellent job digging up the differences.  Looks like the code comes
from commit ID c4fa331 but is much older.  The code comes from 7916325
which is derived from the ASM in beaaa4f.  It appears to me that it
was used to check the presence of a serial port and it was assumed the
order at that memory address would be consistent and either the proper
value or 0.

I'm trying to dig for some documentation like Ralph Brown's Interrupt
list.  Have you checked for firmware updates?  Have you tried
experimenting with redoing what serial port is assigned what IO base
address to make it consistent between Syslinux and Linux?

Alternatively, have you considered specifying the full IO address
instead of the low number (like "0x3F8")?


-- 
-Gene


More information about the Syslinux mailing list