Give the scanner a home in a Linux system.

  

The setup and use of the scanner under Linux is significantly more troublesome than the Windows operating system. In fact, many of the current problems are caused by some defects in the kernel and SCSI drivers. If you use a newer kernel version, you can make your scanner scan out under Linux with a simple patch and recompilation!

The operating system I use is the latest release of "BluePoint 2.0" and "Microtek Scanmaker X6" scanners in Chinese Linux. Users of other Linux distributions or other branded scanners can also download patch files and drivers for the relevant brands in a similar way.

Methods and Procedures:

(1) Download related files

First, start with the most basic - the source code patch file of the kernel SCSI driver. As we all know, the kernel version used by Blue Point is 2.2.16. Just download a patch file corresponding to the Linux kernel version to support it. When you install the kernel source code in the "/usr/src" directory of Linux, you can get the patch file "Linux 2.2.15pre14-ppscsi1" by downloading it from the website (people.redhat.com/twaugh/parport) for free. If you download the patch file "Linux 2.2.16pre14-ppscsi1", the higher version will be backward compatible and the performance is much better than the lower version.

Next is the "Linux" system's essential scanner driver interface - "SANE". You can go to (www.mostang.com/sane) to download the latest version. I recommend that you do not download its "RPM compressed package", but download its source code. Because the next step is to manually complete some aspects of the setup.

(2) Patching the kernel file

In order to prevent the kernel from being backed up before patching the kernel, you can reinstall it from the installation CD after a problem occurs. Kernel source code package (CD/BluePoint/RPMS/kernel-source-2.2.16-1.i386.rpm). After you download the kernel patch file, you should enter the system as "root", put the patch file in the "/usr/src" directory, and then execute the following commands in order:

1. mv ppSCSI *.patch /usr/src

2, patch -p0 < ppSCSI*.patch

At this point, the kernel has been patched, followed by the steps to set up and compile.

3, enter the source code directory (/usr/src/linux): cd /usr/src/linux

4, call the "make" source code compiler control program: "make menuconfig"

5, under the "SCSI support" option in the control program (Figure 1), select "SCSI support", for "SCSI support" and "Generic SCSI support", press "Y" Embed SCSI support into the source code (showing the "*" sign) or press "M" to compile the SCSI support into a module (displaying the "M" number, which must be dynamically loaded when using the module).


Figure 1

6. In the control program under the "SCSI support" option (Figure 2), enter the "SCSI low level drivers" option directory, select "parallel port SCSI adapter" (parallel SCSI adapter) and "Onspec 90c26 adapter" (Onspec 90c26 adapter).


Figure 2

7. After completing the setup, compile the kernel, compile and install these modules.

(3) Compiling and installing the "SANE" and "Microtek" drivers

The driver I downloaded to get SANE is "sane" -1.0.2.tar.gz", the Microtek driver is "microtek2-0.8.tar.gz".

After you have downloaded the two files, you will enter the system as the "root" account. First unzip "SANE": tar -xvzf sane-1.0.1.tar.gz. Then decompress the "microtek2" background control program: tar -xvzf microtek2-0.8.tar.gz.

You will see two new files: "microtek2.c" and "microtek2.h". Copy them into the "backend" directory of the "SANE" source code, then go to the source directory of "SANE" and compile it. , as follows:

cd sane-1.0.1

./configure

make

make install

(4) Loading the Driver Module

Now that you are successful, you must power on the scanner before restarting the machine. Because the SCSI driver checks the second parallel port (COM) only when it is booted, if the scanner is not powered, the system will report that the "SANE" device is not found. After the restart, the compiled module must also be loaded into the kernel.

If your Linux system is "Blue Point 2.0", it is very easy to install a dynamic module. In fact, you can just install the most necessary modules, and they will be automatically loaded when other dependent modules are called at runtime. First enter the login system with the "root" account, and then load the driver module according to the situation:

If the SCSI driver is compiled into the kernel in the second step: "insmod onscsi" is required;

If the SCSI driver is compiled as a dynamic module in the second step, you must load it in using "insmod scsi_mod" (scsi_mod, any SCSI device driver module). The command to execute is: "insmod ppscsi" followed by "insmod onscsi".

You can use the scanner at this point. However, you must execute these commands after each startup to use the scanner. In fact, if you want to do it once and for all, just add these two lines of commands to the system startup file "/etc/rc.d/rc.local" at the end (note: you must be "root" account login to have the right to modify):

insmod ppscsi

insmod onscsi

(5) Set the scanner device

Enter the "tools" directory of the source code of "SANE", which has a name For the "find-scanner" command, run it: "./find-scanner -v". It will find the scanner and tell you where it is (perhaps you have to use "Shift+PageUp" to turn the screen up to see this information). Its location is usually "/dev/sg0" or "/dev/sga", and sometimes both will appear at the same time.

Then type the command to indicate the scanner device: "ln -s /dev/sg0 /dev/scanner". If you have a scanner for all your accounts, type the command: "chmod 666 /dev/sga" (where dev/sg0 is the location of the scanner device).

Ok, so you can type "scanimage" or "xscanimage" to enjoy scanning at any time!

In the world of Linux operating systems, it’s not difficult to give your scanner a home in Linux, but from the whole job, of course it’s more troublesome than other operating systems (Windows). It is much more difficult and requires some key commands. I hope this article will give you some insight. This will deepen the love of the "Linux operating system."

Copyright © Windows knowledge All Rights Reserved