1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
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 vector ascintr
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.
|