Serial Port (very old card)

Status
Not open for further replies.

NASbox

Guru
Joined
May 8, 2012
Messages
650
I was thinking that adding a serial port to my FreeNAS would make life easier, and might eliminate the need to attach a monitor. I found an old dual serial card which I plugged in and tested under a live USB linux distro, and the dmesg recognized the card.

Here is the description of the card:
DSerial-PCI (PCI 2 port RS-232)
2-Port Serial Card (PCI Bus 16550)

  • [font=Courier10 BT, monospace]Adds two high-speed 16550 UART serial COM ports to any PCI-equipped PC[/font]
  • Both serial ports support up to 115.2 kbps throughput rate.
  • Both ports require only one system IRQ.
  • O/S automatically selects next available IRQ and COM addresses.
  • Easy Plug and Play installation.
  • Includes LAVA Com Port Redirect Utility for renaming COM Ports in Windows 95/98/Me.
  • Allows for backward compatibility with software that supports COM 1-4 only.
http://lavalink.com/serial-parallel-cards/products-pci-bus-io-cards/dserial-pci-pci-2-port-rs-232/
---

On the System / Advanced tab the following options are set as follows:
Use Serial Console:
Selected
Serial Port Address: 0x2f8 (No other choices available)
Serial Port Speed: 11500

---
On the System / Advanced tab I did a save/dump and found the following relevant info:

none3@pci0:7:0:0: class=0x070002 card=0x00000000 chip=0x01001407 rev=0x00 hdr=0x00
vendor = 'Lava Computer mfg Inc'
device = 'Lava Dual Serial'
class = simple comms
subclass = UART
bar [10] = type I/O Port, range 32, base 0xb100, size 256, enabled
bar [14] = type I/O Port, range 32, base 0xb000, size 256, enabled

---

Here's a sample of the DMESG with a few lines either side of the port.
[font=Courier10 BT, monospace]ahci0: AHCI v1.00 with 2 6Gbps ports, Port Multiplier supported with FBS
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich1: <AHCI channel> at channel 1 on ahci0
pcib6: <ACPI PCI-PCI bridge> irq 17 at device 28.5 on pci0
pci6: <ACPI PCI bus> on pcib6
pcib7: <ACPI PCI-PCI bridge> irq 17 at device 0.0 on pci6
pci7: <ACPI PCI bus> on pcib7
pci7: <simple comms, UART> at device 0.0 (no driver attached)
fwohci0: <VIA Fire II (VT6306)> port 0xb200-0xb27f mem 0xf7a00000-0xf7a007ff irq 18 at device 1.0 on pci7
fwohci0: OHCI version 1.10 (ROM=1)
fwohci0: No. of Isochronous channels is 4.
fwohci0: EUI64 00:34:2b:90:02:4f:3b:00
fwohci0: Phy 1394a available S400, 2 ports.
fwohci0: Link S400, max_rec 2048 bytes.[/font]

I get no output from the terminal.

Can someone give me some idea as to how I might get this working?


Thanks in advance for any input / advice / suggestions.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
There are lots of details to get a serial port working.

Example, my media servers, (old and new), have builtin serial ports and I have a network terminal server I use for remote console access. They run / ran Linux, so it's different that FreeBSD / FreeNAS, but some of the concepts are the same. Here are a list;
  • BIOS
  • Grub
  • Kernel commnd line in Grub, (this is for the kernel boot time messages)
  • Console login
My original media server did not support BIOS redirection to serial port, but I got all 3 of the others fixed. My new media server does support BIOS redirection to serial port, though I have not bothered to get it moved over.

Beyond that, I can't help since I don't know FreeBSD serial console setup.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
It's possible the user interface does not allow setting the serial port address other than the first and second serial port. These are usually built into the motherboard chipset, even if there are no connectors for them. I'll do some checking.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Okay, the GUI will show additional serial ports in that list if they have been detected. The FreeBSD kernel needs to detect the additional card first, provided the correct kernel driver has been loaded. I'm not sure which that is, thought it was included by default.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Tested in VirtualBox, but COM3/COM4 show up as motherboard serial ports. I don't know what driver to use for that card.
 

charlie89

Explorer
Joined
Dec 26, 2013
Messages
55
Please tell me, why on earth do you guys want to mess around with the ancient Serial Console?

