237 lines
		
	
	
		
			5.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			237 lines
		
	
	
		
			5.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
		
			Executable File
		
	
	
	
	
| EUTRON
 | |
| 
 | |
| Internet : http://www.smartkey.eutron.com
 | |
| Helpdesk email : helpdesk@eutron.com
 | |
| Commercial email : info@eutron.com
 | |
| Commercial phone : +39-035697080
 | |
| Fax : +39-035697092
 | |
| 
 | |
| 
 | |
| SmartKey Parallel and USB driver for Linux
 | |
| ------------------------------------------
 | |
| 
 | |
| This driver works for kernel from 2.4.21-144 (Suse 9) compiled with gcc-3.2.3
 | |
| 
 | |
| The application provides an interface between the C language and the 
 | |
| driver of the SMARTKEY key. The application is totally compatible with 
 | |
| the one available under MS-DOS. This makes it easy to port programs 
 | |
| written for the MS-DOS operating system to the Unix environment.
 | |
| 
 | |
| 
 | |
| CONTENTS 
 | |
| --------
 | |
| 
 | |
| The package contains the following files:
 | |
| 
 | |
| clink.o
 | |
| 	This is the interface between C programs and the SMARTKEY 
 | |
| 	driver.
 | |
| 
 | |
| clink.h
 | |
| 	This outlines the structure of the clink.o interface. It has to be used 
 | |
| 	in the C files that use the SMARTKEY key.
 | |
| 
 | |
| smartdem.c
 | |
| 	An example, written in C, of how to use the SMARTKEY key.
 | |
| 
 | |
| smartdem
 | |
| 	Executable of the sample program.
 | |
| 	
 | |
| skey*.o
 | |
| 	Drivers of the key
 | |
| 
 | |
| skinstall
 | |
| 	Script for automatic installation
 | |
| 
 | |
| skuninstall
 | |
| 	Script for automatic uninstalling
 | |
| 
 | |
| skeyver
 | |
| 	Utility for setting the version of the kernel in the skey.o 
 | |
| 	module
 | |
| 
 | |
| 
 | |
| USB SUPPORT
 | |
| -----------
 | |
| 
 | |
| The Smarkey driver, like any other USB driver, requires that the USB 
 | |
| modules of the kernel are active and running. Generally you can obtain 
 | |
| this running these commands :
 | |
| 
 | |
| 	insmod usbcore
 | |
| 	insmod usb-uhci
 | |
| 
 | |
| for PCs with an USB controller UHCI by Intel, VIA, ...
 | |
| 
 | |
| 	insmod usbcore
 | |
| 	insmod usb-ohci
 | |
| 
 | |
| for PCs with an USB controller OHCI by Compaq, iMacs, OPTi, SiS, ALi...
 | |
| 
 | |
| 
 | |
| UPGRADING
 | |
| ---------
 | |
| 
 | |
| To upgrade from the previous version of the SmartKey driver you need to 
 | |
| relink your application with the new clink.o object.
 | |
| 
 | |
| If you don't relink, your application will work only with the first USB 
 | |
| key inserted and with the parallel port addresses 0x3BC and 0x378. You 
 | |
| will lose the access at the parallel port at address 0x278 substituted 
 | |
| with the first USB key.
 | |
| 
 | |
| 
 | |
| AUTOMATIC INSTALLATION PROCEDURE
 | |
| --------------------------------
 | |
| 
 | |
| Start the skinstall script with root rights using the commands:
 | |
| 
 | |
| 			chmod a+x skinstall
 | |
| 			./skinstall
 | |
| 
 | |
| The installation will configure the system for the automatic loading of 
 | |
| the SmartKey module the first time it is run.
 | |
| 
 | |
| To uninstall the driver use the commands:
 | |
| 
 | |
| 			chmod a+x skuninstall
 | |
| 			./skuninstall
 | |
| 
 | |
| Every time the version of the kernel changes, you will have to perform 
 | |
| the installation again.
 | |
| 
 | |
| To start the demo application use the commands:
 | |
| 
 | |
| 			chmod a+x smartdem
 | |
| 			./smartdem
 | |
| 
 | |
| 
 | |
| 
 | |
| MANUAL INSTALLATION PROCEDURE
 | |
| -----------------------------
 | |
| 
 | |
| To install the driver follow this procedure:
 | |
| 
 | |
| 1) Access the system as a super-user.
 | |
| 
 | |
| 2) Go to the /dev directory using the command:
 | |
| 
 | |
| 			cd /dev
 | |
| 
 | |
