linux notes chapter 1. linux noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the...

15
Linux Notes Chapter 1. Linux Notes This document contains notes on the installation of Malibu for Linux and any other developer information for the user. Installation The installation of Malibu for Linux is performed by loading a number of packages. Each Package contains information on how and where to install the files it contains, and may perform additional actions under the control of scripts contained in the package. Package File Names A package file name such as Malibu-LinuxPeriphLib-1.6-6.i386.rpm encodes a lot of information. Package Name Package ID Information Fields Distribution Subpackage Version Revision Hardware Type Extension Malibu-Linux PeriphLib 1.7 6 i586 .rpm The distribution and sub-package names allows more than one package to be used for a single product. Each package has a unique ID. The revision is the update number of the package. Packages with different versions are installable side-by-side. In order to display a generic name a package name might be written as Malibu-LinuxPeriphLib-[ver]-[rev].i586.rpm. MalibuRed A board installation is divided into Four groups of packages. The first group is called “MalibuRed” because it contains the packages needed to allow running Malibu and Board programs on a target, non-development machine. (Red is short for 'redistributable'). MalibuRed Packages Description WinDriver-[ver]-[rev].i586.rpm Installs WinDriver Release. Malibu-LinuxRed-[ver]-[rev].i586.rpm Installs Baseboard Driver Kernel Plugin. intel-ipp-sp1-293-7.0-6.[platform].rpm Installs Intel IPP library redistributable files. 1

Upload: others

Post on 09-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Linux Notes Chapter 1. Linux Noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the kernel-source install. But if missing, create one by created a link from your current

Linux Notes

Chapter 1. Linux Notes

This document contains notes on the installation of Malibu for Linux and any other developer information for the user.

Installation

The installation of Malibu for Linux is performed by loading a number of packages. Each Package contains information on how and where to install the files it contains, and may perform additional actions under the control of scripts contained in the package.

Package File NamesA package file name such as Malibu-LinuxPeriphLib-1.6-6.i386.rpm encodes a lot of information.

Package Name Package ID Information Fields

Distribution Subpackage Version Revision Hardware Type Extension

Malibu-Linux PeriphLib 1.7 6 i586 .rpm

The distribution and sub-package names allows more than one package to be used for a single product. Each package has a unique ID. The revision is the update number of the package. Packages with different versions are installable side-by-side. In order to display a generic name a package name might be written as Malibu-LinuxPeriphLib-[ver]-[rev].i586.rpm.

MalibuRed

A board installation is divided into Four groups of packages. The first group is called “MalibuRed” because it contains the packages needed to allow running Malibu and Board programs on a target, non-development machine. (Red is short for 'redistributable').

MalibuRed Packages Description

WinDriver-[ver]-[rev].i586.rpm Installs WinDriver Release.

Malibu-LinuxRed-[ver]-[rev].i586.rpm Installs Baseboard Driver Kernel Plugin.

intel-ipp-sp1-293-7.0-6.[platform].rpm Installs Intel IPP library redistributable files.

1

Page 2: Linux Notes Chapter 1. Linux Noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the kernel-source install. But if missing, create one by created a link from your current

Linux Notes

Malibu

Malibu Packages Description

Malibu-LinuxPeriphLib-[ver]-[rev].i586.rpm Installs Malibu Source, Libraries and Examples.

Board Packages

Baseboard Packages Description

Sbc-ComEx Sbc-ComEx-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X3-10M X3-10M-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X3-25M X3-25M-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X3-2M X3-2M-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X3-A4D4 X3-A4D4-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X3-DIO X3-DIO-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X3-SD X3-SD-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X3-SDF X3-SDF-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X3-Servo X3-Servo-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X3-Timing X3-Timing-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X5-210M X5-210M-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X5-400M X5-400M-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X5-COM X5-COM-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X5-G12 X5-G12-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X5-GSPS X5-GSPS-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X5-RX X5-RX-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X5-TX X5-TX-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

X6-RX X6-RX-LinuxPeriphLib-[ver]-[rev].i586.rpm Board files and examples.

2

Page 3: Linux Notes Chapter 1. Linux Noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the kernel-source install. But if missing, create one by created a link from your current

Linux Notes

MalibuRed Installation Procedure

The MalibuRed install for Linux consists of several RPMs containing self-extracting packages of compressed files, as listed in the above table. Note that package number codes may vary.

Each of these packages automatically extract files into the /usr/Innovative folder, herein referred to as the Innovative root folder in the text that follows. For example, the WinDriver RPM extracts into /usr/Innovative/WinDriver-[ver]. A symbolic link named WinDriver is then created pointing to the version directory to allow a single name to apply to any version that is in use.

Unpacking the Packages

Installing the WinDriver PackageInstall the WinDriver package first. You need to be logged in as root for these steps to work.

rpm -i -h WinDriver-11.5-0.i586.rpm (32 bit systems)rpm -i -h 64WinDriver-11.5-0.x86_64.rpm (64 bit systems)

This extracts the WinDriver files into the Innovative root directory.

Installing the Red PackageAs root, type:

rpm -i -h Malibu-LinuxRed-1.3-0.i586.rpm (32 bit systems)rpm -i -h 64Malibu-LinuxRed-1.3-0.x86_64.rpm (64 bit systems)

This extracts the Malibu Red files into the Innovative root directory.

Installing the Malibu LibrariesAs root, type:

rpm -i Malibu-LinuxPeriphLib-1.7-6.i586.rpm (32 bit systems) rpm -i 64Malibu-LinuxPeriphLib-1.7-6.x86_64.rpm (64 bit systems)

Installing the Intel Performance Primitives As root, type:

rpm -i intel-ipp-sp1-293-7.0-6.i486.rpm (32 bit systems)rpm -i intel-ipp-sp1-293-7.0-6.x86_64.rpm (64 bit systems)

The Intel IPP may require lsb >= 3.0 and glibc-i18ndata which can be found here http://www.innovative-dsp.com/ftp/Ollie's Corner/Linux/Intel Dependencies/

3

Page 4: Linux Notes Chapter 1. Linux Noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the kernel-source install. But if missing, create one by created a link from your current

Linux Notes

Building the WinDriver driver for the first time

• Check for the presence of the Linux source by looking for the symbolic link linux in the /usr/src/ directory. If the source is not installed, either install it from the appropriate package or re-install Linux with source code. Under Suse, you can achieve this by invoking YaST and installing the kernel-source package.

Note: Make sure the version of the Kernel Source you install is the same version as the kernel you are

actually running. The Kernel Version in use can be seen at boot, or in the KDE System Information

window.

• Make sure there is a linux symbolic link in the /usr/src directory. Usually, this link is automatically created as part of the kernel-source install. But if missing, create one by created a link from your current kernel using ln -s. So on a Linux 2.4 kernel, it would be:

ln -s linux-2.4 linux

• If there is a linux link, but it points to a different source version, remove the old link and create a new one pointing to the correct source.

• The file version.h is required to build the drivers. The source code package may have a pre-created version of this file located in the directory /usr/src/linux/include/linux. If this file does not exist, create it by these steps:

cd /usr/src/linuxother linux distributions that do not have /usr/src/linux should use the directory /lib/modules/<your kernel version>/buildmake oldconfig

• Save the configuration by choosing the Save and Exit option. Then type:

make dep

• If the file /usr/src/linux/include/linux/version.h still does not exist, prepare the kernel using the command

make modules_prepare

• We require at least version 5.0 of the C++ library - libstdc++.so.5. If not already installed, it can be installed from the compat-libstdc++ RPM in your Linux distribution.

Automated Installation

The rest of the installation can be automated by running the Setup script in the Malibu folder. To finish the installation run /usr/Innovative/Malibu-[VERSION]/Setup, where you replace [VERSION] with your version of Malibu. If it is preferred to run the installation manually, follow the rest of the steps below. If the setup script was run successfully then skip to “Preparing to Auto-Load the Drivers”.

4

Page 5: Linux Notes Chapter 1. Linux Noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the kernel-source install. But if missing, create one by created a link from your current

Linux Notes

Symbolic LinksThe following install steps assume that the user has created symbolic links for the installed packages. A script file is providedto simplify this operation. In the MalibuRed/KerPlug directory, there is a script called quicklink.

./quicklink WinDriver 11.5

./quicklink Malibu 1.7

./quicklink MalibuRed 1.3

./quicklink Ipp 7.0

./quicklink wdapi 1150

*The versions besides the target link name must match the version of software one just installed.

These commands will create a symbolic link WinDriver pointing to WinDriver-11.5, and a link KerPlug pointing to MalibuRed-1.3/KerPlug.

The version number of wdapi is based on the version of WinDriver you have installed. So if you have WinDriver 11.50 installed it would be “wdapi 1150”. This quicklink copies the WinDriver shared object file to your lib directory.

