# Multiport Serial Card doesn't Work Under FreeBSD 8?



## Hengist (Feb 24, 2010)

I work with a local school, and several of the local kids have really gotten into Unix. Specifically, they're big fans of the old "heavy iron" approach to computing, so we've built a FreeBSD server system with four serial-connected terminals. Specifically, we've gotten our hands on an old VT100, two LSI ADM 5, and an old laptop. I've verified that all four terminals are indeed working.

Most modern motherboards don't include RS-232 serial ports, so I bought this little baby from Newegg. It's a SYBA PCI 4-port serial card, model SD-PCI-4S. Under the hood, it uses the NM9845 chipset.

The system runs FreeBSD 8.0 AMD64. pciconf -vl reports the card  as:

```
puc0@pci0:4:0:0:        class=0x070002 card=0x00041000 chip=0x98459710 rev=0x01 hdr=0x00
    vendor     = 'MosChip Semiconductors (Was: Netmos Technology)'
    device     = '4 serial, 1 parallel port PCI card (NM9845CV)'
    class      = simple comms
    subclass   = UART
```

I have puc(4) compiled into the kernel, which reports it as 

```
puc0: <NetMos NM9845 Quad UART and 1284 Printer port> port 0xec00-0xec07,0xe880-0xe887,0xe800-0xe807,0xe480-0xe487,0xe400-0xe407,0xe080-0xe08f irq 16 at device 0.0 on pci4
puc0: [FILTER]
```
 in dmesg.

Unfortunately, no serial device entries can be found. sio(4) doesn't compile on amd64, but I've seen posts saying that uart(4) works with this chipset. Unfortunately, when I compile in or kdload uart, nothing detects.

Me and my students would be very greatful for any advice in getting this card to work.


----------



## trev (Feb 27, 2010)

Unfortunately I can't help with your specific PCI card, but on the topic of adding serial ports to FreeBSD systems with few/no serial ports onboard, I've had very good luck with the lindy.com.au (lindy.com for the US) USB to serial devices.


```
uhub4: <ALCOR Generic USB Hub, class 9/0, rev 1.10/3.12, addr 3> on uhub0
uhub4: 4 ports with 4 removable, self powered
ugen0: <FTDI USB HS SERIAL CONVERTER, class 0/0, rev 1.10/4.00, addr 4> on uhub4
ugen1: <FTDI USB HS SERIAL CONVERTER, class 0/0, rev 1.10/4.00, addr 5> on uhub4
ugen2: <FTDI USB HS SERIAL CONVERTER, class 0/0, rev 1.10/4.00, addr 6> on uhub4
ugen3: <FTDI USB HS SERIAL CONVERTER, class 0/0, rev 1.10/4.00, addr 7> on uhub4
uhub5: <Apple Inc. BRCM2046 Hub, class 9/0, rev 2.00/1.00, addr 2> on uhub2
uhub5: 3 ports with 0 removable, self powered
...
ugen2: at uhub4 port 3 (addr 6) disconnected
ugen2: detached
ugen2: <FTDI USB HS SERIAL CONVERTER, class 0/0, rev 1.10/4.00, addr 6> on uhub4
ugen3: at uhub4 port 4 (addr 7) disconnected
ugen3: detached
ucom0: <FTDI USB HS SERIAL CONVERTER, class 0/0, rev 1.10/4.00, addr 7> on uhub4
ucom1: <FTDI USB HS SERIAL CONVERTER, class 0/0, rev 1.10/4.00, addr 6> on uhub4
...
crw-------  1 root  wheel       0, 114 Feb 27 18:14 ttyU0
crw-------  1 root  wheel       0, 115 Nov 30 20:55 ttyU0.init
crw-------  1 root  wheel       0, 116 Nov 30 20:55 ttyU0.lock
crw-------  1 root  wheel       0, 120 Feb 27 18:14 ttyU1
crw-------  1 root  wheel       0, 121 Nov 30 20:55 ttyU1.init
crw-------  1 root  wheel       0, 122 Nov 30 20:55 ttyU1.lock
crw-------  1 root  wheel       0,  67 Feb 27 18:15 ttyU2
crw-------  1 root  wheel       0,  88 Nov 30 20:56 ttyU2.init
crw-------  1 root  wheel       0,  97 Nov 30 20:56 ttyU2.lock
```

FreeBSD 7.2-STABLE i386 (Nov 2009)
Apple Mac Mini (2009 model)

It all worked without my doing anything other than plugging it in 

I've also had good luck with generic PCI serial cards with an Oxford chipset eg


```
puc0: <Oxford Semiconductor OX16PCI954 UARTs> port 0xcf00-0xcf1f,0xce00-0xce1f mem 0xfddff000-0xfddfffff,0xfddfe000-0xfddfefff irq 20 at device 6.0 on pci3
puc0: [FILTER]
uart0: <16550 or compatible> on puc0
uart1: <16550 or compatible> on puc0
...
crw-------  1 root  wheel       0,  42 Feb 22 23:36 ttyu0
crw-------  1 root  wheel       0,  43 Feb 22 23:36 ttyu0.init
crw-------  1 root  wheel       0,  44 Feb 22 23:36 ttyu0.lock
crw-------  1 root  wheel       0,  48 Feb 22 23:36 ttyu1
crw-------  1 root  wheel       0,  49 Feb 22 23:36 ttyu1.init
crw-------  1 root  wheel       0,  50 Feb 22 23:36 ttyu1.lock
```

FreeBSD 7.2-STABLE amd64 (Aug 2009)
Gigabyte MA790X-DS4 motherboard

Admittedly I had to patch the pucdata.c file in the beginning, but my PR was recently incorporated, so it's no longer an issue.


----------



## Hengist (Feb 28, 2010)

I'll try asking this question to the FreeBSD mailing lists. Thanks for your help.


----------



## varda (Mar 6, 2010)

NM9845 chip supported just fine and I'm successfully used 2-3 6x serial PCI cards based on this chip.

You can follows two ways. Rebuild kernel with puc, uart and sio in kernel.

Use for test generic kernel which already includes uart and sio devices in kernel config. But rebuild puc driver finding and modifing lines in /usr/sys/conf/files before recomiling it:

```
dev/uart/uart_bus_puc.c         optional        uart puc
dev/sio/sio_puc.c           optional        sio puc
```
by removing trailing 'puc' to:
	
	



```
dev/uart/uart_bus_puc.c         optional        uart
dev/sio/sio_puc.c           optional        sio
```
Then you can 
	
	



```
kldload puc
```
 or add to /boot/loader.conf 
	
	



```
puc_load="YES"
```
 in order to link puc driver with uart ports. Then you'll have and can use /dev/ttyu* and /dev/cuau* ports.


----------

