I need ttyS4 & 5, there's no MAKEDEV ans mknod doesn't work
SlackwareThis Forum is for the discussion of Slackware 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.
I need ttyS4 & 5, there's no MAKEDEV ans mknod doesn't work
As you might imagine, I have ttyS0 to ttyS3.
I tried to ./MAKEDEV from /dev but it's not there.
So I tried to mknod the two nodes:
mknod -m 660 /dev/ttyS4 c 4 68 ( and appropriately for ttyS5 ) which created two entities ttyS4 and ttyS5 but they're not drivers, and if I try setserial on them it says "No such device or address"
So I'm answering myself, but it's still not fixed.
I have 2.6 installed. I realized that /dev/ttyS0 to 3 are really /dev/tts/0 to 3, with symbolic links. Probably not new for most.
Anyways, have ttyS4 and ttyS5 linked to /dev/tts/4 and 5. Doing an ls -l on all the nodes, they look the sme as 1 to 3, but setserial still doesn't recognize ttyS4 and 5, so what I'm fearing is that I actually have to link some drivers into the kernel!! ACK
What's the process, without having to reload my whole configuration? I've never compiled a kernel. I suppose itshouldn't be all that hard, but have some doubts.
I can't do it on the final host, becasue I'm running in 512MB. It's an embeded PC104.
Can I compile on a bigger machine and load the kernel over to the final smaller host without upsetting the present configuration? Is that a silly question?
I think the driver should be the same as ttyS0 to S3. So I would need to install just those two modules.
If I understand right,I need a compiled kernel that is the same as the one I've got now, before I can be sure that any compiled module will install in "without problems"? Rewording the question, is there any way to avoid compiling the whoe kernel?
Final question. Is it about time I learned to compile a kernel?
I use the 2.4 kernel and have no experience with 2.6, therefore the following suggestion might not apply. But the following works with 2.4: edit /etc/serial.conf and then enabling /etc/rc.d/rc.serial as executable. The /etc/serial.conf would look something like this:
/dev/ttyS0 uart 16550A port 0x3F8 irq 4
/dev/ttyS1 uart 16550A port 0x2F8 irq 3
/dev/ttyS2 uart 16550A port 0x3E8 irq 4
/dev/ttyS3 uart 16550A port 0x2E8 irq 3
/dev/ttyS4 uart 16550A port 0x??? irq ?
/dev/ttyS5 uart 16550A port 0x??? irq ?
do you have your inittab edited to enable those ttys at the runlevel you are using?
Code:
# These are the standard console login getties in multiuser mode:
c1:1235:respawn:/sbin/agetty 38400 tty1 linux
c2:1235:respawn:/sbin/agetty 38400 tty2 linux
c3:1235:respawn:/sbin/agetty 38400 tty3 linux
c4:12345:respawn:/sbin/agetty 38400 tty4 linux
c5:12345:respawn:/sbin/agetty 38400 tty5 linux
c6:12345:respawn:/sbin/agetty 38400 tty6 linux
The getties were already there even though there were originally the first four in /dev
In serial.conf the firt four were tere but commented out, although the first four work anyways. Added ttyS4 and 5 but still nothing.
What's more, what I noticed is that after boot-up, the mknod of the 4 & 5 disappeared. (whether serial.cnf had 4 & 5 included or not ).
So it seems that 0 to 3 load and are ready despite what is done in the configs mentioned here, and 4 & 5 must not exist and are wiped out by the loaders.
I have been reading up a bit myself on this...
If you do as Woodsman said, and modify your /etc/serial.conf
then
modprobe 8250
(you should see 8250 and serial_core in lsmod at this point)
then
sh /etc/rc.d/rc.serial
what do you get?
or
setserial -a /dev/ttyS4
what type of serial device is it? I guess its an add-on card, what type?
First of all I thank you all for helping with this because I'm rather stuck.
serial.conf had:
#/dev/ttyS0 uart 16450 port 0x3f8 irq 4
#/dev/ttyS1 uart 16450 port 0x2f8 irq 3
and as you can see commented out. Even so ttyS0 to ttyS3 respond
So I added anyways:
/dev/ttyS2 uart 16850 port 0x100 irq 7
/dev/ttyS3 uart 16850 port 0x108 irq 7
/dev/ttyS4 uart 16850 port 0x110 irq 7
/dev/ttyS5 uart 16850 port 0x118 irq 7
after reboot
modprobe 8250 says:
Module 8250 not found
lsmod says: that the following modules are installed:
8139too, mii (used by 8139too), agpgart, psmouse, evdev
(no 8250 or serial_core )
But 4 serial ports work!
The add on card is GPS/GPRS carrier board with a quad uart, with a 16850.
The first two ports of this add on card work, once a setserial is given to change the uart and base baudrate.
I think it must have something to do with the rc.serial script. I tried to descipher it, but am still not up enough to be able to do so.
I'll cut and paste the script in a follwoing post.
Here's rc.serial
if I mknod and create the ttyS4 & 5 devs ( as described in earlier posts to the thread ) they don't survive the re-bot, so I'm not sure that rc.serial would see them, or perhaps rc.serial is what wipes them out
#
# /etc/rc.serial
# Initializes the serial ports on your system
#
# chkconfig: 2345 50 75
# description: This initializes the settings of the serial port
#
# FILE_VERSION: 19981128
#
# Distributed with setserial and the serial driver. We need to use the
# FILE_VERSION field to assure that we don't overwrite a newer rc.serial
# file with a newer one.
#
# XXXX For now, the autosave feature doesn't work if you are
# using the multiport feature; it doesn't save the multiport configuration
# (for now). Autosave also doesn't work for the hayes devices.
#
ALLDEVS="/dev/ttyS?"
if /bin/ls /dev/ttyS?? >& /dev/null ; then
ALLDEVS="$ALLDEVS /dev/ttyS??"
fi
SETSERIAL=""
if test -x /bin/setserial ; then
SETSERIAL=/bin/setserial
elif test -x /sbin/setserial ; then
SETSERIAL=/sbin/setserial
fi
#
# See if the serial driver is loaded
#
LOADED=""
if test -f /proc/devices; then
if grep -q " ttyS$" /proc/devices ; then
LOADED="yes"
else
LOADED="no"
fi
fi
#
# Find the serial driver
#
for i in $DIRS
do
if test -z "$MODULE" -a -f $i/$DRIVER.o ; then
MODULE=$i/$DRIVER.o
fi
done
if ! test -f /proc/modules ; then
MODULE=""
fi
#
# Handle System V init conventions...
#
case $1 in
start)
action="start";
;;
stop)
action="stop";
;;
*)
action="start";
esac
if test $action = stop ; then
if test -n ${SETSERIAL} -a "$LOADED" != "no" -a \
`head -1 /etc/serial.conf`X = "###AUTOSAVE###X" ; then
echo -n "Saving state of serial devices... "
grep "^#" /etc/serial.conf > /etc/.serial.conf.new
${SETSERIAL} -G -g ${ALLDEVS} >> /etc/.serial.conf.new
mv /etc/serial.conf /etc/.serial.conf.old
mv /etc/.serial.conf.new /etc/serial.conf
echo "done."
fi
if test -n "$MODULE" ; then
module=`grep $MODULE_REGEXP /proc/modules | awk '{print $1}'`
if test -z "$module" ; then
echo "The $DRIVER_NAME driver is not loaded."
rm -f ${RCLOCKFILE}
exit 0
fi
if rmmod $module ; then :; else
echo "The $DRIVER_NAME driver could NOT be unloaded."
exit 1;
fi
echo "The $DRIVER_NAME driver has been unloaded."
fi
rm -f ${RCLOCKFILE}
exit 0
fi
#
# If not stop, it must be a start....
#
if test -n "$MODULE" -a "$LOADED" != "yes" ; then
if insmod -f $MODULE $DRIVER_ARG ; then
true
else
echo "Couldn't load $DRIVER_NAME driver."
exit 1
fi
fi
if test -f /etc/serial.conf ; then
if test -n ${SETSERIAL} ; then
grep -v ^# < /etc/serial.conf | while read device args
do
if [ ! "$device" = "" -a ! "$args" = "" ]; then
${SETSERIAL} -z $device $args
fi
done
fi
else
echo "###AUTOSAVE###" > /etc/serial.conf
fi
In the mentioned $DIRS there are no modules The closest is "/lib/modules/`uname -r`/misc" (uname -r translates to 2.6.13). In /lib/modules/2.6.13 there's a modules.alias. Beyond that, in /lib/modules/2.6.13/kernel/drivers/serial there's a serial_cs.ko and other 8250_*.ko like fourport accent etc.
In rc.serial, I don't see where $MODULES is initialized. And I don't see how it can find a driver.
In the end rc.serial does a setserial -bg /dev/ttyS?,
where ttyS0 to ttyS3 are accepted and 4 and 5 say no such file or directory. If I manually mknod /dev/tts/4 & 5, and link to ttyS$ & 5, running rc.serial without rebooting gives me no such devie or address.
Anybody understand what's going on?
ttyS0 to ttyS3 work. the first two from the on board uart and the second two from the add on uart.
In the mentioned $DIRS there are no modules The closest is "/lib/modules/`uname -r`/misc" (uname -r translates to 2.6.13). In /lib/modules/2.6.13 there's a modules.alias. Beyond that, in /lib/modules/2.6.13/kernel/drivers/serial there's a serial_cs.ko and other 8250_*.ko like fourport accent etc.
In rc.serial, I don't see where $MODULES is initialized. And I don't see how it can find a driver.
The sequence
Code:
#
# Find the serial driver
#
for i in $DIRS
do
if test -z "$MODULE" -a -f $i/$DRIVER.o ; then
MODULE=$i/$DRIVER.o
fi
done
for a driver name which is then assigned to the MODULE variable. The section
Code:
#
# If not stop, it must be a start....
#
if test -n "$MODULE" -a "$LOADED" != "yes" ; then
if insmod -f $MODULE $DRIVER_ARG ; then
true
else
echo "Couldn't load $DRIVER_NAME driver."
exit 1
fi
fi
loads the driver.
You can look at what is already available by installing the kernel source and running make xconfig then looking in the serial tree for your adapter. If it is there, but not compiled it is possible to compile just the module and add it to the /lib/modules/2.6.13 tree. I can't remember the details of doing that. Otherwise, you're dependent on your vendor.
I saw your posts, but I am on a different track at the moment.
I assume you are using the 2.6.13 kernel supplied with 10.2
Firstly, as you will see below, the driver is compiled in (=y), so that is why there is no module, yet the first of your serial ports are working.
(taken from slackware's .config for the 2.6.13 kernel)
#
# Serial drivers
#
CONFIG_SERIAL_8250=y <--------here
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_CS=m
# CONFIG_SERIAL_8250_ACPI is not set
CONFIG_SERIAL_8250_NR_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
CONFIG_SERIAL_8250_FOURPORT=m
CONFIG_SERIAL_8250_ACCENT=m
CONFIG_SERIAL_8250_BOCA=m
CONFIG_SERIAL_8250_HUB6=m
#
# Non-8250 serial port support
#
CONFIG_SERIAL_CORE=y <-------- and here
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_SERIAL_JSM=m
CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
CONFIG_PRINTER=m
CONFIG_LP_CONSOLE=y
CONFIG_PPDEV=m
CONFIG_TIPAR=m
notice also
CONFIG_SERIAL_8250_NR_UARTS=4
I'm not sure yet, but I think this may be significant
tobyl
edit: It would seem that the kernel options for serial devices varies a fair bit depending which kernel you have, but it looks like you are going to have to recompile with a different config. You may also be better off with a later kernel, but I cant confirm that.
The post I have linked to below will give you an idea what I mean.
Looks like very good advice. This'll be my first go at compiling a kernel, but it makes a lot of sense what you say tobyl. Looking at the script I wouldn't have imagined that "CONFIG_SERIAL_8250=y" meant that the config is implemented but the module not there for example.
Question. Can I compile on an external machine ( with more disk ) and move the compiled kernel over to the the final machine?
Will the newly compiled kernel "upset" my present configuration if I just stick to these specific changes?
You can compile on any machine you want to use. It is simple if the machines are both Intel X86 systems. More complex otherwise. The README in
/usr/src/linux-2.6.13
leads you through the compilation including setting the variable LOCALVERSION in .config to give your new kernel and modules a unique identifier that will let them coexist with your installed older version. It is always good to keep a known working kernel. Your boot loader can then be setup to select either the old or the new. If you install the new kernel on the compiling machine, all you have to do is copy
/lib/modules/linux-2.6.13-xxx
and the new entries in /boot to your target machine.
I couldn't find the source for the 2.6.13 kernel on slackware, so I downloaded from www.kernel.org. Shouldn't present any problems right?
I'll be getting into it now, so by the time anyone gets to answering I might already have the answer, or at least be suffering. Please keep posted. I'll report my results, positive or negative.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.