This script can be moved to the user's bin directory to allow it to be run from any directory.

Completing the WinDriver Install

Innovative's board-level products utilize a standard driver, named WinDriver, licensed from from Jungo Inc. in conjunction with an Innovative Integration-authored, custom Kernel Plugin Driver which acts as a driver extension to allow programs to access the resources of the baseboard hardware.

Linux kernel modules must be complied with the same header files with which the kernel itself was built. Therefore both theJungo-authored WinDriver driver and the Innovative-authored kernel plug-in must be rebuilt on your machine prior to use.

• Go to the /usr/Innovative/WinDriver/redist folder. To build the WinDriver from within this folder, perform the following steps (you may need superuser access for these steps):

./configuremake

If the configure script fails to execute properly, open it with KWrite, then click use Tools | End of Line | Unix to insure that the file uses Unix end-of-line convention, save the file and retry.

• Once the driver builds you can install it from the redist directory with the following steps. The driver node needs to be made usable by all users with a final chmod command.

make installchmod 666 /dev/windrvr6

Installing the Malibu-LinuxRed Package

This package installs the custom Kernel Plugin Driver which acts as a driver extension to allow programs to access the resources of the baseboard hardware, and some utility software as well.

5

Page 6: Linux Notes Chapter 1. Linux Noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the kernel-source install. But if missing, create one by created a link from your current

Linux Notes

Linux kernel modules must be complied with the same header files with which the kernel itself was built. Therefore both theJungo-authored WinDriver driver and the Innovative-authored kernel plug-in must be rebuilt on your machine prior to use.

Building the Malibu Kernel Plugin for the first time

The Kernel Plugin source is located under the Innovative source tree in the /usr/Innovative/KerPlug/linux directory.

• From that directory perform the following steps to create the makefile to build the Kernel Plugin.

ln -s /usr usr

export WD_BASEDIR=<location of WinDriver tree>

./configure

• Run the resulting makefile to build the Kernel Plugin via the command (as super-user):

make install

If this script fails to execute properly, open it with KWrite, then click use Tools | End of Line | Unix to insure that the file uses Unix end-of-line convention, save the file and retry.

Preparing to Auto-Load the Drivers

The system will not load the WinDriver driver and Kernel Plugin driver automatically. The make install commands for each of them needs to be repeated on every system restart. However, you can configure your Linux system to load the drivers itself by following the instructions below.

• At this point the driver should be configured and loaded into the kernel. Run the following commands to start the driver:

/usr/Innovative/WinDriver/util/wdreg windrvr6chmod 666 /dev/windrvr6insmod /usr/Innovative/KerPlug/linux/LINUX*/kp_malibu_module

• The driver needs to be restarted on every boot. In order for these commands to be run automatically on every boot, you must append them to the rc.local file. This is generally located in /etc/rc.local but this may differ on some systems.

6

Page 7: Linux Notes Chapter 1. Linux Noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the kernel-source install. But if missing, create one by created a link from your current

Linux Notes

Baseboard Package Installation Procedure

Each baseboard installation for Linux consists of one or more package files containing self-extracting packages of compressed files, as listed in the above table. Note that package number codes may vary from those listed in the table.

Each of these packages automatically extract files into the /usr/Innovative folder, herein referred to as the Innovative root folder in the text that follows. For example, the X5-400 RPM extracts into /usr/Innovative/X5-400-[ver]. A symbolic link named X5-400 is then created pointing to the version directory to allow a single name to apply to any version that is in use.

Unpacking the Package

As root, type:

rpm -i -h X5-400-LinuxPeriphLib-1.1-4.i586.rpm

This extracts the X5-400 board files into the Innovative root directory. Use the package for the particular board you are installing.

Symbolic LinksThe following install steps assume that the user has created symbolic links for the installed packages. A script file is providedto simplify this operation in the Malibu Red package. In the MalibuRed/KerPlug directory, there is a script called quicklink.

./quicklink X5-400 1.1

These commands will create a symbolic link X5-400 pointing to X5-400-1.1.

This script can be moved to the user's bin directory to allow it to be run from any directory.

Completing the Board Install

The board driver install is already complete with the loading of the Malibu Red package. Any other steps needed to complete the installation will be listed in a board specific file in the documentation for the board.

