Hack #77. Break the Rules with COM Ports

Allow more than two COM ports to work simultaneously without conflicts.

We don't seem to use COM ports very much these days, but even new USB-connected devices emulate the tried-and-true methods of serial communications in today's technology. The plain old serial port is still imperative for communicating with most of the devices that make the Internet possible: modems, routers, switches, and headless servers.

In the design of the original PC, IBM created a deliberate conflict between COM ports that has never been resolved through any change of standards or design. The conflict is the IRQ assignments for COM1 and COM3, which both use IRQ4, and COM2 and COM4, which both use COM3. Apparently IBM never thought anyone would want to use more than two COM ports at the same time: you cannot use COM1 and COM3 at the same time, nor COM2 and COM4 at the same time.

This conflict came to light as early online pioneers started running bulletin board systems with multiple modems to allow multiple users access at the same time. Early communications software relied on the system BIOS for many hardware I/O functions, and serial communications was one of them. The BIOS, of course, was hard-coded to adhere to strict rules, and COM port configuration and IRQs were encompassed by them.

As time passed, developers determined the BIOS functions were not the only or best way to get the hardware to do what they wanted. Flexibility in software and hardware configurations ...

Get PC Hacks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.