5

On FreeBSD, I'm looking for a way to list serial communication devices.

The computer has two of them installed: An on-board serial console (ttyS0), and an internal analog modem.

I can find out about the internal modem with pciconf:

# pciconf -lbcevV pci0:5:8:0
none0@pci0:5:8:0:   class=0x078000 card=0x8d881043 chip=0x270214f1 rev=0x01 hdr=0x00
    vendor     = 'Conexant Systems, Inc.'
    class      = simple comms
    bar   [10] = type Memory, range 32, base 0xd1000000, size 65536, enabled
    bar   [14] = type I/O Port, range 32, base 0xa800, size 8, enabled
    cap 01[40] = powerspec 2  supports D0 D3  current D0

So that's clearly the modem, I can tell by the vendor ID, which is consistent with the chip on my Conexant RD01-D270 internal analog modem.

dmidecode -t connector lets me find this:

Handle 0x000F, DMI type 8, 9 bytes
Port Connector Information
    Internal Reference Designator: COM1
    Internal Connector Type: 9 Pin Dual Inline (pin 10 cut)
    External Reference Designator:  
    External Connector Type: DB-9 male
    Port Type: Serial Port 16450 Compatible

So this is clearly the on-board serial interface.

The problem is this: which devices are they? I can assume rather safely, that the on-board serial interface is /dev/ttyS0, but that is just a guess. Actually, since this is FreeBSD, it'll be /dev/console, probably. But which one is the modem? I assume this would be a serial console or dialer, which would be /dev/cuau0, this is - again - just a guess, though.

Is there a reliable way to find this out, without guessing, etc?

  • Chapter 26 § 2 of the FreeBSD Handbook should help you clear up the ("guess", "assume", "probably") device naming part of your question, making it clearer that you aren't asking about the names but the assignment order(s) of minor device numbers to physical devices. – JdeBP Apr 4 '15 at 10:46
  • @JdeBP With the manual, I've checked dmesg and it reports a single uart0 device. in /boot/device.hints, two UART interfaces are hinted, but they're both "at isa", which is a little odd to me, as one is on-board, the other is on PCI. Furthermore, dmesg reports pci5: <simple comms> at device 8.0 (no driver attached) I guess that would be the modem, but how can I attach a driver to that? – polemon Apr 4 '15 at 17:11
1

You're not seeing a driver for that modem in dmesg because one isn't loaded, which likely means that FreeBSD doesn't have one for it. This in turn is because that modem uses the CX11252-15 chipset and is not a hardware modem, but a "softmodem" or "winmodem" with closed-source drivers. FreeBSD does not include out of the box support for any winmodems.

Also, the 'isa' bit is not as strange as you might think. Many (most? all?) PCs still have an internal PCI-ISA bridge for legacy device support. Onboard modems and serial ports, PS2 kb/mouse, the RTC, and so on all fall into this category.

1

Use pstat(8). It will show you all the terminals, from which you can then subtract the virtual terminals (ttyv*) and ptys, leaving the serial ones - in this case ttyu0 and ttyu1, as documented in uart(4):

% pstat -t
      LINE   INQ  CAN  LIN  LOW  OUTQ  USE  LOW   COL  SESS  PGID STATE
     ttyu0     0    0    0    0     0    0    0     0     0     0 IC
     ttyu1     0    0    0    0     0    0    0     0     0     0 IC
     ttyv0  1920    0    0  192  1984    0  199 37695 87297 87297 Oicl
     ttyv1  1920    0    0  192  1984    0  199     7   852   852 Oil
     ttyv2  1920    0    0  192  1984    0  199     7   853   853 Oil
     ttyv3  1920    0    0  192  1984    0  199     7   854   854 Oil
     ttyv4  1920    0    0  192  1984    0  199     7   855   855 Oil
     ttyv5  1920    0    0  192  1984    0  199     7   856   856 Oil
     ttyv6  1920    0    0  192  1984    0  199     7   857   857 Oil
     ttyv7  1920    0    0  192  1984    0  199     7   858   858 Oil
     ttyv8     0    0    0    0     0    0    0     0     0     0 -
     ttyv9     0    0    0    0     0    0    0     0     0     0 -
     ttyva     0    0    0    0     0    0    0     0     0     0 -
     ttyvb     0    0    0    0     0    0    0     0     0     0 -
     pts/1  1920    0    0  192  1984    0  199 99999   874   882 Oi
     pts/3  1920    0    0  192  1984    0  199   104 79048 79048 Oi
     pts/2  1920    0    0  192  1984    0  199     3 19896 32414 Oi
     pts/4  1920    0    0  192  1984    0  199    38 46538 46538 Oi
     pts/0  1920    0    0  192  1984    0  199 65737 50951 50956 Oil
     pts/5  1920    0    0  192  1984    0  199     0 50987 50993 Oi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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