Please Note: any system using a version of Qt which differs from that used on our build machine, which is currently v4.8. Will have to recompile the Framework_Qt Malibu library on the target machine for proper use and recompilation.

7

Page 8: Linux Notes Chapter 1. Linux Noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the kernel-source install. But if missing, create one by created a link from your current

Mem Driver Installation Linux

Mem Driver Installation Linux

PLEASE NOTE: MemDriver installation is not required for use and does not work in all Linux distributions especially with newer kernels.

This document provide instructions to install and use the Innovative Integration memory driver (MemDriver) and controller applet for Linux.

ReleasesSee the "README.txt" file.

Tested System Configuration4 GB Core2openSUSE 11.1 (x32 and x64)Linux Kernel 2.6.27.45

Malibu ApplicationsIn order to utilize MemDriver, all Malibu based applications must be linked against the latest release of Malibu libraries.

Installing MemDriverThe MemDriver for Linux is a boot start driver. In such, this driver must be linked into the Linux kernel and executed duringsystem boot-up. Perform the following steps to build and link the driver into the kernel.

1. Obtain the source for the Linux kernel listed in section "Minimum System Requirement".2. Copy the folder /usr/Innovative/MemDriver/memdrv to <your kernel source>/drivers.3. Edit the file <your kernel source>/drivers/Kconfig. Add the line: source "drivers/memdrv/Kconfig" (quotes

included) before the line "endmenu". Save the changes.4. Edit the file <your kernel source>/drivers/Makeflie. Add the line "obj-y += memdrv/" to the end of this file. Save.5. Go to the kernel root folder. Perform the steps listed under the section "Adjusting Memory Pool Size". Be sure a

check mark appears beside the MemDriver module, i.e. it is set to "Y". See image below.6. Continue to "Adjusting Memory Pool Size" section.

Adjusting Memory Pool SizeIn order to adjust the memory pool size, a rebuild of the Linux kernel is required.

1. In a terminal sheel, login as root.2. Go to the root folder of the new kernel source and type: $make gconfig3. This window will appear:

8

Page 9: Linux Notes Chapter 1. Linux Noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the kernel-source install. But if missing, create one by created a link from your current

Mem Driver Installation Linux

4. Goto section "Device Drivers->Innovative Memory Driver support->Memory Pool Size".5. Change the value, click save and exit. This value must be 1-4095 for x64 and 1-1000 for x32. Addition information

in section "Applet Features and Notes - #1" below.6. Rebuild the kernel and reboot.7. After boot-up, login as root and change the permission: $chmod 666 /dev/memdrv. Aadd this command to the

file /etc/rc.d/boot.local. Using Controller AppletThis applet displays MemDriver statuses and provide control functions to interact with the driver.

Running the Applet1. Open folder "/usr/Innovative/MemDriver/controller/mdControl".2. Run executable "mdControl".3. If this file is missing or does not execute properly, you may recompile it using Qt project "mdControl.pro".4. Normally, the following window will appear:

9

Page 10: Linux Notes Chapter 1. Linux Noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the kernel-source install. But if missing, create one by created a link from your current

Mem Driver Installation Linux

Applet Features and Notes1. If the memory driver failed to reserve desired amount of memory, it will attempt to reserve the largest amount

poosible. However, if it failed to reserve any memory at all, the "Status" field will show "Not Ready". In this case, set the "Memory To Reserve" value to a smaller value (say 50% of previous) and reboot. Valid values are between 1 and 4095 (MB). For 32-bit machines, it is highly recommended to stay below 1000.

2. To reset memory driver and clear all allocated memory1. Close all applications.2. Click "Reset" button

3. To verify driver is operational1. Close all applications.2. Click "Test" button3. The "Test:" field will show the test result, Pass or Failed. This field shows "Unknown" if the test has not yet

been executed.4. Click "Refresh", to update displayed values.

Definition of TermsMemory Pool – a section of physical RAM reserved by MemDriverMax – total size of the memory poolUsed – amount of memory pool allocated to applications

10

Page 11: Linux Notes Chapter 1. Linux Noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the kernel-source install. But if missing, create one by created a link from your current

Mem Driver Installation Linux

Free – total memory pool area not yet allocated to applicationsLFB – Largest Free Block of contiguous memory in the pool

Alternative Driver StatusAlternatively, the user may obtain the status of MemDriver with the following:

1. Open 'bash' terminal2. $cat /proc/driver/memdrv3. If the driver is functional, you should see an output with the driver name, version, and build date. For example:

