NetMos 9865 || 6 x serial port PCI card || What is /lib/modules/$(uname -r)/build ?
I have the card SD-PCI15008:
http://www.syba.com/index.php?contro...on=Info&Id=819 It's a serial port PCI card with 6 ports. As you can see on the website, the manufacturer says that it's compatible with Linux. Looking at the card in more detail, I see a chip with the following written on it: MOSCHIP SEMICONDUCTOR MCS9865IV-AA Here's some info on my system. $uname -srvmo says the following: Code:
Linux 2.6.26-2-686 #1 SMP Sun Jul 26 21:25:33 UTC 2009 i686 GNU/Linux If I compare the output of lspci with and without the card inserted, then with the card inserted I get the following three extra lines: Code:
03:01.0 Serial controller: NetMos Technology Device 9865 Code:
03:01.0 Serial controller: NetMos Technology Device 9865 (prog-if 02 [16550]) According to lsmod, the same kernel modules are present with or without the card installed. There are no extra ones when the card is there. Now I'm not all that well experienced with communicating with serial ports, but I'm just doing a few basic tests like looking for /dev/ttyS*. I get the following: Code:
$ls /dev/ttyS* So this gives two options. I can either look for a driver that Debian might magically provide by apt-get/aptitude or I could install the driver from source that comes on a CD with the card. Having had no luck looking with Debian's "apt-cache search" for packages with names that I was trying to guess, I'm planning to install the driver from the source code. The card comes with a CD that has some source code in it and some instructions. In this CD that came with the card, there's the following statement: "This driver is currently developed and tested on 2.6.11 linux kernel and above." That can be interpreted as good or also perhaps bad considering 2.6.11 isn't really all that recent, but I'm heartened slightly by the fact that the card is very recently purchased. Anyway, on the CD there's a directory with all the code needed to install this driver. The instructions are really straightforward. All you have to do is use "make" and then "insmod" and then you're done, or alternatively use "make install". In the Makefile, it defines a directory: Code:
KDIR:=/lib/modules/$(shell uname -r)/build/ Code:
default: Do other people have /lib/modules/$(uname -r)/build ? If there's any suggestions on other information that I can provide, or on how to proceed, then they would be much appreciated. Thanks. |
I found the following to be interesting:
http://linux.derkeiler.com/Mailing-L.../msg01241.html Just use "apt-file search" and this tells you how to get a certain file installed on your system. Pretty handy. Hopefully this will give me what I need to be able to proceed. EDIT ==== So I was able to get it to work. In the end it wasn't too bad once I installed the Debian package linux-headers-2.6.26-2-686, which is the package that creates the directory /lib/modules/$(uname -r)/build If you are using an rpm-based distro then you can use "yum provides" instead of "apt-file search", as shown here: https://help.ubuntu.com/community/Sw...LinuxAndFedora If anyone else is going to use this card, then there are a few things worth mentioning. 1) Hang on to the CD that comes with the card. The driver software comes on the CD, and if you want it to work, then chances are good you'll need the driver. If you lost the CD, then supposedly it's also available at www.moschip.com. 2) The CD's got a bunch of other drivers on it. On my CD, the driver was located at cd-root-directory/Moschip/MCS9865/Linux/ So just look for files with "9865" in their name and you should find it. Then in that directory are files like mcs9865.c and several others along with a readme and a .doc that explain how to go about installing the driver. 3) So just follow the directions. 4) When running 'make', I came across one issue. I got an error saying that SA_SHIRQ is undeclared. Fortunately for me, I came across the explanation at http://linmodems.technion.ac.il/biga.../msg00710.html which prompted me to rename SA_SHIRQ in mcs9865.c to IRQF_SHARED. Once I did that, everything compiled. The output of the make command looked like: Code:
rm -f *.mod.c *.o *.ko .*.cmd *.symvers Code:
ln: creating symbolic link `/etc/rc.d/rc3.d/Smcs9865': No such file or directory 6) Then there will be ttyS0, ttyS1, ttyS2, ttyS3, ttyD0, ttyD1. ttyD? previously did not exist, and ttyS? previously did not work. On mine, ttyS0,1,2,3 are labeled as cables 3,4,5,6 respectively while ttyD0,1 are labeled as cables 1,2 respectively. 7) Get a null modem cable and hook up one end to the cable corresponding to /dev/ttyS0, then hook another up to the cable corresponding to /dev/ttyS1. You can get null modem mini adapters that would be suitable for this. http://www.winfordeng.com/products/mgcnm.php Once you've got them connected with a null modem adapter, then do the following. In a shell type: #cat > /dev/ttyS1 In a root shell type : #echo "hello" > /dev/ttyS0 If all is well then you might see "hello" appear from stdout of the shell that's catting /dev/ttyS1. A better way to test it is probably to use the command cu which comes in packages with names like uucp. There's also the command minicom. |
I have the same board and have followed your instructions, but I'm only getting the first two serial ports (D1 and D2) to work. The others don't work for me.
What's your output for the following? root@ubuntu:/home/mh/Desktop/MCS9865_Linux# setserial -g /dev/tty[SD]* I also noticed that in the output of "lshw", the third portion defining those ports seems wrong. Is yours UNCLAIMED, too? From "lspci -v": 03:05.0 Serial controller: NetMos Technology PCI 9865 Multi-I/O Controller (prog-if 02) |
I'll be happy to see if I can help you out.
Since getting the first one working, I actually tried to use a second in the same computer, to see if I could get 12 serial ports going at once. I was able to get /dev/ttyD2 and /dev/ttyD3 going by just inserting the second card, but that's it so far. It might just be that the driver wasn't designed for two cards, not sure. Anyway, that's neither here nor there for your issue. The second card isn't in there right now so we don't have that distraction. Here's the output you were wondering about: Code:
# setserial -g /dev/tty[SD]* Code:
# lshw Let me know if there's anything else I can provide you with. |
I don't use Debian, however both posters to this thread may find some useful information in another thread I took part in a while back. It deals with the file /etc/serial.conf (that's what it's called on my Slackware system; it *could* have a different name on your systems, but I think it should be very similar or the same).
Anyhow, that file allows you to configure all of your serial ports specifically, for which tty**, which IRQ, which address registers, etc. Note that possibly the `setserial` command can also/probably set some/all these items for you, so it may come down to personal preference. Anyhow, here are a link or two, just in case it helps: This post Here. And This Thread Here. PS - @ Chadwick -- have you considered adding your serial card device to LQ's HCL? If it isn't there yet, that'd be a good addition :) And also -- the /lib/modules/`uname -r`/build folder exists on everyone's Linux system, if they have the kernel-source-code installed and have built their kernel from that source-code. I believe it is usually actually a symlink to the kernel source folder. Some systems, like maybe Debian (I'm not familiar with that) may arrange for this folder to me "created" during the installation of the OS, but generally, it's created when you build your kernel. Sasha |
With the driver installed, here's what I see using lspci -v
Code:
05:00.0 Serial controller: NetMos Technology Device 9865 (prog-if 02 [16550]) Do you just use Code:
#make Code:
#make uninstall |
id628, I assume the last two lines of your lspci -v were probably just cut off, or were the last two lines that show up in mine actually not there in yours?
|
Quote:
Quote:
Quote:
|
just got the NetMos SY-PCI5004 (MCS9865 chip)
downloaded the driver from here: http://www.iocrest.com/products.php?...379e6e46964857
had to patch up mcs9865.c as stated (thanks everyone for posting information), so here are some notes on what I did: Change into the source folder and do something like: Code:
$ cp mcs9865.c mcs9865.c_orig Code:
# insmod ./mcs9865.ko <patched removed as it contained carriage returns, check post 20 instead> |
(restating for opensuse)
as far as /lib/modules/$(uname -r)/build, on opensuse 11.2 it is a symlink: $ ls -l /lib/modules/$(uname -r)/build lrwxrwxrwx 1 root root 46 2009-11-19 21:18 /lib/modules/2.6.31.5-0.1-desktop/build -> /usr/src/linux-2.6.31.5-0.1-obj/x86_64/desktop This symlink was broken until I installed kernel-desktop-devel (which also installed kernel-source and linux-kernel-headers) |
1 Attachment(s)
had to change more for 2.6.32-rc5. i have done a short test and it worked fine
also this card worked with xen hypervisor, referring to earlier dmesg |grep ttyD output I added the following on the xen grub line com1=19200,8n1,0xe480,17 console=com1 |
I am having a real headache trying to install a MosChip MC9865 6 port serial card in my openSUSE 11.2 machine.
I'm pretty new to linux, so I'm trying to understand what I am missing. We'll start backwards.. When I try and MAKE (using the files off of the mini-cd that came with the card) here is the output: Code:
linux-zitz:/home/Phil/Documents/MosChip9865 # make I've installed the Kernel Dev-Lev files in YAST. I also rebooted the computer. Here is my dmsg grep: Code:
linux-zitz:/home/Phil/Documents/MosChip9865 # dmesg|grep tty Code:
02:08.0 Serial controller: NetMos Technology PCI 9865 Multi-I/O Controller (prog-if 02 [16550]) |
The make output shows that the source code hasn't been patched yet. Try the patch in post #9.
|
Hi Liquid Squelch,
I don't remember ever coming across the error that you see when you try to compile the driver. I don't know offhand if the struct uart_info is defined in a header file that's supposed to come with your OS or if it's defined in the code that comes on the cd. Chances are good that it's something that comes with your OS. Perhaps the names of the member variables of the struct uart_info depend on the version of a certain set of files. If that's the case, then we would have to figure out what versions of these files you need to use. I am not a hardware expert, and in my case I was probably just lucky that it worked. So it might be a good idea to start out by finding out where struct uart_info is defined. EDIT: I hadn't yet seen dblade's reply where he says his patch will fix it. Probably a better idea to start with that then. |
So did anyone succed in using all 6 ports of the controller?I am having trouble getting past the 2 on the board.
The suspicious part in dmest is this Code:
[ 209.283549] 0000:03:06.2: ttyS1 at I/O 0xe000 (irq = 23) is a 16550A |
All times are GMT -5. The time now is 02:48 PM. |