LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 10-24-2005, 11:03 PM   #1
dansawyer
Member
 
Registered: Mar 2005
Posts: 122

Rep: Reputation: 15
how and by what is /dev/ttyS0 made?


All, the issue is /dev/ttyS0 is not being produced at boot up. The system is a laptop Fedora Core 4 and the BIOS program shows the port up and operational.

Does the serial driver run of a script?

Where does the serial driver poll for config information?

dmesg does not show any referance to serial devices.

Thanks Dan
 
Old 10-25-2005, 04:50 AM   #2
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 65
Well, I'm not a guru on this one for sure. You may have to enable that in the kernel. Look here:

Device Drivers ---> Character devices ---> Serial drivers ---> then make it look like this:

Code:
  │ │                             <*> 8250/16550 and compatible serial support                                             │ │
  │ │                             [ ]   Console on 8250/16550 and compatible serial port                                   │ │
  │ │                             (4)   Maximum number of non-legacy 8250/16550 serial ports                               │ │
  │ │                             [ ]   Extended 8250/16550 serial driver options                                          │ │
  │ │                             --- Non-8250 serial port support                                                         │ │
  │ │                             < > Digi International NEO PCI Support                                                   │ │
My modem works so that should work anyway. If it does, dmesg should show this:

Code:
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
I'm not sure that modules will work though. I have never used it as a module. May have to get a grip on compiling a kernel.

Hope that helps.

 
Old 10-25-2005, 05:45 AM   #3
runlevel0
Member
 
Registered: Mar 2005
Location: Hilversum/Holland
Distribution: Debian GNU/Linux 5.0 (“Lenny”)
Posts: 290

Rep: Reputation: 31
Seems to be a udev or devfs problem, but we would need further info to be able to help you:

* Which distro you are using
* What kernel and whether you compiled it yourself, or it's a stock kernel

A hint:

* /dev/ttySN are started by the pppd daemon, or other serial daemons, and depends on the ppp or serial modules in your kernel, if they are not present it means that you haven't set up your dial-up connection. In order to tell you what modules you need to load we need to know what is attached to the serial port.

If it's a serial modem, try:
Code:
modprobe ppp_generic
This should load the rest of the modules. Normally this is done by the pppd but could be b0rked.
 
Old 10-25-2005, 09:42 AM   #4
dansawyer
Member
 
Registered: Mar 2005
Posts: 122

Original Poster
Rep: Reputation: 15
The kernel config options are:

#
# Serial drivers
#
CONFIG_SERIAL_8250=m
# CONFIG_SERIAL_8250_CS is not set
CONFIG_SERIAL_8250_NR_UARTS=4
# CONFIG_SERIAL_8250_EXTENDED is not set
 
Old 10-25-2005, 11:59 AM   #5
runlevel0
Member
 
Registered: Mar 2005
Location: Hilversum/Holland
Distribution: Debian GNU/Linux 5.0 (“Lenny”)
Posts: 290

Rep: Reputation: 31
NOTE: This is a dirty brute force approach, I'm sure there is a proper and more elegant way of getting it running using FC's own tools.
It could work as a temporary solution, anyway, but I would look for a permanent fix.

Modules:
Code:
modprobe serial-8250
You can also try a brute-force approach listing all modules related to serial drivers:

Code:
find /lib/modules/$(uname -r) -name "*serial*"
and try to load them all with modprobe.

Once you are down with the modules try if the device is there:

Code:
setserial -a /dev/ttyS0      --- tons of info
setserial -b /dev/ttyS0      --- summary of the configs
setserial -G /dev/ttyS0      --- formatted output
To set the device to autoconfig use:
Code:
setserial /dev/ttyS0 autoconfig
In order to get this running at startup you can add two lines to your /etc/rc.local, one to load the module and the second to setup the ttyS0 device:
[quote]
/etc/rc.local

...
modprobe WHICHEVER_MODULE_TO_LOAD
setserial /dev/ttyS0 autoconfig
[quote]

There is also a way to force things a bit more by manually creating device nodes, whichever their kind is: the mknod command.
To take it short:
Code:
mknod --mode=0777 /dev/ttyS0 c 4 64
I would give the mknod manpage a read, it's a very useful tool.
The list where the mayor and minor numbers (the last two arguments to mknod) are listed in /usr/src/linux/Documentation/devices.txt, with this as a reference you will be able to create
device nodes when needed.

Try it and give us feedback. I'm anyway sure that this problem can be solved in a Fedora Core-Friendly way, specially if anaconda and the hardware related modules are all up and running,
watch for hotplug, coldplug and any FC4/Anaconda specific daemons. These daemons are started and configured from an anaconda GUI or using ksysv, it's just drag and drop or
clicking check boxes.

Hope this helps
 
