LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   how and by what is /dev/ttyS0 made? (https://www.linuxquestions.org/questions/linux-software-2/how-and-by-what-is-dev-ttys0-made-376569/)

dansawyer 10-24-2005 10:03 PM

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

dalek 10-25-2005 03:50 AM

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.

:D :D :D :D :D

runlevel0 10-25-2005 04:45 AM

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.

dansawyer 10-25-2005 08:42 AM

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

runlevel0 10-25-2005 10:59 AM

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 ;)

sundialsvcs 10-25-2005 11:20 AM

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.

dansawyer 10-25-2005 08:12 PM

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

dalek 10-25-2005 10:17 PM

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

:D :D :D :D

runlevel0 10-26-2005 03:46 AM

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

:D :D :D :D

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.

dalek 10-26-2005 04:19 AM

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

:D :D :D :D

runlevel0 10-26-2005 05:51 AM

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.


All times are GMT -5. The time now is 04:16 PM.