Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
11-06-2007, 04:28 PM
|
#1
|
Member
Registered: Jul 2005
Posts: 69
Rep:
|
difference between *.ko and *.so
Hi,
what is the difference between the *.ko file and *.so? I understand that the first is the kernel module and the second is shared library but practically ,when installing a driver, should I use both or either one.
For example, there is penmount.ko and penmount.so To install the penmount driver do I need both? To create penmount.ko I need to recompile the kernel and then manually load it. To install penmount.so I need simply to put into the right directory and let xorg.conf load it. To make my penmount controller work do I need both actions or only one?
thnx
|
|
|
11-06-2007, 05:07 PM
|
#2
|
Member
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544
Rep:
|
In laymen terms:
Kernel modules (ko) run in kernel space, user modules (so) run in user space.
Kernel spaces facilitate (or not) access to a variety of functions that user space does not.
Kernel modules are always executed in kernel space and if buggy or erroneous, can freeze the system.
User space is "protected" and a buggy module or app is less likely to crash the system.
Its a bit more complex than that, but I dont want to get into a conversation on how linux works, suffice to say you have confused me:
I am not quite sure why a pendrive.so user module is loaded by your xorg. Xorg is display only and has NOTHING to do with loading a filesystem on a pendrive.
Besides, a pendrive in linux should appear as a block device (a hard disk) and does not require a module not shipped as part of the [latest 2.6.x] kernels.
What is your system ??
Last edited by keratos; 11-06-2007 at 05:08 PM.
|
|
|
11-06-2007, 05:32 PM
|
#3
|
Moderator
Registered: Aug 2002
Posts: 26,863
|
I believe the penmount modules are for a touchscreen and not a mass storage device. xorg would need the so module for an input device. You would need both.
Last edited by michaelk; 11-06-2007 at 05:45 PM.
|
|
|
11-06-2007, 08:09 PM
|
#4
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 11,311
|
".ko" files are designed to become part of the kernel. They are literally parts of the Linux kernel itself, which the kernel can load and unload from time to time. As such, they have an extremely privileged and extremely unique role to play.
".so" files, on the other hand, are perfectly ordinary. They are "just" libraries. Ordinary, run-of-the-mill programs can use them. They're "just" collections of useful subroutines.
Don't let the similiarity of file-names mislead you.
|
|
|
11-07-2007, 01:19 AM
|
#5
|
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530
Rep:
|
Many device drivers are implemented in kernel space, but I believe there are some kernel-space driver interfaces which allow device-specific code to be written in user space. For example Fuse (user space filesystem drivers), and some USB drivers.
|
|
|
11-07-2007, 04:11 AM
|
#6
|
Member
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544
Rep:
|
here in UK, pendrive = USB flash memory (drive).
!!
|
|
|
11-07-2007, 09:55 AM
|
#7
|
Member
Registered: Jul 2005
Posts: 69
Original Poster
Rep:
|
Penmount modules are indeed for touchscreen.
So do I need penmount.ko and penmount_drv.so ?
And what about egalax?
Do I need both tkusb.ko and egalax_drv.so?
Are there any 'rules' that would tell when I need both and when not?
thnx a lot
|
|
|
11-07-2007, 11:36 PM
|
#8
|
Member
Registered: Jan 2007
Location: Germany
Distribution: Slackware 13.37
Posts: 387
Rep:
|
I'm just wondering if there is no README file included with your penmount files?
|
|
|
11-08-2007, 10:04 AM
|
#9
|
Member
Registered: Jul 2005
Posts: 69
Original Poster
Rep:
|
There is README for egalax.
In truth, three of them.
On says how to install egalax_drv.so - it is easy, just copy the file into the right dir.
Another how to build kernel module tkusb.ko
Yet another how to recompile the kernel which could be needed to build kernel module tkusb.ko
Nowhere it is said if both kernel module and .so module needed to make touchscreen work or either of them.
Does anyone know? In general, what is the rational between having two different types of modules? Isn't it easier to have one so that everyone would know what exactly to install to make it work?
thanx
|
|
|
11-08-2007, 11:05 AM
|
#10
|
HCL Maintainer
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450
Rep:
|
Quote:
Originally Posted by alenD
In general, what is the rational between having two different types of modules? Isn't it easier to have one so that everyone would know what exactly to install to make it work?
|
I can’t speak for your touchscreen dilemma, but in general, the kernel module interfaces with hardware and provides certain hooks for userspace software to use. The X module uses some of those hooks and makes the device appear in a way useful to the rest of X (as an X input device or what have you). The kernel module must be relatively simple. This is out of want and necessity: the kernel interface should not crash the system if a bug occurs, and there are no external library interfaces provided when coding in kernel space. Any complex uses of the hooks may occur in userspace (specifically, the X module). So, in general, having just the kernel module alone would give you only the capability to use your hardware from userspace. Having just the X module alone would give you the capability to use hooks provided by the kernel (if there were any). So when you put them together, you get functioning use of your device through X.
|
|
|
11-09-2007, 09:50 AM
|
#11
|
Member
Registered: Jul 2005
Posts: 69
Original Poster
Rep:
|
that was a very helpful comment. Thank you.
|
|
|
All times are GMT -5. The time now is 08:38 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|