mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-27 11:55:06 +00:00
17d1bf4260
configured in drivers.
87 lines
3.0 KiB
Plaintext
87 lines
3.0 KiB
Plaintext
To install the device driver, please do the following steps:
|
|
|
|
1. Install the files by copying them as listed in the following table:
|
|
|
|
asc.c /usr/sys/i386/isa/
|
|
ascreg.h /usr/sys/i386/isa/
|
|
asc_ioctl.h /usr/sys/i386/include/
|
|
|
|
Note that if you have copies of the system header directories
|
|
in /usr/include/ instead of symbolic links, you have to copy
|
|
`asc.h' to /usr/include/machine/ also. I recommend to replace
|
|
the copies by links though.
|
|
|
|
[the following steps, 2..5, can be achieved by moving to
|
|
/sys/i386 and doing "patch < diffs.asc"]
|
|
|
|
2. Make the driver source known to config(8) by editing the file
|
|
/usr/src/sys/i386/conf/files.i386. Just append the following line:
|
|
|
|
i386/isa/asc.c optional asc device-driver
|
|
|
|
3. Include a driver access record in /usr/src/sys/i386/i386/conf.c
|
|
Append the following structure at the end of the array that
|
|
contains the *character* device drivers. Remember the major number
|
|
that will be used for the driver, i.e. the number following the
|
|
number af the preceeding record.
|
|
|
|
{ ascopen, ascclose, ascread, nowrite, /*<major>*/
|
|
ascioctl, nostop, nullreset, nodevtotty, /* asc */
|
|
ascselect, nommap, NULL },
|
|
|
|
4. Insert the definitions for the base port addresses of the device
|
|
into the file /usr/src/sys/i386/isa/isa.h:
|
|
|
|
#define IO_ASC1 0x3EB /* AmiScan addr.grp. 1 */
|
|
#define IO_ASC2 0x22B /* AmiScan addr.grp. 2 */
|
|
#define IO_ASC3 0x26B /* AmiScan addr.grp. 3 */
|
|
#define IO_ASC4 0x2AB /* AmiScan addr.grp. 4 */
|
|
#define IO_ASC5 0x2EB /* AmiScan addr.grp. 5 */
|
|
#define IO_ASC6 0x32B /* AmiScan addr.grp. 6 */
|
|
#define IO_ASC7 0x36B /* AmiScan addr.grp. 7 */
|
|
#define IO_ASC8 0x3AB /* AmiScan addr.grp. 8 */
|
|
|
|
5. Patch /dev/MAKEDEV by adding the following lines in the switch to
|
|
create the device entries:
|
|
|
|
asc*)
|
|
rm -f asc0
|
|
mknod asc0 c 68 0
|
|
mknod asc0p c 68 8
|
|
chmod 666 asc0 asc0p
|
|
chown root.wheel asc0 asc0p
|
|
;;
|
|
|
|
|
|
|
|
6. Edit your kernel configuration file (in /usr/src/sys/i386/conf/)
|
|
by inserting the following line:
|
|
|
|
device asc0 at isa? port 0x2ab tty drq 3 irq 10
|
|
|
|
This should usually work for you as it reflects the factory
|
|
settings of the AMI scanner. However, if this conflicts with
|
|
any other device on your system, you have the option to change
|
|
`drq 3' into `drq 1' or `drq 5' and the actual port value to
|
|
"IO_ASC1".. "IO_ASC8" as defined in isa.h
|
|
|
|
7. Rebuild the kernel, don't forget to config(8) and `make depend' first.
|
|
|
|
8. Make the following device nodes:
|
|
|
|
mknod /dev/asc0 c <major> 0
|
|
mknod /dev/asc0p c <major> 8
|
|
|
|
(or, cd /dev and do ./MAKEDEV asc0).
|
|
|
|
If you plan to modify the and debug the driver, add these (you
|
|
won't need these though, unless you know how to get this
|
|
information from elsewhere.
|
|
|
|
mknod /dev/asc0d c <major> 32
|
|
mknod /dev/asc0pd c <major> 40
|
|
|
|
9. Install the new kernel and reboot. You can try the driver by
|
|
doing a simple "cat /dev/asc0p > myfile.pbm" and then trying
|
|
to display the PBM image with xv or some other tool.
|