LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-08-2006, 04:11 PM   #1
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Rep: Reputation: 15
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"

Now what?

Is there a MAKEDEV for Slackware?
 
Old 10-08-2006, 06:52 PM   #2
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Original Poster
Rep: Reputation: 15
Compiling new tty modules??

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?

Thanks
 
Old 10-08-2006, 09:32 PM   #3
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
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 ?
 
Old 10-08-2006, 11:06 PM   #4
manwichmakesameal
Member
 
Registered: Aug 2006
Distribution: Slackware
Posts: 800

Rep: Reputation: 100Reputation: 100
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
 
Old 10-09-2006, 08:21 AM   #5
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Original Poster
Rep: Reputation: 15
Great Ideas, but Nope!

Thanks both of you. Sounded promising.

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.

Now what?
 
Old 10-15-2006, 05:51 PM   #6
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 743

Rep: Reputation: 50
Quote:
I need ttyS4 & 5
You have more serial ports than most, then.

Did you look at /etc/inittab?

These lines look significant to me:

# Local serial lines:
#s1:12345:respawn:/sbin/agetty -L ttyS0 9600 vt100
#s2:12345:respawn:/sbin/agetty -L ttyS1 9600 vt100

first thing I would do is make some lines like the above that correspond to the ttyS I wanted.

Have you read the Serial How-to? It is long winded, but then, setting up serial devices is no push-over.


http://tldp.org/HOWTO/Serial-HOWTO.html

good luck

tobyl

Last edited by tobyl; 10-15-2006 at 05:53 PM.
 
Old 10-16-2006, 01:55 PM   #7
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 743

Rep: Reputation: 50
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?

tobyl

Last edited by tobyl; 10-16-2006 at 01:57 PM.
 
Old 10-18-2006, 08:17 AM   #8
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Original Poster
Rep: Reputation: 15
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.
 
Old 10-18-2006, 08:23 AM   #9
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Original Poster
Rep: Reputation: 15
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.
#

RCLOCKFILE=/var/lock/subsys/serial
DIRS="/lib/modules/`uname -r`/misc /lib/modules /usr/lib/modules ."
PATH=/bin:/sbin:/usr/bin
DRIVER=serial
DRIVER_NAME=serial
MODULE_REGEXP="serial\b"

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

touch ${RCLOCKFILE}
${SETSERIAL} -bg ${ALLDEVS}
 
Old 10-18-2006, 09:36 AM   #10
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Original Poster
Rep: Reputation: 15
Some doubts about the above rc.serial:

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.
 
Old 10-18-2006, 12:47 PM   #11
TNWestTex
Member
 
Registered: May 2006
Location: Tennessee
Distribution: current, rawhide
Posts: 87

Rep: Reputation: 16
You need help from your vendor.

Quote:
Originally Posted by DavidHB
Some doubts about the above rc.serial:

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
scans the directories

/lib/modules/2.6.13/misc
/lib/modules
/usr/lib/modules

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.
 
Old 10-18-2006, 01:09 PM   #12
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 743

Rep: Reputation: 50
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.

http://lists.debian.org/debian-kerne.../msg00188.html

Last edited by tobyl; 10-18-2006 at 05:48 PM.
 
Old 10-19-2006, 07:42 AM   #13
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Original Poster
Rep: Reputation: 15
OK, thanks everyone,

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?

Thanks again
 
Old 10-19-2006, 08:24 AM   #14
TNWestTex
Member
 
Registered: May 2006
Location: Tennessee
Distribution: current, rawhide
Posts: 87

Rep: Reputation: 16
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.
 
Old 10-21-2006, 11:08 AM   #15
DavidHB
Member
 
Registered: Feb 2006
Location: Chile
Distribution: Slackware 10.2
Posts: 53

Original Poster
Rep: Reputation: 15
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.

Thanks
 
  


Reply

Tags
compile, module, modules, slack


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Japanese canna won't work : Warning: &#12363;&#12394;&#28450;&#23383;&#22793;&am OrganicOrange84 Debian 3 06-30-2005 02:28 PM
How do I get KPPP to use ttyS4? KnowNothing Linux - General 2 11-29-2003 06:52 PM
setserial /dev/ttyS4 (settings) bmike1 Linux - Software 1 08-07-2003 04:07 PM
changeing /dev/modem to ttyS4?? mitchellh87 Linux - General 3 02-05-2003 10:43 AM
ttyS4 & debian 'woody' mace Linux - Hardware 1 09-15-2002 04:34 PM


All times are GMT -5. The time now is 07:56 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration