Difference between revisions of "The Linux kernel"

From IGEP - ISEE Wiki

Jump to: navigation, search
(issue with bluetooth)
(Linux kernels)
 
(53 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== How to cross compile the linux kernel  ==
+
=What is Linux?=
 +
[[Image:tux.png|left]][http://www.kernel.org The Linux Kernel Archives]Linux is a clone of the operating system Unix, written from scratch by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net. It aims towards POSIX and Single UNIX Specification compliance.
  
Embedded Linux is the use of a Linux operating system in embedded computer systems such as mobile phones, personal digital assistants, media players, set-top boxes, and other consumer electronics devices, networking equipment, machine control, industrial automation, navigation equipment and medical instruments.  
+
It has all the features you would expect in a modern fully-fledged Unix, including true multitasking, virtual memory, shared libraries, demand loading, shared copy-on-write executables, proper memory management, and multistack networking including IPv4 and IPv6.
  
Unlike desktop and server versions of Linux, embedded versions of Linux are designed for devices with relatively limited resources, such as cell phones and set-top boxes. Due to concerns such as cost and size, embedded devices usually have much less RAM and secondary storage than desktop computers, and are likely to use flash memory instead of a hard drive. Since embedded devices serve specific rather than general purposes, developers optimize their embedded Linux distributions to target specific hardware configurations and usage situations. These optimizations can include reducing the number of device drivers and software applications, and modifying the Linux kernel to be a real-time operating system.  
+
Although originally developed first for 32-bit x86-based PCs (386 or higher), today Linux also runs on a multitude of other processor architectures, in both 32- and 64-bit variants.
  
=== Overview of How-To ===
+
=Overview of How-To=
 +
This How-To is meant to be a starting point for people to learn build a kernel image for IGEP Processor Boards as quickly and easily as possible.
  
This How-To is meant to be a starting point for people to learn build a kernel image for IGEP v2 devices as quickly and easily as possible.  
+
=How to cross compile the linux kernel=
 +
In order to build the Linux Kernel for IGEP PROCESSOR BOARDS it's recommended to cross-compile the kernel, that's, build the kernel in your HOST machine for a target architecture.
  
This How-To works with the Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine but most of the contents are valid also for other GNU/Linux distributions. We do not issue any guarantee that this will work on other distributions.  
+
To [[Ubuntu 16.04 LTS Toolchain|setup the cross-compiling]] there are two fundamental variables that the kernel uses to select the target architecture. Normally these values are guessed based on your build environment, but of course that environment here does not match our target embedded system, so we'll need to override them. The variables in question are ARCH and CROSS_COMPILE.
  
=== Requirements  ===
+
The ARCH variable is the architecture you're targetting as the kernel knows it. For IGEP PROCESSOR BOARDS you'll set to "arm" architecture.
  
*[[Ubuntu_8.04_IGEP_v2.0_SDK_Virtual_Machine|'''Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine''']]
+
Hopefully the CROSS_COMPILE variable is pretty self-explanatory. Set this to the prefix of your toolchain (including the trailing dash "-"). So if your toolchain is invoked as say arm-linux-gnueabihf-gcc, just chop off that trailing gcc and that's what you use: arm-linux-gnueabihf-.
  
=== IGEP platforms ===
+
There is an additional variable, INSTALL_MOD_PATH, which defines where the /lib directory will be created, and all the modules stored. While you don't have to transfer the kernel sources to your target device, if you build any modules, you'll want this directory.
  
* IGEP0020 is also know as IGEP v2 platform.
+
As example, once you've downloaded the kernel source, you should follow these steps:
* IGEP0030 is also know as OMAP3 IGEP module.
 
  
=== Supported kernels ===
+
make ARCH=arm CROSS_COMPILE=[cross compiler] [defconfig]
 +
  make ARCH=arm CROSS_COMPILE=[cross compiler] zImage modules
 +
Newest kernels can require build the dtbs too as:
  
First of all setup the build environment sourcing this script
+
make ARCH=arm CROSS_COMPILE=[cross compiler] zImage modules dtbs
  
source /usr/local/poky/eabi-glibc/arm/environment-setup
+
The result will be a zImage file in <code>${KERNEL_SOURCES}/arch/arm/boot</code>
  
or
+
And dabs will be in <code>${KERNEL_SOURCES}/arch/arm/boot/dts</code>
  
source /usr/local/poky/eabi-glibc/environment-setup-arm-none-linux-gnueabi
+
At last you can install the kernel modules to your target rootfs using this command
  
if you have updated your SDK environment to latest version (see [[Ubuntu 8.04 IGEP v2.0 SDK Virtual Machine]])
+
make ARCH=arm CROSS_COMPILE=[cross compiler] modules_install INSTALL_MOD_PATH=[path to your target rootfs]
 +
Example:
  
==== Linux OMAP v2.6.35 series (stable)  ====
+
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- omap2plus_defconfig<br>make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs<br>make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_install INSTALL_MOD_PATH=/media/user/rootfs
  
Latest stable kernel version is: '''2.6.35.10-0 (20110117)'''
+
==Linux kernels==
 +
===IGEP Boards based on Texas Instruments  Processors===
 +
* [[Linux Kernel 2.6.37.y]] (OMAP35xx and DM3730) processor board based.
 +
* [[Linux Kernel 4.9.y]] (OMAP35xx, DM3730, AM335x) processor board based.
 +
* [[Linux Kernel 3.8.y]] (OMAP5432) processor board based.
  
Supported platforms: IGEP0020 and IGEP0030 (OMAP35x/DM3730)
+
===IGEP Boards based on NXP-Freescale Processors===
 +
* [[Linux Kernel 3.14.28.y]] (iMX6) processor board based.
 +
* [[Linux Kernel 4.9.y]] (iMX6) processor board based.
  
{| border="1"
 
|-
 
! '''Platform'''
 
! '''Sources'''
 
! '''uImage binary'''
 
! '''Modules binaries'''
 
|-
 
| &nbsp;IGEP00x0&nbsp;
 
| [http://downloads.igep.es/sources/linux-omap-2.6.35.10-0.tar.gz 2.6.35.10-0] ([http://downloads.igep.es/sources/linux-omap-2.6.35.10-0.tar.gz.md5 md5sum])
 
| [http://downloads.igep.es/binaries/kernel/v2.6.35.10-0/uImage-2.6.35.10-0.bin uImage-2.6.35.10-0.bin] ([http://downloads.igep.es/binaries/kernel/v2.6.35.10-0/uImage-2.6.35.10-0.bin.md5 md5sum])
 
| [http://downloads.igep.es/binaries/kernel/v2.6.35.10-0/modules-2.6.35.10-0.tar.gz modules-2.6.35.10-0] ([http://downloads.igep.es/binaries/kernel/v2.6.35.10-0/modules-2.6.35.10-0.tar.gz.md5 md5sum)]
 
|}
 
  
Download the IGEP Linux kernel sources and follow next steps:
+
[[Category:Linux Kernel]]
 
 
wget http://downloads.igep.es/sources/linux-omap-2.6.35.tar.gz
 
tar xzf linux-omap-2.6.35.tar.gz
 
cd [kernel version]
 
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- &lt;board-config&gt;
 
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- menuconfig
 
 
 
where the last line is only required if you want to manualy modify the kernel options and
 
 
 
*&lt;board-config&gt; is igep0020_defconfig for IGEP v2 platform.
 
*&lt;board-config&gt; is igep0030_defconfig for OMAP3 IGEP module.
 
 
 
Then build the kernel with:
 
 
 
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage modules
 
 
 
The result will be an uImage file in arch/arm/boot directory. You can install the kernel modules to your target rootfs
 
 
 
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- modules_install INSTALL_MOD_PATH=[path to your target rootfs]
 
 
 
''' ISSUES'''
 
* '''Bluetooth''': Broken due to an incompatibility with expansion board, to solve this apply this patch
 
<pre>
 
diff --git a/arch/arm/mach-omap2/board-igep0020-22.c b/arch/arm/mach-omap2/board-igep0020-22.c
 
index 06f9809..1d6a4cf 100644
 
--- a/arch/arm/mach-omap2/board-igep0020-22.c
 
+++ b/arch/arm/mach-omap2/board-igep0020-22.c
 
@@ -301,7 +301,7 @@ void __init igep0022_init(void)
 
        igep0022_tsc2046_init();
 
 
        /* GPIO's for GE865 modem interface */
 
-      igep0022_modem_init();
 
+      /* igep0022_modem_init(); */
 
 
        /* CAN driver for Microchip 251x CAN Controller with SPI Interface */
 
        igep0022_mcp251x_init();
 
</pre>
 
 
 
'''CHANGELOG'''
 
*[http://git.igep.es/?p=pub/scm/linux-omap-2.6.git;a=commit;h=5f578909fcb5f2383aa91f07d45bd64fd0a82cbd 2011-01-17 Release 2.6.35.10-0]
 
** Rebased with longterm/linux-2.6.35.y
 
** Add MADC driver
 
** Add TIDSPBRIDGE driver
 
** Fix MCSPI, disable channel after TX_ONLY transfer in PIO mode
 
*[http://git.igep.es/?p=pub/scm/linux-omap-2.6.git;a=commit;h=c8a6de6ec4dabb4d7a8b6c2299da4b924700f200 2010-11-23 Release 2.6.35.9-0]
 
** Rebased with stable/2.6.35.9
 
** Add IGEP0022 expansion support by default
 
** Add EHCI support on OMAP3 IGEP module.
 
** Fix modem GPIO for IGEP v2 expansion board
 
*[http://git.igep.es/?p=pub/scm/linux-omap-2.6.git;a=commit;h=a0af50a21ce7b97218704e45a3e9b1d987aa95cd 2010-11-05 Release 2.6.35.8-0]
 
** Rebased with stable/2.6.35.8
 
** Fix libertas driver with SDIO IRQ
 
*[http://git.igep.es/?p=pub/scm/linux-omap-2.6.git;a=commit;h=f22e641507e4e0c3fc015405bac7448f2c1d3034 2010-10-28 Release 2.6.35.7-1]
 
** Add support for SDIO IRQ
 
** Fix onenand bufferram management
 
** Improve IGEP0020 expansion board support
 
*** Add support for 4.3 inch and 7.0 inch display panels
 
*** Fix CAN probe oops
 
*[http://git.igep.es/?p=pub/scm/linux-omap-2.6.git;a=commit;h=90ca5f215048ee612398610fab3981589da05633 2010-10-19 Release 2.6.35.7-0]
 
**First release for 2.6.35 series
 
 
 
==== Linux OMAP v2.6.33 series (stable)  ====
 
 
 
Latest stable kernel version is: '''2.6.33.7-0 (20100825)'''
 
 
 
Supported platforms: IGEP0020 and IGEP0030 (OMAP35x)
 
 
 
{| border="1"
 
|-
 
! '''Platform'''
 
! '''Sources'''
 
! '''uImage binary'''
 
! '''Modules binaries'''
 
|-
 
| &nbsp;IGEP00x0&nbsp;
 
| [http://downloads.igep.es/sources/linux-omap-2.6.33.7-0.tar.gz 2.6.33.7-0] ([http://downloads.igep.es/sources/linux-omap-2.6.33.7-0.tar.gz.md5 md5sum])
 
| [http://downloads.igep.es/binaries/kernel/v2.6.33.7-0/uImage-2.6.33.7-0.bin uImage-2.6.33.7-0.bin] ([http://downloads.igep.es/binaries/kernel/v2.6.33.7-0/uImage-2.6.33.7-0.bin.md5 md5sum])
 
| [http://downloads.igep.es/binaries/kernel/v2.6.33.7-0/linux-omap-modules-2.6.33.7-0.tar.gz modules-2.6.33.7-0] ([http://downloads.igep.es/binaries/kernel/v2.6.33.7-0/linux-omap-modules-2.6.33.7-0.tar.gz.md5 md5sum)]
 
|}
 
 
 
Download the IGEP Linux kernel sources and follow next steps:
 
 
 
wget http://downloads.igep.es/sources/linux-omap-2.6.33.tar.gz
 
tar xzf linux-omap-2.6.33.tar.gz
 
cd [kernel version]
 
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- &lt;board-config&gt;
 
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- menuconfig
 
 
 
where the last line is only required if you want to manualy modify the kernel options and
 
 
 
*&lt;board-config&gt; is igep0020_defconfig for IGEP v2 platform.
 
*&lt;board-config&gt; is igep0030_defconfig for OMAP3 IGEP module.
 
 
 
Then build the kernel with:
 
 
 
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage modules
 
 
 
The result will be an uImage file in arch/arm/boot directory. You can install the kernel modules to your target rootfs
 
 
 
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- modules_install INSTALL_MOD_PATH=[path to your target rootfs]
 
 
 
'''CHANGELOG'''
 
 
 
*[http://git.igep.es/?p=pub/scm/linux-omap-2.6.git;a=commit;h=41815090632f051ae8f2281eef5827a7cd985837 2010-08-25 Release 2.6.33.7-0]
 
**add SGX drivers pulled from TI SDK 3.01.00.06
 
*[http://git.igep.es/?p=pub/scm/linux-omap-2.6.git;a=commit;h=ed7f5d0c802527869c6f87ded0d0fc620c73ecb2 2010-07-29 Release 2.6.33.6-0]
 
**add support auto RS485 direction control
 
**fix bufferram management for OneNAND
 
**usb: make disconnect and suspend interrupts work again
 
*[http://git.igep.es/?p=pub/scm/linux-omap-2.6.git;a=commit;h=7c1be0293958b1aa661b224cecf96bbf8a34bc61 2010-06-11 Release 2.6.33.5-0]
 
**add support for OMAP3 IGEP module (igep0030)
 
 
 
==== Linux OMAP v2.6.28 series (stable)  ====
 
 
 
Latest stable kernel version is: '''2.6.28.10-3 (20100318)'''
 
 
 
Supported platforms: IGEP0020 (OMAP35x)
 
 
 
{| border="1" class="simple"
 
|-
 
| '''Platform'''
 
! '''Sources'''
 
! '''uImage binary'''
 
! '''Modules binaries'''
 
|-
 
| &nbsp;IGEP0020&nbsp;
 
| [http://downloads.igep.es/sources/linux-omap-2.6.28.10-3.tar.gz 2.6.28.10-3] ([http://downloads.igep.es/sources/linux-omap-2.6.28.10-3.tar.gz.md5 md5sum])
 
| [http://downloads.igep.es/binaries/kernel/v2.6.28.10-3/uImage-2.6.28.10-3.bin uImage-2.6.28.10-3.bin] ([http://downloads.igep.es/binaries/kernel/v2.6.28.10-3/uImage-2.6.28.10-3.bin.md5 md5sum])
 
| [http://downloads.igep.es/binaries/kernel/v2.6.28.10-3/linux-omap-modules-2.6.28.10-3.tar.gz modules-2.6.28.10-3] ([http://downloads.igep.es/binaries/kernel/v2.6.28.10-3/linux-omap-modules-2.6.28.10-3.tar.gz.md5 md5sum)]
 
|}
 
 
 
Download the IGEP v2 Linux kernel sources and follow next steps:
 
 
 
wget http://downloads.igep.es/sources/linux-omap-2.6.28.tar.gz
 
tar xzf linux-omap-2.6.28.tar.gz
 
cd [kernel version]
 
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- igep0020_defconfig
 
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage modules
 
 
 
The result will be an uImage file in arch/arm/boot directory. You can install the kernel modules to your target rootfs
 
 
 
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- modules_install INSTALL_MOD_PATH=[path to your target rootfs]
 
 
 
==== Linux mainline tree (development)  ====
 
 
 
<span style="color: rgb(255, 0, 0);">'''Note:''' The 'master' branch is where the development work takes place and you should use this if you're after to work with the latest cutting edge developments. It is possible trunk can suffer temporary periods of instability while new features are developed and if this is undesirable we recommend using one of the release branches. '''Use ONLY for development purposes.'''</span>
 
 
 
Additional patches can be found at http://patchwork.kernel.org/project/linux-omap/list
 
 
 
This Linux kernel is also considered as a downstream of tmlind's Linux kernel. The main difference between this tree and the linux-omap tree is that the igep OMAP tree has unpublished patches for IGEP v2 support.
 
 
 
Clone GIT repository from git.igep.es
 
 
 
git clone git://git.igep.es/pub/scm/linux-omap-2.6.git
 
cd linux-omap-2.6
 
 
 
and build with
 
 
 
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- omap2plus_defconfig
 
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage modules
 
 
 
The result will be an uImage file in arch/arm/boot directory. You can install the kernel modules to your target rootfs
 
 
 
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- modules_install INSTALL_MOD_PATH=[path to your target rootfs]
 
 
 
[[Category:Software|Kernel]]
 

Latest revision as of 13:46, 12 March 2018

What is Linux?

tux.png
The Linux Kernel ArchivesLinux is a clone of the operating system Unix, written from scratch by Linus Torvalds with assistance from a loosely-knit team of hackers across the Net. It aims towards POSIX and Single UNIX Specification compliance.

It has all the features you would expect in a modern fully-fledged Unix, including true multitasking, virtual memory, shared libraries, demand loading, shared copy-on-write executables, proper memory management, and multistack networking including IPv4 and IPv6.

Although originally developed first for 32-bit x86-based PCs (386 or higher), today Linux also runs on a multitude of other processor architectures, in both 32- and 64-bit variants.

Overview of How-To

This How-To is meant to be a starting point for people to learn build a kernel image for IGEP Processor Boards as quickly and easily as possible.

How to cross compile the linux kernel

In order to build the Linux Kernel for IGEP PROCESSOR BOARDS it's recommended to cross-compile the kernel, that's, build the kernel in your HOST machine for a target architecture.

To setup the cross-compiling there are two fundamental variables that the kernel uses to select the target architecture. Normally these values are guessed based on your build environment, but of course that environment here does not match our target embedded system, so we'll need to override them. The variables in question are ARCH and CROSS_COMPILE.

The ARCH variable is the architecture you're targetting as the kernel knows it. For IGEP PROCESSOR BOARDS you'll set to "arm" architecture.

Hopefully the CROSS_COMPILE variable is pretty self-explanatory. Set this to the prefix of your toolchain (including the trailing dash "-"). So if your toolchain is invoked as say arm-linux-gnueabihf-gcc, just chop off that trailing gcc and that's what you use: arm-linux-gnueabihf-.

There is an additional variable, INSTALL_MOD_PATH, which defines where the /lib directory will be created, and all the modules stored. While you don't have to transfer the kernel sources to your target device, if you build any modules, you'll want this directory.

As example, once you've downloaded the kernel source, you should follow these steps:

make ARCH=arm CROSS_COMPILE=[cross compiler] [defconfig]
make ARCH=arm CROSS_COMPILE=[cross compiler] zImage modules

Newest kernels can require build the dtbs too as:

make ARCH=arm CROSS_COMPILE=[cross compiler] zImage modules dtbs

The result will be a zImage file in ${KERNEL_SOURCES}/arch/arm/boot

And dabs will be in ${KERNEL_SOURCES}/arch/arm/boot/dts

At last you can install the kernel modules to your target rootfs using this command

make ARCH=arm CROSS_COMPILE=[cross compiler] modules_install INSTALL_MOD_PATH=[path to your target rootfs]

Example:

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- omap2plus_defconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- modules_install INSTALL_MOD_PATH=/media/user/rootfs

Linux kernels

IGEP Boards based on Texas Instruments  Processors

IGEP Boards based on NXP-Freescale Processors