|    create the file for accessing the key using the commands:
 | |
| 
 | |
| 			mknod skey0 c 59 0
 | |
| 			mknod skey1 c 59 1
 | |
| 			mknod skey2 c 59 2
 | |
| 			mknod skey3 c 59 3
 | |
| 			mknod skey4 c 59 4
 | |
| 			mknod skey5 c 59 5
 | |
| 
 | |
|    and change the properties and the group of files using the commands:
 | |
| 
 | |
| 			chmod 666 skey?
 | |
| 			chgrp daemon skey?
 | |
| 
 | |
| 3) Identify the correct driver for your particular configuration. There are 
 | |
| three alternatives:
 | |
| 
 | |
| 	skey_R.o	Kernel mono-processor with version information
 | |
| 	skey_Rsmp_.o	Kernel multi-processor with version information
 | |
| 	skey_Rsmp.o	Kernel multi-processor with version information for
 | |
| 			RedHad
 | |
| 	skey.o		Kernel mono-processor without version information
 | |
| 
 | |
| 
 | |
|    A simple test can be carried out using the command:
 | |
| 
 | |
| 			grep printk /proc/ksyms
 | |
| 
 | |
|    on receiving the output :
 | |
| 
 | |
| 		... printk_R1b7d4074		driver skey_R.o
 | |
| 		... printk_Rsmp_1b7d4074	driver skey_Rsmp_.o
 | |
| 		... printk_Rsmp1b7d4074		driver skey_Rsmp.o
 | |
| 		other				driver skey.o
 | |
| 
 | |
|    Re-name the driver identified with the name skey.o
 | |
| 
 | |
| 4) Configure the skey.o module with the current version of the kernel:
 | |
| 
 | |
| 			chmod a+x skeyver
 | |
| 			./skeyver skey.o
 | |
| 
 | |
| 5) The driver skey.o is in the form of a dynamically loadable module.
 | |
|    Therefore before it can be used, it has to be loaded with the command:
 | |
| 
 | |
| 			insmod skey
 | |
| 
 | |
| 6) To configure the driver for automatic loading the first time it is run, 
 | |
| do the following:
 | |
| 
 | |
| 6.1) Add the line:
 | |
| 
 | |
| 			alias char-major-59 skey
 | |
| 
 | |
|      at the end of the file /etc/conf.modules
 | |
| 
 | |
| 6.2) Copy the file skey.o to the directory /lib/modules/KERNELVERSION/misc,
 | |
|      where KERNELVERSION is the version of the kernel.
 | |
|      The version of the kernel can be viewed using the command:
 | |
|      
 | |
| 			uname -r
 | |
|      
 | |
| 6.3) Update the dependencies of the modules using the command:
 | |
| 
 | |
| 			depmod -a
 | |
| 
 | |
| 6.4) Remove any copies of the driver that might be in memory by using the 
 | |
| command:
 | |
| 
 | |
| 			rmmod skey
 | |
| 
 | |
|      and check automatic loading of the module using the command:
 | |
| 
 | |
| 			modprobe skey
 | |
| 
 | |
|      If there are no error messages it means that loading was successful.
 | |
| 
 | |
| 
 | |
| 
 | |
| USE
 | |
| ---
 | |
| 
 | |
| In order to use the clink.o interface you have to copy the file to the 
 | |
| working directory and link it to the other object files which make up the 
 | |
| program to protect. You will have to include the file clink.h in the program 
 | |
| files that use the clink.o module. If the C compiler you are using isn't 
 | |
| ANSI-C, you will have to use the compile option -DNO_ANSI_C.
 | |
| 
 | |
| 
 | |
| CONFIGURATION
 | |
| -------------
 | |
| 
 | |
| If you are using a PCI Parallel port which doesn't use a standard IO
 | |
| address you need to specify the effective address of the IO port with
 | |
| the "port" module argument.
 | |
| 
 | |
| The argument accept up to 3 values separated by commas. The default values
 | |
| are 0x378, 0x278, 0x3bc.
 | |
| 
 | |
| For example :
 | |
| 
 | |
| 	insmod skey port=0x800
 | |
| 
 | |
| or
 | |
| 
 | |
| 	insmod skey port=0x800,0x810,0x820
 | |
| 
 | |
| 
 | |
| If you are using an OHCI (Open Host Controller Interface) USB bus,
 | |
| generally present in all the additional PCI USB port, you need to
 | |
| specify the module argument "fastusb=0".
 | |
| 
 | |
| For example :
 | |
| 
 | |
| 	insmod skey fastusb=0
 | |
| 
 |