Quantis Installation Copyright (c) 2004 - 2010, ID Quantique We thank you for choosing our product. If you have questions, please contact:
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
This document explains how to install the Quantis-PCI and Quantis-USB drivers and how to generate random numbers from various platforms. Table of contentsI. Quantis-PCIA. Windows Operating System1. Installation procedure for Windows1) Turn off your computer 2) Plug the PCI card into an available PCI slot 3) Turn on your computer 4) Insert the CD-ROM that came with this product. Make sure that your CD drive recognizes the CD-ROM. 5) Windows may ask for an 'inf' file. In this case browse and locate the file on this CD-ROM (in the Quantis-PCI directory) then click ok. 6) Follow the instructions to finish the installation. 7) The driver is now installed. Run setup.exe to install the program files and all the documention in your system. 2. Testing your Quantis RNG2.1 Graphical applicationA Windows-based graphical application to acquire random data in several formats is provided. It is installed by the setup program. You can access it in Start Menu -> Programs -> Quantis -> WinQuantis.
2.2 MS-DOS applicationAnother sample application, using the quantis library and running in MS-DOS mode is provided on the CD-ROM. 1) To view the parameters needed to run our sample application, run the file qrng.exe installed by the setup program (Start Menu -> Programs -> Quantis -> Quantis Console). The following parameters will be displayed: qrng Usage: ./qrng -n bytes [-b|-u max] [-o output][-c] [-p cardnumber] -n : amount of bytes -b : dump in binary (default in ASCII hex) -u : dump in unsigned decimal with max the max number (must be below 65535) -o : output file (default to stdout) -c : order data in one column -p : PCI card number (default 0) 2) To generate a file of random numbers, edit the qrng.bat file or enter the corresponding command at the command-line prompt. For example, to generate a binary file of 1 million random bytes, type (you need to be in the right folder): qrng -n 1000000 -b -o filename.dat 2.3 Quantis libraryA library to access the quantis device is provided in this package, both in source and in binary form named quantis.dll / quantis.lib for Quantis-PCI and quantis-usb.dll / quantis-usb.lib for Quantis-PCI. A documentation for the API of the library can be found in the file "Library API.pdf" of the CD-ROM's doc directory. B. Linux Operating System1. Installation procedure for LinuxQuantis driver works with Linux kernel 2.4 and 2.6. The driver needs to be installed as root. 1.1 Driver Installation procedure for kernel 2.4 and 2.61) Turn off your computer 2) Plug the PCI card into an available PCI slot 3) Turn on your computer 4) Insert the CD-ROM that came with this product. 5) Copy the Quantis-PCI/src/linux directory to your hard drive 6) Build the driver and the programs using the command: cd Quantis-PCI/src/linux/ make If you kernel source directory is not /usr/src/linux, edit the file driver/Makefile and change the KERNELDIR variable to your correspondig kernel source directory 7) Install the driver module using the command: cd driver/ insmod quantis.o Check that the module has been installed correctly using the lsmod command. 7') For kernel 2.6, install the driver module using the command: cd driver/ insmod quantis.ko Check that the module has been installed correctly using the lsmod command. 8) Create the device files under /dev/. e.g. mkdir /dev/qrandom mknod /dev/qrandom/0 c 254 0 mknod /dev/qrandom/1 c 254 1 ... (0 for the first card, 1 for the second, ...) You need the major device number of quantis (254 above) to perform the operation. This information can be retrieved in /proc/qrandom or /proc/devices file or in the output of the dmesg command. e.g. cat /proc/qrandom PCI-Quantis driver version 1.1 with support for 10 cards driver 'qrandom', device major 254 found 3 card(s) card 0 version:0x04060100 card 1 version:0x04060100 card 2 version:0x04060101 The major device number can also be set at driver installation: insmod quantis.o quantisMajor=233 1.2 Driver Installation procedure for kernel 2.4 with DEVFS enabledQuantis driver also works for kernel 2.4 (but not 2.6) with DEVFS enabled. With DEVFS enabled in your kernel, the quantis device is directly available in /dev/ after the driver installation. Without DEVFS, you need to create the device files in /dev to access the quantis device after the driver installation. Type this command to check if DEVFS is enabled in your system: grep devfs /proc/filesystems If you get a line with "nodev devfs", DEVFS is installed. 1) Turn off your computer 2) Plug the PCI card into an available PCI slot 3) Turn on your computer 4) Insert the CD-ROM that came with this product. 5) Copy the Quantis-PCI/src/linux directory to your harddrive 6) Edit the file Quantis-PCI/src/linux/driver/Makefile and uncomment the line: #OPTFLAGS += -DUSE_DEVFS 6) Build the driver and the programs using the command: cd Quantis-PCI/src/linux/ make If you kernel source directory is not /usr/src/linux, edit the file driver/Makefile and change the KERNELDIR variable to your correspondig kernel source directory 8) Install the driver module using the command: cd driver/ insmod quantis.o Check that the module has been installed correctly using the lsmod command. The quantis device should now be available as /dev/qrandom/0. 2. Testing your Quantis RNG2.1 Direct access via the device fileRandom numbers can be dumped via the device file, for example with the following command: dd if=/dev/qrandom/0 of=data.bin count=1 bs=1k (Note for Quantis-USB, the device file is named /dev/usb/qrandom/0 ) This command copies 1024 random bytes from the quantis device to the file data.bin. You can also read random numbers directly from the device file in the programming language of your choice. For example, in C you can read random data from the device file by using the functions open(2) and read(2). 2.2 Sample applicationA sample console application using the quantis library is provided on the CD-ROM. Compile it by using the make command in the program's directory. 1) Run the qrng programm without arguments and the following parameters will be displayed. qrng Usage: ./qrng -n bytes [-b|-u max] [-o output][-c] [-p cardnumber] -n : amount of bytes -b : dump in binary (default in ASCII hex) -u : dump in unsigned decimal with max the max number (must be below 65535) -o : output file (default to stdout) -c : order data in one column -p : PCI card number (default 0) 2) To generate a file of random numbers, enter the corresponding command at the command line prompt. For example, to generate a binary file of 1 million random bytes, type: ./qrng -n 1000000 -b -o filename.dat 2.3 Quantis libraryA library to access the quantis device is provided in this package, both in source and in binary form, named libquantis.a for Quantis-PCI and libquantis-usb.a for Quantis-USB. A documentation for the API of the library can be found in the file "Library API.pdf". NB: A developper can also access the device directly by using IOCTL calls. Example of IOCTL calls can be found in libquantis.c C. FreeBSD Operating System1. Driver Installation procedure for FreeBSD (4, 5 and 6):The driver needs to be installed as root. 1) Turn off your computer 2) Plug the PCI card into an available PCI slot 3) Turn on your computer 4) Insert the CD-ROM that came with this product. 5) Copy the Quantis-PCI/src/freebsd directory to your harddrive 6) Build the driver with the command: cd Quantis-PCI/src/freebsd/ make 7) Install the driver module using the command: cd driver/ make install && kldload quantis Check that module has been installed correctly using the kldstat command. 8) The devices files are automatically created by the Makefile. To manually recreate the dev file (FreeBSD 4 and 5), type the commands: mkdir /dev/qrandom mknod /dev/qrandom/0 c 32 0 The default major device number in quantis is 32. It can be changed in quantis.c with the CDEV_MAJOR constant. 2. Testing your PCI cardPlease refer to Quantis-PCI, B.2. D. Solaris Operating System1. Driver Installation procedure for Solaris (SPARC, x86, x64 - v8, 9, 10)The driver needs to be installed as root. 1) Turn off your computer 2) Plug the PCI card into an available PCI slot 3) Turn on your computer 4) Insert the CD-ROM that came with this product. 5) Copy the Quantis-PCI/src/solaris directory to your harddrive 6) For x86 or SPARC, to build the driver, use the commands: cd Quantis-PCI/src/solaris/ cd driver/ make clean cd .. make 6') For x64 architecture (AMD64 or Xeon EM64T), build the driver with the commands: cd Quantis-PCI/src/solaris/ mv driver/Makefile driver/Makefile.old mv driver/Makefile-x64 driver/Makefile make For 6) and 6') If you use the gcc compiler, please edit the Makefiles to make sure the correct switches are used. If you use the sunCC compiler, make sure the CC and CXX environment variables are set correctly: export CC=cc CXX=CC 7) Install the driver module using the command: cd driver/ make install && make load You may need to refresh the dynamic links in the /dev directory using the command: devlinks Check that module has been installed correctly using the prtconf command: prtconf -D | grep quantis 2. Testing your Quantis RNGPlease refer to Quantis-PCI, B.2. II. Quantis-USBA. Windows Operating System1. Installation procedure for WindowsNote : In this version, under Windows only one Quantis USB device can be connected at a time. 1) Plug the Quantis-USB device card into an available USB1 or USB2 slot 2) Insert the CD-ROM that came with this product. Make sure that your CD drive recognizes the CD-ROM. 3) Windows may ask for an 'inf' file. In this case browse and locate the file on this CD-ROM (in the Quantis-USB directory) then click ok. 4) Follow the instructions to finish the installation. 5) The driver is now installed. Run setup.exe to install the program files and all the documention in your system. 2. Testing your Quantis RNGPlease refer to Quantis-PCI, A.2. B. Linux Operating System1. Installation procedure for LinuxQuantis-USB driver works with Linux kernel 2.4 and 2.6. The driver needs to be installed as root. 1.1 Driver Installation procedure for kernel 2.4 and 2.61) Insert the CD-ROM that came with this product. 2) Copy the Quantis-USB/src/linux directory to your hard drive 3) Build the driver and the programs using the command: cd Quantis-USB/src/linux/ make If you kernel source directory is not /usr/src/linux, edit the file driver/Makefile and change the KERNELDIR variable to your correspondig kernel source directory 4) Install the driver module using the command: cd driver/ insmod quantis-usb.o Check that the module has been installed correctly using the lsmod command. 5') For kernel 2.6, install the driver module using the command: cd driver/ insmod quantis-usb.ko Check that the module has been installed correctly using the lsmod command. 6) Create the device files under /dev/usb/. e.g. mkdir -p /dev/usb/qrandom mknod /dev/usb/qrandom/0 c 180 198 mknod /dev/usb/qrandom/1 c 180 199 ... (0 for the first device, 1 for the second, ...) You need the minor base device number of quantis (default is 198) to perform the operation. This information can be retrieved in the output of the dmesg command. e.g. $ dmesg | grep Quantis | grep MINOR quantis-usb.c: Quantis USB QRNG now attached to USB-Quantis-0 with MINOR = 198 This minor base device number can also be set at driver installation: insmod quantis-usb.o quantisMinorBase=206 2. Testing your Quantis RNGPlease refer to Quantis-PCI, B.2. ********************************************************************* Information in this document is subject to change without notice. Copyright (c) 2004 - 2010, ID Quantique SA. All rights reserved. ID Quantique and Quantis are trademarks of ID Quantique SA. |
ProductsTrue Random Number Generators (TRNG)Resource Center
|


