LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 11-06-2007, 04:28 PM   #1
alenD
Member
 
Registered: Jul 2005
Posts: 69

Rep: Reputation: 15
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
 
Old 11-06-2007, 05:07 PM   #2
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Rep: Reputation: 30
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.
 
Old 11-06-2007, 05:32 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,681

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
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.
 
Old 11-06-2007, 08:09 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,649
Blog Entries: 4

Rep: Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934Reputation: 3934
".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.
 
Old 11-07-2007, 01:19 AM   #5
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
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.
 
Old 11-07-2007, 04:11 AM   #6
keratos
Member
 
Registered: May 2007
Location: London, UK.
Distribution: Major:FC8. Others:Debian;Zenwalk; Arch; Slack; RHEL.
Posts: 544

Rep: Reputation: 30
here in UK, pendrive = USB flash memory (drive).

!!
 
Old 11-07-2007, 09:55 AM   #7
alenD
Member
 
Registered: Jul 2005
Posts: 69

Original Poster
Rep: Reputation: 15
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
 
Old 11-07-2007, 11:36 PM   #8
General Failure
Member
 
Registered: Jan 2007
Location: Germany
Distribution: Slackware 13.37
Posts: 387

Rep: Reputation: 37
I'm just wondering if there is no README file included with your penmount files?
 
Old 11-08-2007, 10:04 AM   #9
alenD
Member
 
Registered: Jul 2005
Posts: 69

Original Poster
Rep: Reputation: 15
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
 
Old 11-08-2007, 11:05 AM   #10
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 78
Quote:
Originally Posted by alenD View Post
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.
 
Old 11-09-2007, 09:50 AM   #11
alenD
Member
 
Registered: Jul 2005
Posts: 69

Original Poster
Rep: Reputation: 15
that was a very helpful comment. Thank you.
 
  


Reply



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
difference between user52 Linux - Newbie 4 11-27-2006 05:24 PM
ls |wc -l and ls -l|wc -l what is difference sarajevo Programming 13 06-19-2006 04:37 PM
what's the difference between ... marlor Slackware 4 06-05-2004 02:38 PM
What a difference... perry General 3 12-04-2003 05:52 PM
Is there a difference? enk0d General 2 11-08-2003 09:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:07 PM.

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
Open Source Consulting | Domain Registration