Difference between revisions of "The Linux kernel"

From IGEP - ISEE Wiki

Jump to: navigation, search
m
Line 10: Line 10:
 
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.
 
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.
  
= How to cross compile the linux kernel =
+
= Overview of How-To =
  
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.  
+
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.  
  
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.
+
= How to cross compile the linux kernel =
  
== Overview of How-To  ==
+
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 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.  
+
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.
  
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.  
+
The ARCH variable is the architecture you're targetting as the kernel knows it. For IGEP Processor Boards you'll set to "arm" architecture.
  
== Current stable kernels ==
+
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-gnueabi-gcc, just chop off that trailing gcc and that's what you use: arm-linux-gnu-.
  
=== Linux OMAP v2.6.37 series ===
+
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.
  
See the [[Linux Kernel 2.6.37.y]] article
+
As example, once you've downloaded the kernel source, you should follow these steps:
  
=== Linux OMAP v2.6.35 series ===
+
make ARCH=arm CROSS_COMPILE=[cross compiler] [defconfig]
 +
make ARCH=arm CROSS_COMPILE=[cross compiler] zImage modules
  
See the [[Linux Kernel 2.6.35.y]] article
+
The result will be an zImage file in arch/arm/boot directory. You can install the kernel modules to your target rootfs
  
=== Linux mainline tree (development) ===
+
  make ARCH=arm CROSS_COMPILE=[cross compiler] modules_install INSTALL_MOD_PATH=[path to your target rootfs]
  
<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>
+
== Stable kernels ==
  
Additional patches can be found at http://patchwork.kernel.org/project/linux-omap/list
+
=== Linux OMAP v2.6.37 series ===
  
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.  
+
See the [[Linux Kernel 2.6.37.y]] article
  
Clone GIT repository from git.isee.biz
+
== Unstable kernels ==
  
git clone git://git.isee.biz/pub/scm/linux-omap-2.6.git
+
See the [[Linux Kernel Mainline]] article
  
Enter in sources directory
+
== Legacy kernels ==
  
cd linux-omap-2.6
+
=== Linux OMAP v2.6.35 series ===
  
Get your desired branch with
+
See the [[Linux Kernel 2.6.35.y]] article
git checkout <release> -b <your_named_release>
 
git checkout v2.6.37-2 -b v2.6.37-2-local
 
  
 +
=== Linux mainline tree (development)  ===
  
and build with
+
= See also =
 
 
make ARCH=arm CROSS_COMPILE=[cross compiler] igep00x0_defconfig
 
make ARCH=arm CROSS_COMPILE=[cross compiler] zImage 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=[cross compiler] modules_install INSTALL_MOD_PATH=[path to your target rootfs]
 
 
 
=See also=
 
 
*[[How to setup a cross compiler]]
 
*[[How to setup a cross compiler]]
  
 
[[Category:Linux Kernel]]
 
[[Category:Linux Kernel]]

Revision as of 13:54, 28 June 2013

<meta name="description" content="All you need to know about the Linux kernel for IGEP Processor Boards. How to cross compile, get stable versions and get the latest development versions, etc."></meta> <meta name="keywords" content="Linux, IGEP, ARM, OMAP3, AM335x"></meta>

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-gnueabi-gcc, just chop off that trailing gcc and that's what you use: arm-linux-gnu-.

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

The result will be an zImage file in arch/arm/boot directory. You can install the kernel modules to your target rootfs

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

Stable kernels

Linux OMAP v2.6.37 series

See the Linux Kernel 2.6.37.y article

Unstable kernels

See the Linux Kernel Mainline article

Legacy kernels

Linux OMAP v2.6.35 series

See the Linux Kernel 2.6.35.y article

Linux mainline tree (development)

See also