Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Sep 1997 11:49:52 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        hackers@freebsd.org
Subject:   PnP support in userconfig
Message-ID:  <199709030949.LAA07543@labinfo.iet.unipi.it>

next in thread | raw e-mail | index | archive | help
I have completed support for manual PnP configuration when doing
"boot -c" (only line mode, sorry!). The code lets you set the
configuration of pnp devices from userconfig (or, using Jordan's trick,
from the special sector on the boot disk), so that even machines with
broken or missing PnP support in the bios can use PnP cards more easily.

I plan to make the code available later today. It will be a package
including:

	/sys/i386/isa/pnp.c
	/sys/i386/isa/pnp.h
    and patches to
	/sys/i386/i386/autoconf.c
	/sys/i386/i386/userconfig.c
	/sys/i386/conf/files.i386

	/usr/src/sbin/dset/dset.c

    and postscript documentation on the code.
(maybe I will also include a modified version of pnpinfo).

It is meant to replace Sujal Patel's PnP code (I have already contacted
Sujal and have his blessing). It is more complete and functional,
easier to use from device drivers (I have been using this in my sound
code) and especially can be reconfigured without having to rebuild a
kernel or modify sources.

I have been using this code for more than one month now with no crashes
at all, and since it has very little impact on the rest of the system I
hope someone volunteers to commit it to -current at least.

Before making the code available, I need suggestions on the following
issues.

A PnP card can be specified using a unique integer (CSN) starting from
1 and assigned by the operating system at boot time, or with a 32-bit
number which is the "vendor_id" for the board. Each card has a number
of "logical devices" internally, numbered starting from 0 (the number
is called LDN).

Each card can accept up to 8 port addresses, 4 memory addresses, 2 irq
and 2 drq lines.

My code to support PnP in userconfig accepts commands with the
following syntax:

    pnp 1 0 enable port0 0x534 irq0 7 irq1 5 drq0 3 drq1 4 ....

where the first two parameters identify the CSN and LDN of the card.
I can replace the first parameter with the vendor_id so that the line
would become something like:

    pnp 0x0100561e 0 enable port0 ...

with the advantage of making the same command work independently of
the CSN assigned to the card, but with the disadvantage of a longer
command and of making impossible to have two cards of the same type on
the same machine (unless one adds another 32-bit integer, the serial
number). I'd really go for the first option unless there are strong
objections.

In order to make command simpler I could also force the user to specify
all parameters of the same type at once (e.g. the 8 ports, the 2 irqs,
and the 2 dmas), perhaps setting a default value when this is not
specified. As an example one would write:

    pnp 1 0 os enable port 0x608 0x388 0x220 irq 7 drq 1 0

to mean that the first three io ports get assigned 0x608 0x388 0x220,
only the first irq line is used as irq7, and the two dma channels are 1
and 0.

In this case the second approach seems preferable. Do you people agree ?

	Cheers
	Luigi
-----------------------------+--------------------------------------
Luigi Rizzo                  |  Dip. di Ingegneria dell'Informazione
email: luigi@iet.unipi.it    |  Universita' di Pisa
tel: +39-50-568533           |  via Diotisalvi 2, 56126 PISA (Italy)
fax: +39-50-568522           |  http://www.iet.unipi.it/~luigi/
_____________________________|______________________________________



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709030949.LAA07543>