From owner-freebsd-hackers Sun Sep 24 15:07:41 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id PAA17152 for hackers-outgoing; Sun, 24 Sep 1995 15:07:41 -0700 Received: from casparc.ppp.net (casparc.ppp.net [194.64.12.35]) by freefall.freebsd.org (8.6.12/8.6.6) with SMTP id PAA17061 for ; Sun, 24 Sep 1995 15:07:03 -0700 Received: from ernie by casparc.ppp.net with uucp (Smail3.1.28.1 #1) id m0swz7a-000I0iC; Sun, 24 Sep 95 23:02 MET Received: by ernie.altona.hamburg.com (Smail3.1.29.1 #3) id m0swyfW-000013C; Sun, 24 Sep 95 22:33 MET Message-Id: From: hm@altona.hamburg.com (Hellmuth Michaelis) Subject: Re: LKM: how to fiddle in interrupt routine ptrs ? To: dennis@etinc.com (dennis) Date: Sun, 24 Sep 1995 22:33:02 +0100 (MET) Cc: hackers@FreeBSD.ORG In-Reply-To: <199509241538.LAA27363@etinc.com> from "dennis" at Sep 24, 95 11:38:44 am Reply-To: hm@altona.hamburg.com X-Mailer: ELM [version 2.4 PL24] Content-Type: text Content-Length: 1904 Sender: owner-hackers@FreeBSD.ORG Precedence: bulk >From the keyboard of dennis: > >>Is there a generic or recommended way or example of installing a device's > >>interrupt routine at mod-loading a device driver LKM time ? > > > >See pcibus.c:pcibus_ihandler_attach/detach. > > > >There are some minor problems with these routines: [...] > >- it isn't possible to give a correect device_id. 0 is for clkintr. > > The device_id is only used for counting interrupts. To fix this > > you would have to expand the string table in vector.s and edit it. It seems to be almost impossible to give it, NR_DEVICES is a constant computed by config, it must be made a variable. > >>What is the way to tell the driver at mod-load time it's IRQ and i/o addr ? > > > >There is no way. There should be a way to make this usable. > This method is not good and requires some thought. In the big picture, one of > the most useful purposes of modules is the ability to add devices without having > to recompile the kernel. If I have to install dummy drivers I've lost my > need to use modules. Right, but someone has to implement it. It seems that some work is necessary on the device driver lkm model to make it fully work: there must be a way to specify a device driver interrupt handler, the hardware interrupt to use and a i/o and memory address (range). For me it looks like certain constants are computed at compile time rather than runtime, and depending on this constants some kernel tables are sized. This has to change, there should be a fixed size table (filled with dummies for nonexistent devices) for all possible interrupts which will be filled with the respective entries by mod-loading a driver. Also, it is unclear what should happen with the probe and attach routines. hellmuth -- Hellmuth Michaelis hm@altona.hamburg.com Hamburg, Europe (A)bort, (R)etry, (I)nstall BSD ?