Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Mar 1997 11:15:33 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        "Jordan K. Hubbard" <jkh@time.cdrom.com>
Cc:        current@freebsd.org
Subject:   Re: A new Kernel Module System 
Message-ID:  <Pine.BSF.3.95q.970331111048.534H-100000@kipper.nlsystems.com>
In-Reply-To: <20519.859756869@time.cdrom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 30 Mar 1997, Jordan K. Hubbard wrote:

> > For adding devices dynamically, a new system call would create an
> > isa_device structure and fill it with the new device's config data (io,
> > irq, flags etc.)  The new device will then match against the installed
> > drivers by name as for static devices.  The commands used might be
> > something like:
> > 
> > 	# Add a new device using ed driver
> > 	isaconf -a ed0 port=0x280 irq=5 iomem=0xd8000 flags=4
> > 	# Load the ed driver to activate all ed* instances
> > 	modload /lkm/devs/isa/ed.so
> 
> Ah, OK, this is the bit I missed.  So you'd use this to load drivers
> that the kernel had never seen before, e.g. say I get a floppy from
> ABC Systems along with their new network interface card which none of
> us have ever even heard of before, and when I say:
> 
> mcopy a:abc_foonic.so /lkm/devs/isa
> isaconf -a foo0 port=0x320 irq=11 iomem=0xd0000
> modload /lkm/devs/isa/foo0.so

Almost.  You would load /lkm/devs/isa/foo.so.  The driver object does not
need an instance number since the same driver could support many different
instances:

isaconf -a foo0 port=320 irq=10 iomem=0xd0000
isaconf -a foo1 port=330 irq=11 iomem=0xd8000
isaconf -a foo2 port=340 irq=12 iomem=0xe0000
modload /lkm/devs/isa/foo.so


> 
> It all does the right stuff?
> 
> What if it's a PCI or EISA card, do I just do the modload and expect
> it to DTRT?

For a PCI or EISA (or PnP or PCCARD) device, the bus scan will determine
the presence of the device.  The driver module's probe would be called
with the PCI device ids (or EISA id etc.) and if it recognises one which
it supports, the probe will succeed.

--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 951 1891




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.970331111048.534H-100000>