It's 2017, you can use IPMI console redirection right in your browser with HTML5 (if you have recent firmware on your supermicro board, otherwise you need some Java plugin). If your motherboard doesn't include IPMI then it's time to get a new one - it's just too convenient.
That's why my FreeNAS Box hasn't seen a physical Monitor in the last 3 Years (and I even don't own a VGA monitor ;)).

Even if you would want to automate something (like a raspberry pi with a button triggering a new snapshot) you are way better off doing this via ssh.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
Please tell me, why on earth do you guys want to mess around with the ancient Serial Console?
Because you don't need the steaming pile of crap that is Java to use it?
 

charlie89

Explorer
Joined
Dec 26, 2013
Messages
55
Because you don't need the steaming pile of crap that is Java to use it?

As I already wrote, you dont need java any more with recent supermicro ipmi versions (i think since they named it redfish).
The java based console is still available, but they also include a HTML5 version ;)
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
you dont need java any more with recent supermicro ipmi versions
Yes, and if you're buying the latest-generation Supermicro gear, you'll get that. Anything older, though, and it isn't available, so you're stuck with Java.
 

NASbox

Guru
Joined
May 8, 2012
Messages
650
Tested in VirtualBox, but COM3/COM4 show up as motherboard serial ports. I don't know what driver to use for that card.

