Serial port is the term given to an RS-232 connector used to connect peripheral devices such as mice and modems to computers.
The serial port originally used a male DB25 connector (the same as used on parallel printer cables) however many of the signals were unused and later a smaller male DB9 connector was used instead.
While many motherboards and add-in cards that provide serial ports have a DB9 connector on-board, many have a 10-pin (2x5 pin) IDC/Dupont connector for additional ports. A DB9 or DB25 connector can be plugged in to these and the socket mounted either in an add-in slot, or in DB9/DB25-sized holes on the back of many computer cases.
Unfortunately the pinout for these connectors was never standardised, and two major variants are in use. Devices rarely indicate which variant they use, even when supplied with a manual. Most devices shipped with the correct cables so it would seem the manufacturers thought this was unnecessary (despite often including pinouts for things like ISA slots), however as cables have been lost over the years it is usually a matter of trial and error to find the correct connector to use today.
In this article we will label the two variants as Type-A and Type-B.
One option to find out which pin arrangement is in use is to connect the TX and RX lines together, then use a terminal emulator to send data to the port, and see whether the data comes back on the screen (being sure to disable 'local echo' first.) For Type-A ports, characters will appear on the screen when IDC pins 2 and 3 are connected together, and if characters only appear when IDC pins 3 and 5 are connected then the port uses the Type-B arrangement.
This connector uses a "straight through" arrangement. Pin 1 goes to pin 1, pin 2 goes to pin 2, and so on. Newer boards tend to use this arrangement (approximately since the Pentium 1 era).
This version has the PCB connector mirror the physical arrangement of the DB9 pins, so the top row of the IDC pins match the top row of the DB9 pins. However when using pin numbering, this arrangement appears more complex:
This style of wiring is much easier to manage when soldering to a DB25 connector, so this is most likely why it is used on earlier devices when DB25 serial ports were common. It is marginally easier to solder to a DB9 connector, but not by much.