next up previous
Next: Preparing the parallel port Up: Preparing the software Previous: Extending the file modules.conf

Subsections


IEEE support for the kernel and recompiling the kernel

IMPORTANT: With some distributions (e.g. Mandrake 7.2 should fall into this category) the precompiled default kernel already runs without the IEEE 1284 support option. So you might try to skip this section about the kernel and the recompilations of the kernel for now and return to it in case of problems (typically if the driver remains in the '' initializing'' state after the modules have been loaded).

For the driver to work properly, it might be necessary to turn off the IEEE 1284 transfer mode for the parallel port. With the SuSE 7.2 standard installation for example this is the case. Does that mean that as a SuSE 7.2 user you have to compile a new kernel although the manual strongly recommends against doing so? YES. But it is not that bad. The kernel sources have to be installed anyway in order for make to work, see section 2.1 about installation of the kernel sources within this document. The best thing is now: You won't ever have to boot your self-compiled kernel. You only need to compile it, for then the parport and parport_pc module will be compiled also and without IEEE 1284 support and will replace the old modules. Therefore after that, even when you boot the '' normal'' kernel, the IEEE 1284 transfer mode support will be disabled as desired. The rest is now not difficult any more. But pay attention though. For if the Kernel and the kernel modules are compiled again, the new modules will be created, but any old modules not selected in the new configuration WILL BE DELETED!!! So take heed, that you do not accidentally delete the modules you used to employ (probably even without knowing it). I see two easy ways to solve this problem:

  1. You can compile the kernel in a different directory and then instead of installing the new modules via make modules_install, install them '' by hand''. So you would just copy the new modules parport and parport_pc over the old ones. I will not go into more details about that in the sequel.
  2. The second (and probably better) solution is to retrieve the configuration of the precompiled kernel and apply only the minimal changes to it that are necessary. That way you will also keep almost all of your modules and apply the minor modifications needed to parport and parport_pc when installing the modules the usual way. This is the solution I used for my system so I will describe it in more detail below.

Retrieving the old kernel configuration

Log in as user root and change to the directory /proc/. Look at the files there. On my system that look like this:

Welcome to SuSE Linux 7.2 (i386) - Kernel 2.4.4-4GB (tty4).

mathplanet login: root
Password:
Last login: Fri Sep 14 19:12:16 on tty4
Have a lot of fun...
mathplanet:~ # cd /proc
mathplanet:/proc # ls
.    3    4    461  508  625  8          devices      ide         ksyms    net         stat
..   359  408  465  543  626  apm        dma          interrupts  loadavg  partitions  swaps
1    387  409  486  544  641  asound     driver       iomem       locks    pci         sys
197  388  421  487  545  7    bus        execdomains  ioports     meminfo  scsi        sysvipc
2    391  422  498  553  735  cmdline    fb           irq         misc     self        tty
201  392  433  5    554  736  config.gz  filesystems  kcore       modules  slabinfo    uptime
216  393  446  507  6    745  cpuinfo    fs           kmsg        mounts   splash      version
mathplanet:/proc #
The file config.gz is what we want! This file contains the configuration of the kernel now running. Actually this file is only there if the according kernel option is activated in the current kernel. The kernel documentation strongly recommends to activate it, so I guess most distributions will do so with their standard kernel and therefore the config.gz file really should be there. I you have multiple kernels supplied with your distribution and the file isn't there you could try booting a different kernel and hope it's there. If it isn't perhaps you could consult your distributions home page about it. Or probably best you could try to design your own kernel configuration and thereby tailor it to optimally suit your system. That can be real fun! But for now let's just assume the file is there. We copy it to our kernel source directory and unzip it there. On my system that (continuing the example from above) looks like this:
mathplanet:/proc # cp config.gz /usr/src/linux
mathplanet:/proc # cd /usr/src/linux
mathplanet:/usr/src/linux # ls -la co*
-r--r--r--    1 root     root         9486 Sep 14 19:22 config.gz
mathplanet:/usr/src/linux # gunzip config.gz
mathplanet:/usr/src/linux # mv config config.PreinstalledKernel
mathplanet:/usr/src/linux # exit
Now the configuration file with the configuration of the pre-installed kernel is there and ready. Only few changes have to be applied to the file and those we will discuss now in the following section:

Adapting the kernel configuration

Since this is so easy we start right with it: We log in as root and change to /usr/src/linux. On my system, that looks like:

Welcome to SuSE Linux 7.2 (i386) - Kernel 2.4.4-4GB (tty3).
 
