From: davidsen@ariel.crd.GE.COM (william E Davidsen) Subject: Re: loadable device drivers Date: 14 Aug 1992 14:20:33 GMT
In article <1992Aug13.151040.284@bernina.ethz.ch>,
almesber@nessie.cs.id.ethz.ch (Werner Almesberger) writes:
| In article <2659@nlsun1.oracle.nl> jhelberg@nl.oracle.com (Joost Helberg) writes:
| > Far too long, and you have to reboot too! i.e. all users have to
| > get coffee or tea!
|
| You're developping new drivers while users are working on your machine ?
| Poor users ... ;-)
|
| > The kernel must be mapped when implementing loadable device drivers (to
| > get page-faults) so the kernel doesn't need contiguous memory --> less
| > problems allocating memory.
|
| Page-faults are deadly for most parts of the kernel. Unless the interrupt
| handling is changed in radical ways (see below), you don't want interrupt
| handlers and code that's called by them to reside in paged memory. (Besides
| the obvious case of device drivers that may be possibly invoked when
| handling a page fault.)
|
| Using the paging hardware to map kernel pages is a good idea, though.
This is a good point, and at the risk of saying "me too" I'll expand
on it a bit, the idea that a loadable driver would, for some reason,
have to be contiguous with the kernel, is obviously not correct. The
parts used to handle an interrupt would have to be resident, and unless
someone wants to get very tricky I would suspect the whole thing must
be.
On the other hand that's been proposed as a solution for possible page
faults on the shared library if jump tables are used (not a great idea
on small systems, I think), and I believe there is code to nail a page
in memory right now.
The general steps for loading a driver are:
1. get the driver in memory
2. link the ints
3. link the vectors for strategy and ioctl
4. mark the pages as locked in memory.
Actually you better do 4 before 2&3, but you see the problem.
As Werner points out, the problem is not simple, but neither is it
nearly as complex as it might appear.
-- bill davidsen, GE Corp. R&D Center; Box 8; Schenectady NY 12345 I admit that when I was in school I wrote COBOL. But I didn't compile.