Kernel modules

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andrew Doran
Date: Wednesday, January 16, 2008 - 5:48 am

Hi,

I committed the module framework that I was working on. It will be a while
before I can spend more time on it, and others want to work on it, so here
it is. Ordinarily I would have sent this for review. In this case I thought
it was better to start with a working implementation in order to minimize
the level of bikeshedding.

The change is here:

http://mail-index.netbsd.org/source-changes/2008/01/16/0013.html	

The basic idea is that a kernel facility like ext2fs should have code
difference to be loadable as a module - the initialization is the same
whether or not it is built into the kernel. All that should be needed is
some build glue like a Makefile under sys/modules. Features: it has an in
kernel loader, does module dependencies and has hooks for the boot loader
to load modules and provide them to the kernel.

Here's how to get a module loaded for testing/fun. Note that only the linker
has been tested on i386 and amd64 only:

- Build and install new libc. 
- Edit sbin/modload/Makefile, sbin/modunload/Makefile.
- Build and install sbin/modstat, modload, modunload.
- Make sure your PATH is finding /sbin/modstat and not /usr/bin/modstat.
- Compile kernel with options MODULAR.
- mkdir /modules
- cd sys/modules/example
- make
- mv example.o /modules/example
- modload example

What needs to happen for it to replace LKMs:

- Conversion of the modules under sys/lkm.
- Linker relocation code for mips, hppa.
- Some changes to improve robustness in a couple of places.
- Locking for kern_ksyms.c

Please review.

Thanks,
Andrew
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Kernel modules, Andrew Doran, (Wed Jan 16, 5:48 am)
Re: Kernel modules, Andrew Doran, (Wed Jan 16, 6:03 am)
Re: Kernel modules, Steven M. Bellovin, (Wed Jan 16, 8:25 am)
Re: Kernel modules, Andrew Doran, (Thu Jan 17, 4:07 am)
Re: Kernel modules, David Laight, (Fri Jan 18, 11:11 am)
Re: Kernel modules, Adam Hamsik, (Fri Jan 18, 2:30 pm)
Re: Kernel modules, Reinoud Zandijk, (Sun Jan 27, 2:17 pm)