Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Many new laptop and desktop computers do not have 9-pin/25-pin serial ports. Why do many Linux distributions still contain /dev/ttyS0, dev/ttyS1 device files?

Since udev can create the device files dynamically, why are /dev/ttyS0, /dev/ttyS1 still created statically? Each time I boot up, /dev/ttyS0 and /dev/ttyS1 are in there.

By the way: I am using Debian 7.0.

share|improve this question

2 Answers 2

up vote 31 down vote accepted

These /dev nodes appear because the standard PC serial port driver is compiled into the kernel you're using, and it is finding UARTs. That causes /sys/devices/platform/serial8250 (or something compatible) to appear, so udev creates the corresponding /dev nodes.

These UARTs are most likely one of the many features of your motherboard's chipset. Serial UARTs in the chipset are quite common still, even though it is becoming less and less common for a DB-9 connector to be attached to these IC UART pins.

On some motherboards, there is a header connector for each serial port, and you have to buy an adapter cable if you want to route that connector to the back of the PC:

10-pin header to DB-9M adapter cable

Other motherboards using the same chipset might not even expose the header connector, even though the feature is available in silicon, purely to save a bit of PCB space and a few cents for the header connector.

A few serial UARTs add negligible cost to a mass-produced PC chipset IC, whereas it adds a few dollars to the final retail cost of a motherboard to run a DB-9 connector out to the board edge. There is also a cost in PCB space; space at the board edge is especially precious.

There is no standard way to probe for the existence of a device connected to an RS-232 serial port.

Contrast USB, where the mere presence of a port on the motherboard doesn't cause a /dev node to be created, but plugging a device in does, because there is a fairly complex negotiation between the device and the host OS. In effect, the device announces itself to the OS, so udev can react by creating an appropriate /dev node for the device.

share|improve this answer
8  
I would also recommend mentioning, many laptop motherboards -do- have a serial controller, it is just not headed anywhere so cannot be used without disassembling the laptop and soldering onto test points, many manufacturers use this to do some basic checks on the production line to ensure a basic level of function in the motherboard before shipping. However as far as Linux is concerned this means there is a serial port and it instantiates it as could be expected for any board with a serial controller. –  Vality Apr 7 at 12:54
    
@Vality, do you know of any useful info on this - I access to a laptop that will be deemed obsolete tomorrow and is therefore ripe for (a) Linux, and (b) tinkering. –  Chris H Apr 7 at 13:18
    
@ChrisH Well it depends somewhat on the laptop, you will need to find a data sheet, or at least a hacking guide for the laptop's motherboard, depending on the model, some will have the correct layout to solder on a serial header easily though some cheaper boards just have some scattered test points about the board. If you are lucky and the earlier is the case you can just solder on a header, connect a cable to it, probably cut a little hole in your laptop for the socket to fit into then you will have a port. Remember though it will be 5 or 3.3 volts so don't use it as RS232. What laptop is it? –  Vality Apr 7 at 13:37
    
@Vality an acer netbook - don't have the exact model here - I was just wondering about general resources really, it will be a while before I get round to it - thanks. –  Chris H Apr 7 at 13:58
    
The issue is basic, conservative, backwards compatibility. Which is why people like Linux. You don’t “move fast & break things” in a kernel. Things only really need to change when there is a valid—and fairly universal—reason for the kernel to move forward. –  JakeGould Apr 7 at 21:44

Imagine running Linux under virtualization, many of the emulator still rely on outputting console to serial port. It's a convenient standard. Also, headless server still use serial port for communication.

share|improve this answer
    
But none of those are reasons why the device node is created. It is created because the device is there, as far as the kernel is concerned. If you disable the serial UART on CMOS it won't be. –  gnp Apr 10 at 20:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.