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