Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
the project I'm doing needs a lot of serial ports. I have 2 on the motherboard, but they were used up very fast. I got a 6 serial port pci card to use, totaling at 8 serial ports. all I knew about the card was that it supports linux. I go into the readme files on the drivers cd and it says "Since Linux only support 4 serial ports (ttyS0, ttyS1, ttyS2, ttyS3) under the default condition." okay.. how do I change that in linux? I need all 8 ports available, not just the first 4. I'm currently running fedora 7 on my development machine, but I might be using centos for the final server setup. any help would be great. I've been searching, but not finding what I'm looking for. I may be searching with the wrong keywords.
I disabled the on board serial ports to simplify things a bit more. I'm not sure if linux enables them again on it's own, but either way, I have ttyS0 ttyS1 ttyS2 ttyS3 . tty isn't a directory so I can't go in it. I'm not sure what it is on this system. if all of the serial ports were working, there should be 6 of them, plus the 2 on board that are disabled. is there a setting in the kernel for this or something? to allow more then 4 ports?
I have a simple program I wrote in c to send commands to a serial port. it was working well with the onboard ports, but now that I disabled those and only have the card installed, it's failing to open ports. I have tried the setserial command, but I'm still learning a lot with linux. not sure what I could be doing wrong, but something's not right.
with the onboard disabled and the card installed what o you get from teh following command ? (curious to see what the OS thinks of those ports at boot time)
Quote:
debianetch:/# cat /var/log/dmesg | grep ttyS
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:08: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
looks like it sees only 4 ports. there has to be a setting someplace or a patch or kernel module to allow the other 4 ports to work.
[root@localhost ~]# cat /var/log/dmesg | grep ttyS
0000:02:0c.0: ttyS0 at I/O 0xdff0 (irq = 9) is a 16550A
0000:02:0c.0: ttyS1 at I/O 0xdfe0 (irq = 9) is a 16550A
0000:02:0c.0: ttyS2 at I/O 0xdfa8 (irq = 9) is a 16550A
0000:02:0c.0: ttyS3 at I/O 0xdfa0 (irq = 9) is a 16550A
this is the command I tried:
mknod /dev/ttyS4 -m 666 c 4 64
it looks like it created it under /dev and my c program can open the port and write to it without errors, but I'm still not getting any output out of the physical port. I don't understand what the major and minor numbers are for. 4 and 64? is that what they should be to point to the right hardware?
ttyS[0-3] are character devices for the serial terminal lines.
They are typically created by:
mknod -m 660 /dev/ttyS0 c 4 64 # base address 0x3f8
mknod -m 660 /dev/ttyS1 c 4 65 # base address 0x2f8
mknod -m 660 /dev/ttyS2 c 4 66 # base address 0x3e8
mknod -m 660 /dev/ttyS3 c 4 67 # base address 0x2e8
chown root:tty /dev/ttyS[0-3]
The "major" number is always 4 for ttyS devices.
For ttyS serial ports the minor number is: 64 + port number.
so you need to use 68, 69, 70 & 71 when adding the additional ports
MAKEDEV may be easier to use than mknod
man MAKEDEV
MAKEDEV ttyS4
MAKEDEV ttyS5
MAKEDEV ttyS6
MAKEDEV ttyS7
ooh, thank you for explaining that. now it sounds like it will work. I'm just finishing up a fresh install of centos on my development system. I will try it and let you know how it goes.
btw, I used mknod because MAKEDEV wasn't installed. I will check yum for it and see if I can install it.
centos found the serial card and installed all 8 ports, including the 2 on the motherboard I'm guessing. I haven't tried the motherboard 2 lately, but the ports on the card aren't giving any errors when I open them or send data to them, but the device I'm using has a led on it that turns on or off when it gets a command, and it's not working yet. the device has to run at 9600 baud rate. I think that might be where the problem is. maybe this card gets it's settings differently or something. I still don't understand c completely yet, but I'll keep working at it. tomorrow I'll try connecting the ports on the card to my windows computer and see if I can get any signals with the hyperterminal.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.