Re: about loading modules

"Axel Dörfler" <[email protected]>
Newsgroups gmane.os.openbeos.kernel.devel
Message-ID <4109719391-BeMail@nichtsnutz>
ShackaN <[email protected]> wrote:
> I've been told that BeOS (and consequently Haiku) is not a µ-kernel
> operating system, but rather a "highly modular" one, thus, AFAIK,
> although the core functionalities reside in the kernel, many
> addictional features will be imported from "external" modules; I had 
> a

Right, although most of the crucial things, like the VFS and others, 
are built-in as well.

> look at your website, but I could find no info about how the module
> loader works (or better, how you planned to make it work :) even if
> it's such an important part of the os, so here is my question for you
> kernel-hackers :  WHEN does the kernel "know" that he needs some
> additional module? WHERE will the kernel look for such a module
> (inside a directory tree, inside a "pseudo-registry" à la windows,
> whatever...) ? HOW does the kernel recognize that the found module is
> viable to carry out the needed task? HOW does the kernel internally
> load modules? and.. the "modules" are supposed reside in user- or
> kernel-mode?

1) when:
the first modules are loaded by the boot loader and handed over to the 
kernel. Basically, the boot loader recognizes the environment, and then 
loads the appropriate modules, so that the kernel can access the boot 
disk.
But modules are also load during runtime, many of them during 
initialization, some later - whenever the kernel decides to look out 
for modules. For example, when an application tries to open a sound 
device, the kernel will start looking for such modules at this point, 
and not earlier.
2) where:
all modules can be found under add-ons/kernel/. But this is not a flat 
directory, it's a hierarchy organized by exported functionality. For 
example, you'll find network drivers under a certain directory which is 
different from that of a graphics driver.
Also, often modules directly ask for other modules, either by providing 
their full interface name, or by asking for a specific feature set (ie. 
tell the kernel to look in a specific directory only).
For Haiku, we'll extend this a bit to be able to recognize the drivers 
needed for a specific hardware directly, ie. by providing a mapping 
from the PCI device ID to a certain module, and that's also how the 
boot loader will be able to know these things. BeOS itself always scans 
the whole graphics driver directory when the app_server is asking for 
some output device.
3) how:
already answered above.
4) how:
It's not a micro kernel, and therefore, kernel modules run in kernel 
space. There exist some sort of hybrids that have parts running in 
userland and another small part in the kernel (ie. graphics drivers do 
it this way), but the kernel cannot do this alone.

Bye,
   Axel.



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.