Hi,
I have a serial card (RS422) sold by StarTech.com (PCI2S3851050) that uses the SystemBase SB16C1052PCI chip for pci interface and serial output. I installed the card in my Leap x86_64 system and, as far as I can tell, it was not recognized. The card did come with a Linux 2.6 driver so I thought I would try to build a module for the OS that I could then load (or that would load automatically). I have read the document “Compiling Kernel Modules” (https://linux.die.net/lkmpg/x181.html) but this document seems to refer to a module build process that has been changed with newer Linux versions. I have had quite a bit of experience writing device drivers but never for linux.
Could someone direct me to some documentation that would describe how I would build and install a module for this card using my 2.6 code on my Leap system.
The build instructions should be included with your driver in a readme file. You’re best advised to detail the steps/commands you’ve taken so far, along with any errors etc. Is there an online source you can point to containing the driver? That might help others to advise further.
There really isn’t any build documentation other than the build files which are pretty cryptic. I have uploaded them to my web server for anyone to look at: http://www.northgatebowl.com/linux_2.6/ . I do think I could figure out how to build a module in linux 2.6 with a little work–some direction in Leap 42.2 would be helpful. If I get this module going, I would be happy to post the code. It is a fairly nice card, with a 256 byte FIFO, dual ports. I am using it to control some bowling alley equipment that needs an RS-422 connection.
I had a quick look at the code, and did encounter issues with building… the first of which was
make
make -C /lib/modules/4.1.34-33-default/build SUBDIRS=/home/dean/multiport modules
make[1]: Entering directory '/usr/src/linux-4.1.34-33-obj/x86_64/default'
CC [M] /home/dean/multiport/multiport.o
/home/dean/multiport/multiport.c:38:35: fatal error: linux/mca.h: No such file or directory
#include <linux/mca.h> //FEDORA 4
I’m not a programmer, but it is apparent from the age of the code that some significant changes will be required to get this to build successfully. I’ll leave other gurus to advise further about that.
BTW, I tweaked the Makefile to look like this before starting with an attempted ‘make’…
I did see the same documentation that you saw regarding the SystemBase chip being able to run on most linux versions–though it doesn’t appear to run on Suse Leap 42.2 (4.4.27-2-default). I did run the lspci command you suggested and it does show the bios has found the card but it doesn’t show any module controlling it. See below:
glaird@blanc:/dev> sudo lspci -nnk
…]
03:00.0 PCI bridge [0604]: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge [1b21:1080] (rev 04)
04:00.0 Serial controller [0700]: Systembase Co Ltd Device [14a1:4d02] (rev b0)
Subsystem: Systembase Co Ltd Device [14a1:4d02]
glaird@blanc:/dev>
I have been making some headway with a tutorial on building modules “The Linux Kernel Module Programming Guide” (http://www.tldp.org/LDP/lkmpg/2.6/html/lkmpg.html) which is quite informative. So, maybe I can fix simple things in the driver and get it to run.
If anyone else has any suggestions, that would be great!
Thanks!
Update: I did make some more attempts at correcting errors and recompiling the multiport driver software. I commented out some includes for files that no longer existed in the distribution with the thought that they might not be necessary or if they were necessary, I could figure out a work around (possibly just installing the .h file). That strategy didn’t really work that well as syntax errors cropped up that were not easy to understand.
So, then remembering the slogans that SystemBase had on their website: “SystemBase is working hard to be the best in the serial communication field in the world” and “We care for you”, I thought I would look to see if they actually had an updated driver for linux. And, sure enough, they did! Their version 21 driver for linux versions 2.6 through 4.4. I downloaded the driver (a shell script), logged in as root, ran the script, and in 2 seconds the driver was installed and the ports were active! I was stunned! No building modules or anything. The driver is installed somewhere–I am not sure where–but it is installed since when I reboot the ports are accessible. The module does not list when I use lspci -nnk; I don’t know what that means–I will try to figure this out.
So, for the moment, all is well with this little system in Salem, Oregon, USA.