- Difference between modules and shared-objects
- Posted by k v on June 30th, 2003
I read that when inserting a module into the Linux kernel - it
thereafter becomes an integral part of the kernel itself; I believe
same is the purpose of shared-objects so are modules just an
implementation of shared objects?
- Posted by Gerhard W. Gruber on June 30th, 2003
On 30 Jun 2003 06:53:11 -0700 wrote abhilashkv@hotmail.com (k v) in
comp.os.linux.misc with <6f038a2e.0306300553.3e4e0402@posting.google.com >
Modules are kernel extensions. Shared Object (I assume you mean shared
libraries here) are libraries that run in user mode. They are shared because
they usually (at least should) contain code that is usefull for more
applications and so they are put in a shared librariy in order to reduce
diskspace and easier maintenance.
--
Gerhard Gruber
Für jedes menschliche Problem gibt es immer eine einfache Lösung:
Klar, einleuchtend und falsch. (Henry Louis Mencken)
- Posted by Robert Heller on July 1st, 2003
abhilashkv@hotmail.com (k v),
In a message on 30 Jun 2003 06:53:11 -0700, wrote :
kv> I read that when inserting a module into the Linux kernel - it
kv> thereafter becomes an integral part of the kernel itself; I believe
kv> same is the purpose of shared-objects so are modules just an
kv> implementation of shared objects?
kv>
*NO*!!!!
*Kernel* modules become part of the kernel and run in kernel
mode. This is proper for low-level device drivers (which interface with
*devices*) and other kernel-level things (like file system
implementation code).
Shared-objects (shared libraries), do NOT become part of the kernel.
They are loaded into memory and *shared* by one or more *user-mode*
programs.
Note: Kernel modules are never 'shared'. There is only one kernel
loaded and running at a time. The kernel module load code does a
last-minute link step when the module is loaded. Shared-objects /
shared libraries are loaded once and might be used by more than one
program. The 'pure' part (executable code) of the Shared-object or
shared library only exists in memory once. The non-pure part is (I
believe) copy-on-reference and gets copied into each process's virtual
memory space that uses the shared-object or shared library. (Assumes
that shared-objects and shared libraries can even have non-pure parts.)
- Posted by mjt on July 1st, 2003
k v wrote:
.... no
..
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
Michael J. Tobler: motorcyclist, surfer, # Black holes result
skydiver, and author: "Inside Linux", # when God divides the
"C++ HowTo", "C++ Unleashed" # universe by zero