I didn't intend to start a flame war... answer is cost... I'll look at IPMI when I replace the CPU/MB in a few years. Serial would be nice to watch as much of the FreeNAS startup process as possible without attaching a monitor (IIUC... SSH isn't available till the system is fully up). The dmesg would seem to indicate that there's no driver installed:

pci7: <simple comms, UART> at device 0.0 (no driver attached)

Has FreeBSD removed serial support? It's a standard 16550 UART... linux picks it up out of the box - boot/use no problem.
Is it reasonable to add a driver to the system?
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
Has FreeBSD removed serial support?
Of course not. https://forums.freebsd.org/threads/30252/ has some related information. It might be that the PCI IDs from that card are just missing from the drivers...

Hmm:
Code:
  {  0x1407, 0x0100, 0xffff, 0,
  "Lava Computers Dual Serial",
  DEFAULT_RCLK,
  PUC_PORT_2S, 0x10, 4, 0,
  },

  {  0x1407, 0x0101, 0xffff, 0,
  "Lava Computers Quatro A",
  DEFAULT_RCLK,
  PUC_PORT_2S, 0x10, 4, 0,
  },

  {  0x1407, 0x0102, 0xffff, 0,
  "Lava Computers Quatro B",
  DEFAULT_RCLK,
  PUC_PORT_2S, 0x10, 4, 0,
  },

  {  0x1407, 0x0120, 0xffff, 0,
  "Lava Computers Quattro-PCI A",
  DEFAULT_RCLK,
  PUC_PORT_2S, 0x10, 4, 0,
  },

  {  0x1407, 0x0121, 0xffff, 0,
  "Lava Computers Quattro-PCI B",
  DEFAULT_RCLK,
  PUC_PORT_2S, 0x10, 4, 0,
  },

  {  0x1407, 0x0180, 0xffff, 0,
  "Lava Computers Octo A",
  DEFAULT_RCLK,
  PUC_PORT_4S, 0x10, 4, 0,
  },

  {  0x1407, 0x0181, 0xffff, 0,
  "Lava Computers Octo B",
  DEFAULT_RCLK,
  PUC_PORT_4S, 0x10, 4, 0,
  },

Note that none of those has 0x0000 as the device ID (second value). That might be a cloned card, copied from the original vendor, or it might just be a model that FreeBSD developers never had. Without that matching device ID, a driver does not attach.

Which leaves the question of what to do to fix that. Does that card say "P.N. Moko L71.3C"?
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
I ordered a used one of these cards, but won't have access to work with it for a couple of weeks. And there's no guarantee it will have the same card ID, but the chances are good. I'll test it and see.
 

NASbox

Guru
Joined
May 8, 2012
Messages
650
Of course not. https://forums.freebsd.org/threads/30252/ has some related information. It might be that the PCI IDs from that card are just missing from the drivers...

Hmm:
Code:
  {  0x1407, 0x0100, 0xffff, 0,
  "Lava Computers Dual Serial",
  DEFAULT_RCLK,
  PUC_PORT_2S, 0x10, 4, 0,
  },

  {  0x1407, 0x0101, 0xffff, 0,
  "Lava Computers Quatro A",
  DEFAULT_RCLK,
  PUC_PORT_2S, 0x10, 4, 0,
  },

  {  0x1407, 0x0102, 0xffff, 0,
  "Lava Computers Quatro B",
  DEFAULT_RCLK,
  PUC_PORT_2S, 0x10, 4, 0,
  },

  {  0x1407, 0x0120, 0xffff, 0,
  "Lava Computers Quattro-PCI A",
  DEFAULT_RCLK,
  PUC_PORT_2S, 0x10, 4, 0,
  },

  {  0x1407, 0x0121, 0xffff, 0,
  "Lava Computers Quattro-PCI B",
  DEFAULT_RCLK,
  PUC_PORT_2S, 0x10, 4, 0,
  },

  {  0x1407, 0x0180, 0xffff, 0,
  "Lava Computers Octo A",
  DEFAULT_RCLK,
  PUC_PORT_4S, 0x10, 4, 0,
  },

  {  0x1407, 0x0181, 0xffff, 0,
  "Lava Computers Octo B",
  DEFAULT_RCLK,
  PUC_PORT_4S, 0x10, 4, 0,
  },

Note that none of those has 0x0000 as the device ID (second value). That might be a cloned card, copied from the original vendor, or it might just be a model that FreeBSD developers never had. Without that matching device ID, a driver does not attach.

Which leaves the question of what to do to fix that. Does that card say "P.N. Moko L71.3C"?

Thanks very much for taking the time to look at this for me.

My card is VERY old ("P.N. Moko L71.0C"), but I'd be willing to bet that nothing much has changed from a software .

Looking at what you have copied and pasted above, I suspect that this is the current entry:

{ 0x1407, 0x0100, 0xffff, 0,
"Lava Computers Dual Serial",
DEFAULT_RCLK,
PUC_PORT_2S, 0x10, 4, 0,
},

I know almost nothing about BSD device drivers.
Where does this code come from? (Is it a config file somewhere, or is it from source that is compiled)?
Would it be feasible for me to just edit this file and change ' { 0x1407, 0x0100, 0xffff, 0,' to ' { 0x1407, 0x0000, 0xffff, 0,' to see if it works?
If so, what is the path/file on FreeNAS 11U3 that I would need to edit?

My FreeNAS currently has no data drives in it, so I have absolutely nothing to loose.
(Can I create a snapshot so I can revert back when I am done?)

I ordered a used one of these cards, but won't have access to work with it for a couple of weeks. And there's no guarantee it will have the same card ID, but the chances are good. I'll test it and see.

Anything I can do to help? If there is something I can run against this card, I'd be happy to do so. I could also send you dmesg from linux to identify the driver they use. My guess is that a knowledgeable person could look at the linux driver and make a correlation to a BSD driver.
 
Last edited:

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
That is code from the puc(4) driver, pucdata.c. I plan to install the card in a FreeBSD 11 system, modify the driver by adding another section with the 0x0000 card ID, then compile and see if it is detected. Unless the card I get is already detected because it has a different card ID. If you have a spare hard drive and want to test this on FreeBSD, you can, but it takes a bit to get set up to build from source. This currently cannot be done easily from inside FreeNAS.
 

NASbox

Guru
Joined
May 8, 2012
Messages
650
That is code from the puc(4) driver, pucdata.c. I plan to install the card in a FreeBSD 11 system, modify the driver by adding another section with the 0x0000 card ID, then compile and see if it is detected. Unless the card I get is already detected because it has a different card ID. If you have a spare hard drive and want to test this on FreeBSD, you can, but it takes a bit to get set up to build from source. This currently cannot be done easily from inside FreeNAS.

I would be very surprised if the card has an ID of zero. I can tell from photos that there have been (likely minor) engineering changes since my card was manufactured.

How many files does this change create? If it's a matter of replacing a hand full of files and rebooting I'd be willing to test. As for setting up to build from source that's a bit above where I'm at the moment.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Because you don't need the steaming pile of crap that is Java to use it?
And it's much more efficient than streaming a framebuffer from the server to a client, especially for storage.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
I would be very surprised if the card has an ID of zero.
Hm. But yours above does. Although actually, yours says chip=0x01001407... Hm.

Okay, one thing to try: in the console, kldload puc uart. Then check the pciconf -lv output again.
 

NASbox

Guru
Joined
May 8, 2012
Messages
650
Hm. But yours above does. Although actually, yours says chip=0x01001407... Hm.

Okay, one thing to try: in the console, kldload puc uart. Then check the pciconf -lv output again.

I ran the command you suggested from the shell in FreeNAS and I got the following error messages:

kldload: can't load puc: No such file or directory
kldload: can't load uart: No such file or directory

Did I do something wrong? I just selected item 9 Shell and then typed :
kldload puc uart

Does that mean there is no generic serial driver on FreeNAS11? As I recall Linux used a generic serial driver.
 
Last edited:

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
I'm sorry, I'm neck-deep in other projects. FreeNAS uses a modified version of a FreeBSD release. The kernel modules might be removed to save space.

FreeBSD does also use a generic serial driver (puc), but the card must be detected as something it knows.
 

NASbox

Guru
Joined
May 8, 2012
Messages
650
I'm sorry, I'm neck-deep in other projects. FreeNAS uses a modified version of a FreeBSD release. The kernel modules might be removed to save space.

FreeBSD does also use a generic serial driver (puc), but the card must be detected as something it knows.

Thanks for the attempt...maybe when you get the card you might get some insight and/or someone else might have something to offer.
 
Status
Not open for further replies.
Top