Old 10-25-2005, 12:20 PM   #6
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,458

Rep: Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172Reputation: 1172
The biggest question is going to be... are you running a Linux 2.6 version that uses udev?

If so, then the udev subsystem should have detected whatever serial devices exist and it should automatically create a /dev entry for it... effectively doing for you automatically what runlevel0 described how to do manually.
 
Old 10-25-2005, 09:12 PM   #7
dansawyer
Member
 
Registered: Mar 2005
Posts: 122

Original Poster
Rep: Reputation: 15
Thanks for the modprobe advice. Modprobe of the serial devices worked. After modprobe of serial_core and 8250 the device was created.

Now the question is: What is missing to prevent it being found?

Thanks - Dan
 
Old 10-25-2005, 11:17 PM   #8
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 65
There is a file that you need to add it to so that when you boot, it will load the module itself. For mine it is /etc/modules.autoload.d/kernel-2.6. That may be different on yours though.

Later

 
Old 10-26-2005, 04:46 AM   #9
runlevel0
Member
 
Registered: Mar 2005
Location: Hilversum/Holland
Distribution: Debian GNU/Linux 5.0 (“Lenny”)
Posts: 290

Rep: Reputation: 31
Quote:
Originally posted by dalek
There is a file that you need to add it to so that when you boot, it will load the module itself. For mine it is /etc/modules.autoload.d/kernel-2.6. That may be different on yours though.

Later

I'm not quite sure that they have an /etc/modules.autoload in Fedora Core 4...
I have been using Red Hats and FC until FC2 and there wasn't such config files there.
They used the /etc/sysconfig mechanism instead putting all the rest of the config stuff there and in /etc/rc.local.
 
Old 10-26-2005, 05:19 AM   #10
dalek
Senior Member
 
Registered: Jul 2003
Location: Mississippi USA
Distribution: Gentoo
Posts: 2,058
Blog Entries: 2

Rep: Reputation: 65
Quote:
Originally posted by dalek
That may be different on yours though.
That was why I said that. I just wanted to make sure he knew there should be a way to make it load by itself and he should not have to do it manually each time he reboots. I have never used Redhat, did use Mandrake for a while though then switched to Gentoo, so I don't really know how to do it in Redhat.

Later

 
Old 10-26-2005, 06:51 AM   #11
runlevel0
Member
 
Registered: Mar 2005
Location: Hilversum/Holland
Distribution: Debian GNU/Linux 5.0 (“Lenny”)
Posts: 290

Rep: Reputation: 31
Quote:
Originally posted by dansawyer
Thanks for the modprobe advice. Modprobe of the serial devices worked. After modprobe of serial_core and 8250 the device was created.

Now the question is: What is missing to prevent it being found?

Thanks - Dan
The fact is that you not only need the device but a driver attached to it.
With the module loaded and the device enabled everything should run fine.

A way to have it loaded at early start up is recompiling the kernel and configuring the serial stuff directly into the kernel.

I still don't know what you have attached to the serial port, so my indications could be partly wrong.

The responsible of creating the serial devices /dev/ttySN and loading the kernel modules in case you have a modem attached is the pppd (PPP daemon).
To enable it at start up you should try these two steps:

First take a
Code:
 service  --status-all | grep running
And watch for the following services:

kudzu
pppd


The pppd runs on demand called by your networking scripts, but you need the ppp modules loaded. The needed module is ppp_generic.

Kudzu is the daemon responsible for polling the hardware and setting stuff up, normally it starts during boot and is killed when you enter your default runlevel.
If you swap devices a lot or have issues like the one you described it could be of use having kudzu enabled in runlevel 5. To do this use either chkconfig on a console or invoke the fine Serviceconf utility to manage the daemons graphically.

For your convenience, here is the console command:
Code:
chkconfig --add kudzu --level 35             (it's 3 and 5 not 35, there is *no* separation)
Personally, I would prefer to use the serviceconf GUI. Seeing all the modules at a glance is a very valuable feature.

To have the PPPD set up you would need to use the Red Hat Network Setup tool, this GUI should lead you through the process and also load the needed modules, set up the devices and do all the rest of the dirty work for you.
 
  


Reply


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
redirecting /dev/ttyS0 -> stdin goestin Linux - Software 2 10-26-2011 12:34 PM
Minicom /dev/ttyS0 locked zmaint Linux - Software 4 12-23-2003 05:03 PM
Minicom in /dev/ttyS0 Luis GUSTAVO Linux - Software 0 07-31-2003 06:42 PM
chmod g+w /dev/ttyS0 jISV Linux - General 4 04-13-2002 07:01 PM
/dev/ttyS0 problems rbermude Linux - Software 2 06-27-2001 11:43 AM


All times are GMT -5. The time now is 06:15 AM.

Main Menu
Advertisement
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