Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.bin / sasc / INSTALL
1 $FreeBSD: src/usr.bin/sasc/INSTALL,v 1.2.6.1 2001/03/04 09:04:15 kris Exp $
2
3 To install the device driver, please do the following steps:
4
5 1. Install the files by copying them as listed in the following table:
6
7         asc.c           /usr/sys/i386/isa/
8         ascreg.h        /usr/sys/i386/isa/
9         asc_ioctl.h     /usr/sys/i386/include/
10
11    Note that if you have copies of the system header directories
12    in /usr/include/ instead of symbolic links, you have to copy
13    `asc.h' to /usr/include/machine/ also. I recommend to replace
14    the copies by links though.
15
16 [the following steps, 2..5, can be achieved by moving to
17  /sys/i386 and doing "patch < diffs.asc"]
18
19 2. Make the driver source known to config(8) by editing the file 
20    /usr/src/sys/i386/conf/files.i386. Just append the following line:
21
22         i386/isa/asc.c  optional        asc     device-driver
23
24 3. Include a driver access record in /usr/src/sys/i386/i386/conf.c 
25    Append the following structure at the end of the array that
26    contains the *character* device drivers. Remember the major number
27    that will be used for the driver, i.e. the number following the
28    number af the preceding record.
29
30         { ascopen,      ascclose,       ascread,        nowrite, /*<major>*/
31           ascioctl,     nostop,         nullreset,      nodevtotty, /* asc */
32           ascselect,    nommap,         NULL },
33
34 4. Insert the definitions for the base port addresses of the device
35    into the file /usr/src/sys/i386/isa/isa.h:
36
37 #define IO_ASC1         0x3EB           /* AmiScan addr.grp. 1 */
38 #define IO_ASC2         0x22B           /* AmiScan addr.grp. 2 */
39 #define IO_ASC3         0x26B           /* AmiScan addr.grp. 3 */
40 #define IO_ASC4         0x2AB           /* AmiScan addr.grp. 4 */
41 #define IO_ASC5         0x2EB           /* AmiScan addr.grp. 5 */
42 #define IO_ASC6         0x32B           /* AmiScan addr.grp. 6 */
43 #define IO_ASC7         0x36B           /* AmiScan addr.grp. 7 */
44 #define IO_ASC8         0x3AB           /* AmiScan addr.grp. 8 */
45
46 5. Patch /dev/MAKEDEV by adding the following lines in the switch to
47    create the device entries:
48
49         asc*)
50               rm -f asc0       
51               mknod asc0 c 68 0
52               mknod asc0p c 68 8      
53               chmod 666 asc0 asc0p
54               chown root.wheel asc0 asc0p     
55               ;;
56   
57
58
59 6. Edit your kernel configuration file (in /usr/src/sys/i386/conf/)
60    by inserting the following line:
61
62         device  asc0    at isa? port 0x2ab tty drq 3 irq 10
63
64    This should usually work for you as it reflects the factory
65    settings of the AMI scanner. However, if this conflicts with
66    any other device on your system, you have the option to change
67    `drq 3' into `drq 1' or `drq 5' and the actual port value to
68    "IO_ASC1".. "IO_ASC8" as defined in isa.h
69
70 7. Rebuild the kernel, don't forget to config(8) and `make depend' first.
71
72 8. Make the following device nodes:
73
74         mknod /dev/asc0   c <major> 0
75         mknod /dev/asc0p  c <major> 8
76
77    (or, cd /dev and do ./MAKEDEV asc0).
78
79    If you plan to modify the and debug the driver, add these (you
80    won't need these though, unless you know how to get this
81    information from elsewhere.
82
83         mknod /dev/asc0d  c <major> 32
84         mknod /dev/asc0pd c <major> 40
85
86 9. Install the new kernel and reboot. You can try the driver by
87    doing a simple "cat /dev/asc0p > myfile.pbm" and then trying
88    to display the PBM image with xv or some other tool.