Subject: Re: Request for comments: let config(1) generate LKMs
To: Hiroyuki Bessho <bsh@NetBSD.org>
From: Juan RP <juan@xtrarom.org>
List: tech-toolchain
Date: 09/13/2007 13:17:55
On Thu, 13 Sep 2007 18:55:32 +0900 (JST)
Hiroyuki Bessho <bsh@NetBSD.org> wrote:

> Hi,
> 
>   I've got an idea to improve our LKM support.  In my plan, turning
> existing device drivers into LKMs would be done like following:
> 
>   1. modify kernel config file with new syntax:
> 
> module com0     at isa? port 0x3f8 irq 4        # Standard PC serial ports
> module ne*	at isapnp?
> 
>   2. config KERNEL && make depend && make lkms
> 
>   3. you've got  compile/KERNEL/lkm/com/com.o and
> compile/KERNEL/lkm/ne/ne.o
> 
> 
> Do you think this idea prospective?  Will it conflict with other works
> happening recently in the NetBSD camp?

> I'd like some comments before I start further work on this.  

It sounds good to me. I only added sys/lkm/dev/isa to verify correctness
of the new envsys2 framework, but having many drivers converted to LKMs
would be really nice.

The only problem is how to build different LKMs for the same driver,
but with different locators (I/O port, IRQ, etc).

On drivers where a different I/O port can be used, the driver itself might
have to probe them before the final attach (something like nsclpcsio(4)
currently does), to avoid multiple different modules, e.g:

module it0 	at isa? port 0x290
module it1 	at isa? port 0xc00
module it2 	at isa? port 0xd00

What do you think? what's the best option to fix all this crap?

-- 
Juan Romero Pardines	- The NetBSD Project
http://plog.xtrarom.org	- NetBSD/pkgsrc news in Spanish