II Memory Driver: v0.0.24, Nov 9 2011, 12:35:43

11

Page 12: Linux Notes Chapter 1. Linux Noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the kernel-source install. But if missing, create one by created a link from your current

Appendix – Adapting “configure”

Chapter 2. Appendix – Adapting “configure”

The configure script program is used by Linux to create a valid makefile for a project based on the location of various systemlibraries and tools. Each release of WinDriver may have differences in its configure file that need to be reflected in the makefile. This procedure describes how to generate a new configure script, and how to adapt it to work in our installation.

Before release, the configure included for the Kernel Plugin will have already been adapted for the approved version of WinDriver.

Generating “configure”

The WinDriver driver wizard program can generate the proper configure script for the system. The easiest way to do this is to open the wizard, select an Innovative board to generate a driver project for, and run through the steps. Since most of this project will be discarded, many of the choices don't matter. The only item we are interested in is the configure file and makefile.in created for the Kernel Plugin. This will be adapted for the Linux Malibu Kernel plug in.

We will use the Windows wizard to create the Linux project.When the Wizard is opened a window is displayed allowing youto create a new host driver project, or open an existing project. Inthis case we want a new project, so select the button to the left.

The next window allows you to select the hardware device. Sincewe don't really care about the contents of this project, any devicewill probably suffice. Select Next to move to the next step.

12

Page 13: Linux Notes Chapter 1. Linux Noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the kernel-source install. But if missing, create one by created a link from your current

Appendix – Adapting “configure”

The next window displays options for your driver. Since we want a Kernel Plugin configure, select the Kernel Plugin option.

Select Linux Makefile as the project options.

From the Project menu, select the Generate Code menu item. This creates the project on the disk. A report is generated on what files are produced and where they are located on the disk.

13

Page 14: Linux Notes Chapter 1. Linux Noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the kernel-source install. But if missing, create one by created a link from your current

Appendix – Adapting “configure”

The only files we are interested in is the Kernel Plugin Configure script and its makefile template. These are located in the kermode/linux directory.

Editing the “configure” script

We now need to edit the configure script to generate makefiles for our Malibu kernel plug in, rather than the test driver. Since the configure file is large, you may need to use searches to find the location of the changes.

The first change is in ac_unique_file. This file is used to verify the location of the source directory. It needs a file that is findable in that directory. Change the file to KernelPlugin_Mb.c.

PACKAGE_BUGREPORT=

ac_unique_file="../kp_newtestproj.c"

PACKAGE_BUGREPORT=

ac_unique_file="../KernelPlugin_Mb.c"

14

Page 15: Linux Notes Chapter 1. Linux Noteslibvolume2.xyz/biotechnology/semester4/basicsof... · part of the kernel-source install. But if missing, create one by created a link from your current

Appendix – Adapting “configure”

The module name, which is the name of the Kernel Plugin output file, needs to be changed to kp_malibu_module.

echo "${ECHO_T}$OD" >&6

MODULE_NAME=kp_newtestproj_moduleecho "${ECHO_T}$OD" >&6

MODULE_NAME=kp_malibu_module

There are two more changes that must be made. The INST_BASEDIR string needs to be changed to point to the location of the WinDriver installation on the Linux box. This location is stored in the WD_BASEDIR string variable, so set the string to that variable.

Also the CSRCS variable needs to be modified. The source for the Malibu kernel plug-in is in the file KernelPlugin_Mb.c, soreplace that for the project source file. The _lib.c file is not used in the Malibu project, and should be removed entirely.

SRC_PREFIX="../"INST_BASEDIR="../../newtestproj_installation"LIB_CSRCS="${SRC_PREFIX}kp_newtest.c ${SRC_PREFIX}../newtest_lib.c”MOD_CSRCS="${INST_BASEDIR}/redist/linux_wrappers.c”OD_RULE="-@ mkdir \$@"SRC_PREFIX="../"INST_BASEDIR="\$(WD_BASEDIR)"LIB_CSRCS="${SRC_PREFIX}KernelPlugin_Mb.c”MOD_CSRCS="${INST_BASEDIR}/redist/linux_wrappers.c” OD_RULE="-@ mkdir \$@"

One final change is needed. Since these files were made on Windows, the end of line convention used follows Windows rulesand is not suitable for Linux. Many editors allow this conversion. On Linux you can open the files in Kwrite, and select Unix line ends in the options window to perform the conversion.

15