WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Loading PCI device when booting  (Read 4127 times)

Offline development

  • WikiUser
  • *
  • Posts: 22
Loading PCI device when booting
« on: January 03, 2009, 12:35:08 AM »
Dear TinyCore ers,

I make a multi serial port PCI driver in tcem module and place in tce directory.
After booting, I can find my new file in modules directory and the device found with lspci, but I can't find the module with lsmod.
When manually insmod, the device appear in /proc/tty/driver, but can't find multi serial port in /dev/ttyXX.
How to load the PCI modules and create /dev/ttyXX automatically when booting ?
Thanks in advanced for your response.

Regards.
   
« Last Edit: January 03, 2009, 01:05:14 AM by development »

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: Loading PCI device when booting
« Reply #1 on: January 03, 2009, 12:57:39 AM »
You'll need to modprobe it (or insmod).

You can add the command to system startup (ie in /opt/bootlocal.sh)
or if you prefer that the extension to handle it, add an executable post-loading script (in /usr/local/tce.installed/pkgname)

Offline development

  • WikiUser
  • *
  • Posts: 22
Re: Loading PCI device when booting
« Reply #2 on: January 03, 2009, 01:08:29 AM »
Thanks I will try it.

Offline development

  • WikiUser
  • *
  • Posts: 22
Re: Loading PCI device when booting
« Reply #3 on: January 03, 2009, 01:11:59 AM »
I just wondering, How usbserial-2.6.26.tcem can work nicely without scripting ?
Can It working also in multiport serial PCi also ?

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: Loading PCI device when booting
« Reply #4 on: January 03, 2009, 06:34:41 AM »
depmod is executed when it's done.

Where did you place your module(s)?  Afaik somewhere like /lib/modules/`uname -r`/kernel.tclocal is ideal

Offline development

  • WikiUser
  • *
  • Posts: 22
Re: Loading PCI device when booting
« Reply #5 on: January 03, 2009, 07:25:05 AM »
It's very nice talking to this forum. Thanks to all moderators and participant that give good and reponsive information.

Altought the module already loaded with bootlocal.sh ,  I still can't get serial device /dev/ttyXX appears.
If we place the modules in /lib/modules/`uname -r`/kernel.tclocal. What's the different with /lib/modules/`uname -r`/kernel ?

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: Loading PCI device when booting
« Reply #6 on: January 03, 2009, 07:48:10 AM »
Are you trying to attach a device to it?  For example, you might need to edit /etc/inittab (and use something other than rungetty - iirc it does not recommend serial use).  This would require a remaster though.

The difference probably won't matter if modprobing already works.  Having the modules in kernel.tclocal/ allows for tclocal persistency, whereas kernel/ will just typically be on ramdisk.

Offline development

  • WikiUser
  • *
  • Posts: 22
Re: Loading PCI device when booting
« Reply #7 on: January 03, 2009, 08:13:05 AM »
I attached tty to a serial device, with my own software.
Ok I see, I know the different purposes between those kernel location.
By the way, my question mostly because my limitation understanding in Linux.
What's linux distro has similiarity configuration with tinycore ? Maybe better I must learn from there before exploring tinycore.

Best Regards.

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: Loading PCI device when booting
« Reply #8 on: January 03, 2009, 08:22:22 AM »
Ah, so if you want it to run automatically I guess you could add your software's command to the same script... after the modprobe line.  You might need to add a sleep statement or something similar if the device isn't recognized right away though.

TC specific configuration is probably unique (for the most part), ie tclocal

Offline development

  • WikiUser
  • *
  • Posts: 22
Re: Loading PCI device when booting
« Reply #9 on: January 03, 2009, 08:37:19 AM »
Yes, since /dev is non persistance , I must make a script with mknod to create /dev/ttyXX every time at booting. Is it correct ?
But It didn't happend if we use USB serial, that automatically create /dev/ttyUSB when plugin or booting.

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: Loading PCI device when booting
« Reply #10 on: January 03, 2009, 09:02:57 AM »
I thought serial devices could be accessed from /dev/ttyS[0-3] ? (they are currently in TC)

If you need to use mknod, you could either add it to the start of a script, or remaster TC with the file already in it.

Offline development

  • WikiUser
  • *
  • Posts: 22
Re: Loading PCI device when booting
« Reply #11 on: January 04, 2009, 05:06:50 AM »
Ok Thanks.

Offline roberts

  • Administrator
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Loading PCI device when booting
« Reply #12 on: January 04, 2009, 06:40:38 AM »
Many ways to accomplish. Everything in unix is a file.
You can include it in a backup and not have to re-create it upon each boot.
Either way.
10+ Years Contributing to Linux Open Source Projects.

Offline development

  • WikiUser
  • *
  • Posts: 22
Re: Loading PCI device when booting
« Reply #13 on: January 04, 2009, 08:39:42 AM »
After recompiling the kernel, I can found my multiport ttyS device, automatically, since udev working for me.
There are limitation in kernel configuration, the default maximum number is only 4 ports. I change to the number of my serial port and when booting all 33 serial port detected and created /dev/ttySxx automatically .
Thanks for you kind to assist me.

Regards.

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: Loading PCI device when booting
« Reply #14 on: January 04, 2009, 01:00:30 PM »
Good to hear that you've gotten it to work.  I'm just curious though, what are you using that requires 33 serial ports?