From owner-freebsd-hackers Wed Sep 3 04:02:21 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id EAA05715 for hackers-outgoing; Wed, 3 Sep 1997 04:02:21 -0700 (PDT) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id EAA05704 for ; Wed, 3 Sep 1997 04:02:03 -0700 (PDT) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id LAA07543; Wed, 3 Sep 1997 11:49:53 +0200 From: Luigi Rizzo Message-Id: <199709030949.LAA07543@labinfo.iet.unipi.it> Subject: PnP support in userconfig To: hackers@freebsd.org Date: Wed, 3 Sep 1997 11:49:52 +0200 (MET DST) X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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/ _____________________________|______________________________________