mathplanet login: root
Password:
Last login: Sat Sep 1 12:27:25 on tty3
Have a lot of fun...
mathplanet:  # cd /usr/src/linux
mathplanet:/usr/src/linux #
There we start the kernel configuration. We to this as follows:
mathplanet:/usr/src/linux # make menuconfig
On my system I thereafter get a menu screen of the following form:
 Linux Kernel v2.4.4 Configuration
%________________________________________________________________________________
  _________________________________ Main Menu _________________________________
  _  Arrow keys navigate the menu.  <Enter> selects submenus --->.            _
  _  Highlighted letters are hotkeys.  Pressing <Y> includes, <N> excludes,   _
  _  <M> modularizes features.  Press <Esc><Esc> to exit, <?> for Help.       _
  _  Legend: [*] built-in  [ ] excluded  <M> module  < > module capable       _
  _ _________________________________________________________________________ _
  _ _            Code maturity level options  --->                          _ _
  _ _            Loadable module support  --->                              _ _
  _ _            Processor type and features  --->                          _ _
  _ _            General setup  --->                                        _ _
  _ _            Binary emulation of other systems  --->                    _ _
  _ _            Memory Technology Devices (MTD)  --->                      _ _
  _ _            Parallel port support  --->                                _ _
  _ _            Plug and Play configuration  --->                          _ _
  _ _            Block devices  --->                                        _ _
  _ _            Multi-device support (RAID and LVM)  --->                  _ _
  _ _            Networking options  --->                                   _ _
  _ _________________________________________________________________________ _
  _____________________________________________________________________________
  _                     <Select>    < Exit >    < Help >                      _
  _____________________________________________________________________________
Now before doing anything else, we should try to activate the default kernel configuration that we have retrieved and unpacked form the proc directory before. After we have loaded it, we can modify it as we like. The risk of loosing essential modules is thereby minimized. So we go to the very bottom of the menu screen. There we select the menu item Load an Alternate Configuration File. This should take us to a new menu mask where we are asked for the name of the desired configuration file. That will be config.PreinstalledKernel of course. So we enter that. On my system again, that looks like the following:
                      _______________________________________________________
                      _  Enter the name of the configuration file you wish  _
                      _  to load.  Accept the name shown to restore the     _
                      _  configuration you last retrieved.  Leave blank to  _
                      _  abort.                                             _
                      _ ___________________________________________________ _
                      _ _config.PreinstalledKernel                        _ _
                      _ ___________________________________________________ _
                      _______________________________________________________
                      _               <  Ok  >      < Help >                _
                      _______________________________________________________
