by checking the serial folder @: \drivers\tty\serial
There are many different serial port drivers there, which one is for x86?
There is no single UART chip for x86.
The IBM PC originally used the 8250, later it began customary to replace it with the 16550 and later with the 16750.
With the advent of SuperIO chips each manufacturer had their implementation of the UART but all were more or less compatible with the 16550/750 and the 8250.
Today chipsets usually have one ore more 16750 UARTs integrated in the PCH but they don't have an external socket, so a lot of USB/PCI third-party serials are present in the market.
In the end, the driver depends on the UART chip.
If you are interested in the integrated UART (with the socket on the back of your PC), the driver is probably in the 8250 folder unless your chipset uses a different UART chip.
@Margaret Bloom has a great answer. An 8250/16550-compatible UART is the base for normal x86 PCs, and is integrated into the northbridge/southbridge ICH/PCH chipsets. As was pointed out, this does not mean the integrated UART is used; there are third-party serial cards that can be added (see below for the Maxim MAX310x serial driver.)
So, how can you tell what's being used? Here's some commands from a QEMU session running debian 10:
q35ek:511> ls -l /dev/ttyS0
crw------- 1 dave tty 4, 64 Feb 2 12:09 /dev/ttyS0
q35ek:512> sudo cat /proc/tty/driver/serial | egrep '^0:'
0: uart:16550A port:000003F8 irq:4 tx:11291 rx:18 RTS|CTS|DTR|DSR|CD
q35ek:513> sudo cat /proc/tty/drivers
/dev/tty /dev/tty 5 0 system:/dev/tty
/dev/console /dev/console 5 1 system:console
/dev/ptmx /dev/ptmx 5 2 system
/dev/vc/0 /dev/vc/0 4 0 system:vtmaster
ttyprintk /dev/ttyprintk 5 3 console
max310x /dev/ttyMAX 204 209-224 serial
serial /dev/ttyS 4 64-111 serial
pty_slave /dev/pts 136 0-1048575 pty:slave
pty_master /dev/ptm 128 0-1048575 pty:master
unknown /dev/tty 4 1-63 console
q35ek:514>
The first command finds the major/minor number of the tty you're interested in.
The second finds info about the driver: it's a uart:16550A (the 'A' model has a character fifo), it's on IO port 0x3F8 and uses IRQ 4, tx and rx character counts and lastly the available control options.
The third shows the matching drivers for each device. 4:64 uses the serial
driver_name. Some developers are not great about uniquely defining the driver_name so this could be either the 8250/16550-compatible device (under $K/drivers/tty/serial/8250
), a DECstation DZ chip or a GRLIB uart. I'm going out on a limb and saying it's an 8250/16550 interface as shown by the following code snippet:
static struct uart_driver serial8250_reg = {
.owner = THIS_MODULE,
.driver_name = "serial",
.dev_name = "ttyS",
.major = TTY_MAJOR,
.minor = 64,
.cons = SERIAL8250_CONSOLE,
};