(Be sure to delete the point in the word .config that might be standing there already. After pressing enter the new kernel configuration should have been loaded. When looking through the menus you will find that (at least in the SuSE 7.2 distribution) the precompiled kernel has activated almost every option and has compiled as modules <M> whatever can a compiled as module, even if it sounds rather weird like amateur radio and such things. You might be tempted to change some options where you are sure that they are not useful for system. Especially you might want to select the right processor type for your computer or turn off some other modules, but this is not necessary. For here I will stick to only those changes that are needed to get the Plustek driver to work. For this select the menu option Parallel port support -->. You should be getting a sub-menu of about the following form:
  ___________________________ Parallel port support ___________________________
  _  Arrow keys navigate the menu.  <Enter> selects submenus --->.            _
  _  Highlighted letters are hotkeys.  Pressing <Y> includes, <N> excludes,   _
  _  <M> modularizes features.  Press <Esc><Esc> to exit, <?> for Help.       _
  _  Legend: [*] built-in  [ ] excluded  <M> module  < > module capable       _
  _ _________________________________________________________________________ _
  _ _          <M> Parallel port support                                    _ _
  _ _          <M>   PC-style hardware                                      _ _
  _ _          [*]     Use FIFO/DMA if available (EXPERIMENTAL)             _ _
  _ _          [ ]     SuperIO chipset support (EXPERIMENTAL)               _ _
  _ _          [ ]   Support foreign hardware                               _ _
  _ _          [*]   IEEE 1284 transfer modes                               _ _
  _ _                                                                       _ _
  _ _                                                                       _ _
  _ _                                                                       _ _
  _ _                                                                       _ _
  _ _                                                                       _ _
  _ _________________________________________________________________________ _
  _____________________________________________________________________________
  _                     <Select>    < Exit >    < Help >                      _
  _____________________________________________________________________________
As you see the Parallel port support and PC-style hardware are compiled as modules. (The M between the angles indicates that.) That is fine and as we want it, for therefore the IEEE 1284 transfer mode, is active also only in the modules. Therefore if the modules are changed and we boot the same kernel again, the IEEE 1284 transfer mode should be turned off. So the next thing we do is turn the IEEE 1284 transfer mode option off. The sub-menu should look then look like this:
  ___________________________ Parallel port support ___________________________
  _  Arrow keys navigate the menu.  <Enter> selects submenus --->.            _
  _  Highlighted letters are hotkeys.  Pressing <Y> includes, <N> excludes,   _
  _  <M> modularizes features.  Press <Esc><Esc> to exit, <?> for Help.       _
  _  Legend: [*] built-in  [ ] excluded  <M> module  < > module capable       _
  _ _________________________________________________________________________ _
  _ _          <M> Parallel port support                                    _ _
  _ _          <M>   PC-style hardware                                      _ _
  _ _          [*]     Use FIFO/DMA if available (EXPERIMENTAL)             _ _
  _ _          [ ]     SuperIO chipset support (EXPERIMENTAL)               _ _
  _ _          [ ]   Support foreign hardware                               _ _
  _ _          [ ]   IEEE 1284 transfer modes                               _ _
  _ _                                                                       _ _
  _ _                                                                       _ _
  _ _                                                                       _ _
  _ _                                                                       _ _
  _ _                                                                       _ _
  _ _________________________________________________________________________ _
  _____________________________________________________________________________
  _                     <Select>    < Exit >    < Help >                      _
  _____________________________________________________________________________
Fine. Now we are done with the kernel configuration. We only need to save it. You can save your new kernel configuration with the menu option Save Configuration to an Alternate File, but it is NOT sufficient to do so! If you press Escape after that, you will be prompted again whether you want to save you configuration:
           ____________________________________________________________
           _   Do you wish to save your new kernel configuration?     _
           ____________________________________________________________
           _                   < Yes >      <  No  >                  _
           ____________________________________________________________
This is the important question. Say yes. This will write your new configuration to the file .config and this is the file that will be used when the kernel is compiled! Now the configuration is really done. We can proceed to the next step which is compiling and installing the kernel modules.

Compiling the kernel and installing the modules

All that is left to do should fit into one single command line. If you want to compile the whole kernel (just to be sure or perhaps because you intend to use it instead of your standard kernel) you should proceed as follows:

Welcome to SuSE Linux 7.2 (i386) - Kernel 2.4.9 (tty2).

athlonlinux login: root
Password:
You have new mail in /var/mail/root.
Last login: Sat Oct  6 08:11:38 on tty2
Have a lot of fun...
athlonlinux:~ # cd /usr/src/linux
athlonlinux:/usr/src/linux # make dep clean bzImage modules modules_install
This will do EVERYTHING. On my old machine (called mathplanet) the compilation of the kernel via this command line took about two and a half hours. On my new machine (called athlonlinux) it takes about 5 minutes. There should be tons of compilation messages on the screen. After the messages have ceased, you should get something like
[snip]
make[1]: Entering directory `/usr/src/linux-2.4.9/arch/i386/mm'
make[1]: Nothing to be done for `modules_install'.
make[1]: Leaving directory `/usr/src/linux-2.4.9/arch/i386/mm'
make -C  arch/i386/lib modules_install
make[1]: Entering directory `/usr/src/linux-2.4.9/arch/i386/lib'
make[1]: Nothing to be done for `modules_install'.
make[1]: Leaving directory `/usr/src/linux-2.4.9/arch/i386/lib'
cd /lib/modules/2.4.9; \
mkdir -p pcmcia; \
find kernel -path '*/pcmcia/*' -name '*.o' | xargs -i -r ln -sf ../{} pcmcia
if [ -r System.map ]; then /sbin/depmod -ae -F System.map  2.4.9; fi
athlonlinux:/usr/src/linux #
Perhaps it would also suffice to use
make modules modules_install
as your command line. I haven't tested it. If your machine is slow that might save you some time.

Now that the compilation of the kernel and kernel modules is done and the modules are successfully installed, the kernel should automatically load the new modules parport and parport_pc without the IEEE 1284 transfer mode support and therefore the Plustek driver should be able to work.

But perhaps the old modules are still loaded into memory. We should instruct the kernel to reload the modules now. Under Windows you probably would have to restart now.... We could reboot too, but this shouldn't be necessary. For us it should suffice to unload the old modules and load the new ones. You could do this as follows:
depmod -a
modprobe -r parport
modprobe -r parport_pc
modprobe parport
modprobe parport_pc
Now the IEEE 1284 transfer mode should also have left your computers memory. You can now try to load the Plustek driver.


next up previous
Next: Preparing the parallel port Up: Preparing the software Previous: Extending the file modules.conf
Johannes Prix
2003-06-12