SlideShare a Scribd company logo
1 of 5
Download to read offline
Pratyusha.Gandham, Ramesh N.V.K / International Journal of Engineering Research and Applications (IJERA)
                  ISSN: 2248-9622                                        www.ijera.com
                               Vol. 2, Issue 2,Mar-Apr 2012, pp.1614-1618

  PORTING THE LINUX KERNEL TO AN ARM BASED DEVELOPMENT
                         BOARD
                                             Pratyusha.Gandham1 , Ramesh N.V.K2
                                          1Research Scholar, Dept. of E.C.M, K.L. University, A.P,India
                                             2 Associate Professor, Dept. of E.C.M, K.L. University



Abstract
ARM development boards are the ideal platform for accelerating the development and reducing the risk of new SoC designs.
The combination of ASIC and FPGA technology in ARM boards delivers an optimal solution in terms of speed, accuracy,
flexibility and cost.. The Embedded modules,based on ARM, can become very complex machines since these are meant to
support varied tasks such as memory management, process management and peripheral interfaces.For seamless integration of
these functional modules an OS has to be ported on these ARM based CPUs .Traditionally this OS porting is often the
specialized work of third party vendors having expertise in this domain. For every new CPU architecture, the OS has to be
customized, compiled and burnt into the core .With the coming of age of Linux as an embedded OS all this has changed quite
significantly. Being in Open Source domain, Linux kernel can be freely downloaded and compiled for any system architecture
and this includes ARM based systems also. This enables the developers to port the OS themselves. This paper describes the
details of porting of Linux kernel to an ARM board.Building linux kernel,u-boot and x-loader are described in detail. SD card
configuration is also described.

Index Terms: ARM, Operating System, Linux, Kernel.

-------------------------------------------------------------***--------------------------------------------------------------

1. INTRODUCTION
Linux has been available for the ARM architecture for many
years now. The original „port‟ was done by Russell King, and
he is still the maintainer through whom all ARM kernel
patches generally must pass. GNU/Linux is fast becoming the
operating system for embedded devices - mainly due to the
efficient and portable design of the Linux kernel. The ARM
Linux port effort, headed by Russell M. King, also makes life
a bit easier for people who run (or want to run) Linux on their
embedded devices.

The work was much harder than than it would be now, since at
the time the Linux kernel was still very Intel-centric. In fact,
modern Linux kernels come with a handy reference example
called asm-generic that shows all of the header files and
kernel interfaces that a new architecture port should provide.
Once the kernel has been ported to a given architecture, it is
necessary to implement support for a specific platform based
upon that architecture.
                                                                                     Figure1: Panda Board, an ARM based development board
Texas Instruments implements the ARM architecture in its                             from Texas Instruments.
OMAP processors. For example, Panda Board is a particular
variant of the OMAP4 platform. Panda Board is based on                               2. BUILDING LINUX KERNEL
ARM Cortex-A9 System-on-Chip (SoC) processor.                                        Latest stable version of linux kernel can be obtained from
                                                                                     kernel.org website. This is in the form of a source code and
                                                                                     we need to compile it. Figure 2 shows the basic architecture of
                                                                                     linux2.6.11.6. The Linux kernel supports a lot of different

                                                                                                                                 1614 | P a g e
Pratyusha.Gandham, Ramesh N.V.K / International Journal of Engineering Research and Applications (IJERA)
                  ISSN: 2248-9622                                        www.ijera.com
                               Vol. 2, Issue 2,Mar-Apr 2012, pp.1614-1618
CPU architectures. The methods to port the Linux kernel to a              remote server if you want to compile kernel
new board are therefore very architecture dependent. For                  remotely.
example, PowerPC and ARM are very different. PowerPC                     $ make xconfig - X windows (Qt) based
relies on device trees to describe hardware details whereas               configuration tool, works best under KDE desktop
ARM relies on source code only. In the source tree, each              ●   $ make gconfig - X windows (Gtk) based
architecture has its own directory arch/arm for the ARM                   configuration tool, works best under Gnome Dekstop.
architecture. For building the linux kernel, cross-compiler
should be made accessible on your execution path.




                                                                  Figure 3: Configuring         Linux    Kernel     using   make
                                                                  menuconfig.

                                                                  2.4 Compile kernel
Figure 2:Linux kernel architecture                                The Linux kernel supports a lot of different CPU
                                                                  architectures.The methods to port the Linux kernel to a new
2.1 Get Latest Linux kernel code                                  board are therefore very architecture dependent. In the source
                                                                  tree, each architecture has its own directory arch/arm for the
Visit http://kernel.org/ and download the latest source code.
                                                                  ARM architecture.For building the linux kernel, cross-
File name would be linux-x.y.z.tar.bz2, where x.y.z is actual
                                                                  compiler should be made accessible on your execution path.
version number. For example file inux-2.6.25.tar.bz2
                                                                  Entering make command would start compilation and create a
represents 2.6.25 kernel version. Use wget command to
                                                                  compressed kernel image. The resulting kernel image is
download kernel source code:
                                                                  placed in arch/arm/boot directory.
                                                                        $export ARCH=arm
        $wget
         http://www.kernel.org/pub/linux/kernel/v2.6/linux-
         x.y.z.tar.bz2                                                    $ export     CROSS_COMPILE=            arm-none-linux-
                                                                           gnueabi
2.2 Extract tar (.tar.bz3) file
The tar program provides the ability to create tar archives, as           $ make
well as various other kinds of manipulation.Typing the
following command will extract it to current directory:           3. X-LOADER AND U-BOOT
      # tar -xjvf linux-2.6.25.tar.bz2                           X-loader is a small first stage boot loader derived from the u-
                                                                  boot base code to be loaded into the internal static ram.
2.3 Configure kernel                                              Because the internal static ram is very small (64k-32k), x-
Before you configure kernel make sure you have development        loader is stripped down to the essentials and is used to
tools (gcc compilers and related tools) are installed on your     initialize memory and enough of the peripheral devices to
system. If gcc compiler and tools are not installed then use      access and load the second stage loader (U-Boot) into main
apt-get command under Debian Linux to install development         memory.U-Boot is designed to be the "Universal Bootloader"
tools.                                                            and certainly goes a long ways to support multiple processors,
      # apt-get install gcc                                      boards, and OS's. It's primary purpose is to setup the kernel
Now you can start kernel configuration by typing any one of       environment; and load and boot the kernel. The sources of u-
the command:                                                      boot and x-loader specific to the ARM board can be obtained
                                                                  and built using make utility on terminal. The procedure for
      $ make menuconfig - Text based color menus,
                                                                  building it is same as it is for linux kernel. The output of the
         radiolists & dialogs. This option also useful on
                                                                  build process is u-boot.bin and MLO.
                                                                                                               1615 | P a g e
Pratyusha.Gandham, Ramesh N.V.K / International Journal of Engineering Research and Applications (IJERA)
                  ISSN: 2248-9622                                        www.ijera.com
                               Vol. 2, Issue 2,Mar-Apr 2012, pp.1614-1618
                                                                   FAT32 boot partition and a larger ext3 partition for the
3.1 Building X-loader                                              filesystem or rootfs. Following are the steps to partition the
In order to compile the X-loader, you need to set the              SD card on a linux machine.
CROSS_COMPILE environment variable and specify the path
to tool chain.                                                     4.1 Formatting the SD Card
                                                                   To determine which device the SD Card Reader is on your
        #export                                                   system,plug the SD Card into the SD Card Reader and then
         PATH=/usr/local/xtools/arm--linux-uclibcgnueabi/bi        plug the SD Card Reader into your system. After doing that,
         n:$PATH                                                   do the following to determine which device it is on your
        #export  CROSS_COMPILE=            arm-none-linux-        system.
         gnueabi-                                                  $ [dmesg | tail]
                                                                   ...
To set the configuration for the target board and build the        [ 6854.215650] sd 7:0:0:0: [sdc] Mode Sense: 0b 00 00 08
image, give the command:                                           [ 6854.215653] sd 7:0:0:0: [sdc] Assuming drive cache: write
     # make BOARDNAME_config                                      through
     # make                                                       [ 6854.215659] sdc: sdc1
                                                                   [ 6854.218079] sd 7:0:0:0: [sdc] Attached SCSI removable
The resulting file is stored in the x-loader main directory as     disk
x--load.bin. This file must be “signed” in order to be executed    ...
by the processor. Using the signGP tool in the tools/              In this case, it shows up as /dev/sdc.
subdirectory of the main directory of the lab, sign the
x-load.bin file. This produces an x-load.bin.ift file. You can     Fdisk utilty is used to partition SD card on a linux machine.
copy it to the MMC card, renaming it as MLO.                       The following command starts the fdisk. We must clear the
                                                                   partition table before changing the underlying geome
3.2 Building U-boot                                                      Command (m for help): [d]
U-Boot is a typical free software project.It is freely available              Selected partition 1
at http://www.denx.de/wiki/U-Boot.Get the source code from
the website, and uncompress it.The include/configs/ directory      4.2 Set the Geometry of the SD Card
contains one configuration file for each supported board.It        If the print out above does not show 255 heads, 63
defines the CPU type, the peripherals and their configuration,     sectors/track, then do the following expert mode steps to redo
the memory mapping, the U-Boot features that should be             the SD Card:
compiled in, etc.Assuming that your board is already                     Go into expert mode.
supported by U-Boot, there should be one file corresponding        Command (m for help): [x]
to your board, for example include/configs/omap2420h4.h.U-
-Boot must be configured before being compiled.                        Set the number of heads to 255.
                                                                   Expert Command (m for help): [h]
        #make BOARDNAME_config                                    Number of heads (1-256, default xxx): [255]

Make sure that the cross-compiler is available in PATH                  Set the number of            sectors to 63.
    #export                                                       Expert Command (m for help): [s]
        PATH=/usr/local/uclibc-0.9.29-2/arm/bin/:$PATH             Number of sectors (1-63, default xxx): [63]
                                                                        Now Calculate the number of Cylinders for your SD
Compile U-Boot, by specifying the cross-compiler prefix.                     Card.
Example, if your cross-compiler executable is arm-linux-gcc:       #cylinders = FLOOR (the number of Bytes on the SD Card
      #make CROSS_COMPILE=arm-linux                               (from above) / 255 / 63 / 512 )So for this example:
This command would result in u-boot.bin file in working            2021654528 / 255 / 63 / 512 = 245.79. So we use 245 (i.e.
directory                                                          truncate, don't round).

4.SD CARD CONFIGURATION                                                   Set the number of cylinders to the number calculated.
Some ARM boards do not have any onboard flash, to keep
their bootloader. Rather, code onboard the board (presumably       Expert Command (m for help): [c]
in ROM) reads the second-stage bootloaders from the SD card        Number of cylinders (1-256, default xxx): [enter the number
.For the OMAP to find and boot off the SD Card, the first          you calculated]
primary partition must contain a FAT32 partition formatted
with 255 heads and 63 sectors. It is very specific, but not hard       Return to Normal            mode.
to setup. The SD Card should have 2 partitions : a smaller         Expert Command (m for help): [r]
                                                                                                                 1616 | P a g e
Pratyusha.Gandham, Ramesh N.V.K / International Journal of Engineering Research and Applications (IJERA)
                  ISSN: 2248-9622                                        www.ijera.com
                               Vol. 2, Issue 2,Mar-Apr 2012, pp.1614-1618
                                                                   the “u-boot.bin” and the third file is the kernel, “uImage”. The
4.3 Partitioning the SD card                                       root system has now to be untared to the second partition.
4.3.1 Create the FAT32 partition for booting
      Command (m for help): [n]                                   5. ARM BOARD SERIAL TERMINAL SET-UP
Command action                                                     For a Linux machine, a serial terminal such as Minicom or
 e extended                                                        Kermit can be used. Minicom is a text-based modem control
 p primary partition (1-4)                                         and terminal emulation program for Unix-like operating
 [p]                                                               systems whereas gtkterm is a terminal emulator written with
 Partition number (1-4): [1]                                       GTK+.It is lightweight and simple that drives serial ports
 First cylinder (1-245, default 1): [(press Enter)]                Ubuntu users wanting a graphical terminal program can install
 Using default value 1                                             gtkterm. Later versions which include many bug fixes can be
 Last cylinder or +size or +sizeM or +sizeK (1-245, default        obtained from the current maintainer's website.On a Windows
245): [+50]                                                        PC, you could use HyperTerminal or TeraTerm. Insert the SD
                                                                   card into the SD card slot of the target board. Connect the
      Command (m for help): [t]                                   target board to host machine using RS232 serial cable. Apply
Selected partition 1                                               power supply to the target board.
Hex code (type L to list codes): [c]
Changed system type of partition 1 to c (W95 FAT32 (LBA))          6. BOOTING UP THE ARM BOARD
Command (m for help): [a]                                          The term „booting‟ is short for „bootstrapping‟, which refers to
Partition number (1-4): [1]                                        the process by which a computer prepares itself to load an
                                                                   operating system. Small, resource-constrained systems such as
4.3.2 Create the Linux partition for the root file system          the BeagleBoard use a slightly different, multi step process
      Command (m for help): [n]                                   because of the constrained memory. The board boots up in
Command action                                                     four stages . The boot process on the ARM Board works like
  e extended                                                       this:
  p primary partition (1-4)                                        X-Loader -> U-Boot -> Kernel
[p]
Partition number (1-4): [2]
First cylinder (52-245, default 52): [(press Enter)]
Using default value 52
Last cylinder or +size or +sizeM or +sizeK (52-245, default
245): [(press Enter)]
Using default value 245
      Save the new partition records on the SD Card
This is an important step. All the work up to now has been
temporary.
      Command (m for help): [w]

4.4 Formating the partitions
The two partitions are given the volume names LABEL1 and
LABEL2 by these commands. You can substitute your own
volume labels.
$ [sudo mkfs.msdos -F 32 /dev/sdc1 -n LABEL1]
mkfs.msdos 2.11 (12 Mar 2005)

$ [sudo mkfs.ext3 -L LABEL2 /dev/sdc2]
mke2fs 1.40-WIP (14-Nov-2006)
                                                                               Figure4: Booting up the arm board
4.5 Finalizing SD Card
Finalizing SD card involves coping x-loader, u-boot, and           7.Conclusion
kernel images to the boot partition.You can have multiple          The paper discussed a generic environment build of Linux for
kernel images and name isn't important.The signed x-loader         ARM core family. This generic build has a limited
must be called MLO on the card.The first file you need to          functionality, as it just enables the kernel to boot and send
copy is the “MLO” from X-Loader. This has to be the first file     debug messages through the configured serial port. For a full
as it is the primary bootloader and the system just looks on the   fledged embedded module his is quit elementary without the
first few cluster on the SD Card to find it. The second file is    support for various peripherals through device drivers which
                                                                                                                1617 | P a g e
Pratyusha.Gandham, Ramesh N.V.K / International Journal of Engineering Research and Applications (IJERA)
                  ISSN: 2248-9622                                        www.ijera.com
                               Vol. 2, Issue 2,Mar-Apr 2012, pp.1614-1618
are paramount to the module. Linux kernel though monolithic
has an excellent modular approach which enables the driver
modules to be attached and detached at run time itself. This
very much suits the embedded environment which are always
constrained or system memory.

ACKNOWLEDGEMENT
We thank to our principal, Prof. K. Raja Shekar Rao, for
providing necessary facilities towards carrying out this work.
We acknowledge the diligent efforts of our Head of the
Department    Dr.S.Balaji      in   assisting   us     towards
implementation of this idea.

REFERENCES
[1]   HU Jie, ZHANG Gen-bao, “Research transplanting
      method of embedded linux kernel based on ARM
      platform”, 2010 International Conference of
      Information Science and Management Engineering, E-
      ISBN : 978-1-4244-7670-1, 8 Aug. 2010
[2]   http://www.kernel.org.
[3]   http://www.arm.linux.org.uk/developer/machines
[4]   http://sourceforge.net/projects/u-boot
[5]   Vincent      Sanders,     “Booting     ARM     Linux”,
      rev.1.10,June2004.http://www.simtec.co.uk/products/S
      WLINUX/files/booting_article.html
[6]   Wooking and Tak-Shing, “Porting the Linux kernel to a
      new ARM Platform”, Aleph One, vol. 4, summer 2002.
[7]   Chun-yue Bi; Yun-peng Liu; Ren-fang Wang;
      “Research of key technologies for embedded Linux
      based on ARM”, Computer Application and System
      Modeling (ICCASM),2010 International Conference,
       22-24 Oct. 2010, E-ISBN : 978-1-4244-7237-6.
[8]   DongSeok Cho; DooHwan Bae, “Case Study on
      Installing a Porting Process for Embedded Operating
      System in a Small Team”, Secure Software Integration
      & Reliability Improvement Companion (SSIRI-C),
      2011 5th International Conference, 27-29 June 2011, E-
      ISBN : 978-0-7695-4454-0.




                                                                                           1618 | P a g e

More Related Content

What's hot

bfarm-v2
bfarm-v2bfarm-v2
bfarm-v2
Zeus G
 
BrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made Easy
BrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made EasyBrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made Easy
BrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made Easy
Schlomo Schapiro
 
linux minimal os tutorial - by shatrix
linux minimal os tutorial - by shatrixlinux minimal os tutorial - by shatrix
linux minimal os tutorial - by shatrix
Sherif Mousa
 
Packages
PackagesPackages
Packages
jorgeft
 

What's hot (20)

Scalable Matrix Multiplication for the 16 Core Epiphany Co-Processor
Scalable Matrix Multiplication for the 16 Core Epiphany Co-ProcessorScalable Matrix Multiplication for the 16 Core Epiphany Co-Processor
Scalable Matrix Multiplication for the 16 Core Epiphany Co-Processor
 
Linuxbasiccommands
LinuxbasiccommandsLinuxbasiccommands
Linuxbasiccommands
 
Linux IO
Linux IOLinux IO
Linux IO
 
Linux Module Programming
Linux Module ProgrammingLinux Module Programming
Linux Module Programming
 
Linux basics
Linux basics Linux basics
Linux basics
 
Linux basics
Linux basics Linux basics
Linux basics
 
Linux training
Linux trainingLinux training
Linux training
 
淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道 淺談探索 Linux 系統設計之道
淺談探索 Linux 系統設計之道
 
Linux Kernel I/O Schedulers
Linux Kernel I/O SchedulersLinux Kernel I/O Schedulers
Linux Kernel I/O Schedulers
 
Linux Introduction
Linux IntroductionLinux Introduction
Linux Introduction
 
An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)
An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)
An introduction to the linux kernel and device drivers (NTU CSIE 2016.03)
 
bfarm-v2
bfarm-v2bfarm-v2
bfarm-v2
 
Lightweight Virtualization in Linux
Lightweight Virtualization in LinuxLightweight Virtualization in Linux
Lightweight Virtualization in Linux
 
Kernel Module Programming
Kernel Module ProgrammingKernel Module Programming
Kernel Module Programming
 
Building Mini Embedded Linux System for X86 Arch
Building Mini Embedded Linux System for X86 ArchBuilding Mini Embedded Linux System for X86 Arch
Building Mini Embedded Linux System for X86 Arch
 
BrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made Easy
BrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made EasyBrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made Easy
BrainShare 2010 SLC - ELS306 Linux Disaster Recovery Made Easy
 
Libra Library OS
Libra Library OSLibra Library OS
Libra Library OS
 
linux minimal os tutorial - by shatrix
linux minimal os tutorial - by shatrixlinux minimal os tutorial - by shatrix
linux minimal os tutorial - by shatrix
 
Packages
PackagesPackages
Packages
 
Syllable OS
Syllable OSSyllable OS
Syllable OS
 

Similar to Portin g

Kernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: DebianKernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: Debian
Anne Nicolas
 

Similar to Portin g (20)

Building
BuildingBuilding
Building
 
Lemay jin-reddy-schoudel
Lemay jin-reddy-schoudelLemay jin-reddy-schoudel
Lemay jin-reddy-schoudel
 
First Steps Developing Embedded Applications using Heterogeneous Multi-core P...
First Steps Developing Embedded Applications using Heterogeneous Multi-core P...First Steps Developing Embedded Applications using Heterogeneous Multi-core P...
First Steps Developing Embedded Applications using Heterogeneous Multi-core P...
 
Steps to Build Kernel and Root Filesystem for OMAP5912
Steps to Build Kernel and Root Filesystem for OMAP5912Steps to Build Kernel and Root Filesystem for OMAP5912
Steps to Build Kernel and Root Filesystem for OMAP5912
 
OMAP
OMAPOMAP
OMAP
 
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
Dev opsec dockerimage_patch_n_lifecyclemanagement_2019
 
Kernel Recipes 2013 - ARM support in the Linux kernel
Kernel Recipes 2013 - ARM support in the Linux kernelKernel Recipes 2013 - ARM support in the Linux kernel
Kernel Recipes 2013 - ARM support in the Linux kernel
 
Cross-compilation native sous android
Cross-compilation native sous androidCross-compilation native sous android
Cross-compilation native sous android
 
Introduction To Linux Kernel Modules
Introduction To Linux Kernel ModulesIntroduction To Linux Kernel Modules
Introduction To Linux Kernel Modules
 
Kernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: DebianKernel maintainance in Linux distributions: Debian
Kernel maintainance in Linux distributions: Debian
 
Embedding Linux On The Encore Simputer
Embedding Linux On The Encore SimputerEmbedding Linux On The Encore Simputer
Embedding Linux On The Encore Simputer
 
Masters porting linux
Masters porting linuxMasters porting linux
Masters porting linux
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Linux device driver
Linux device driverLinux device driver
Linux device driver
 
Divya_Resume
Divya_ResumeDivya_Resume
Divya_Resume
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetes
 
Docker - A Ruby Introduction
Docker - A Ruby IntroductionDocker - A Ruby Introduction
Docker - A Ruby Introduction
 
Rac on NFS
Rac on NFSRac on NFS
Rac on NFS
 
Embedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 PlatformEmbedded Linux/ Debian with ARM64 Platform
Embedded Linux/ Debian with ARM64 Platform
 
Linux Kernel Library - Reusing Monolithic Kernel
Linux Kernel Library - Reusing Monolithic KernelLinux Kernel Library - Reusing Monolithic Kernel
Linux Kernel Library - Reusing Monolithic Kernel
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Recently uploaded (20)

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 

Portin g

  • 1. Pratyusha.Gandham, Ramesh N.V.K / International Journal of Engineering Research and Applications (IJERA) ISSN: 2248-9622 www.ijera.com Vol. 2, Issue 2,Mar-Apr 2012, pp.1614-1618 PORTING THE LINUX KERNEL TO AN ARM BASED DEVELOPMENT BOARD Pratyusha.Gandham1 , Ramesh N.V.K2 1Research Scholar, Dept. of E.C.M, K.L. University, A.P,India 2 Associate Professor, Dept. of E.C.M, K.L. University Abstract ARM development boards are the ideal platform for accelerating the development and reducing the risk of new SoC designs. The combination of ASIC and FPGA technology in ARM boards delivers an optimal solution in terms of speed, accuracy, flexibility and cost.. The Embedded modules,based on ARM, can become very complex machines since these are meant to support varied tasks such as memory management, process management and peripheral interfaces.For seamless integration of these functional modules an OS has to be ported on these ARM based CPUs .Traditionally this OS porting is often the specialized work of third party vendors having expertise in this domain. For every new CPU architecture, the OS has to be customized, compiled and burnt into the core .With the coming of age of Linux as an embedded OS all this has changed quite significantly. Being in Open Source domain, Linux kernel can be freely downloaded and compiled for any system architecture and this includes ARM based systems also. This enables the developers to port the OS themselves. This paper describes the details of porting of Linux kernel to an ARM board.Building linux kernel,u-boot and x-loader are described in detail. SD card configuration is also described. Index Terms: ARM, Operating System, Linux, Kernel. -------------------------------------------------------------***-------------------------------------------------------------- 1. INTRODUCTION Linux has been available for the ARM architecture for many years now. The original „port‟ was done by Russell King, and he is still the maintainer through whom all ARM kernel patches generally must pass. GNU/Linux is fast becoming the operating system for embedded devices - mainly due to the efficient and portable design of the Linux kernel. The ARM Linux port effort, headed by Russell M. King, also makes life a bit easier for people who run (or want to run) Linux on their embedded devices. The work was much harder than than it would be now, since at the time the Linux kernel was still very Intel-centric. In fact, modern Linux kernels come with a handy reference example called asm-generic that shows all of the header files and kernel interfaces that a new architecture port should provide. Once the kernel has been ported to a given architecture, it is necessary to implement support for a specific platform based upon that architecture. Figure1: Panda Board, an ARM based development board Texas Instruments implements the ARM architecture in its from Texas Instruments. OMAP processors. For example, Panda Board is a particular variant of the OMAP4 platform. Panda Board is based on 2. BUILDING LINUX KERNEL ARM Cortex-A9 System-on-Chip (SoC) processor. Latest stable version of linux kernel can be obtained from kernel.org website. This is in the form of a source code and we need to compile it. Figure 2 shows the basic architecture of linux2.6.11.6. The Linux kernel supports a lot of different 1614 | P a g e
  • 2. Pratyusha.Gandham, Ramesh N.V.K / International Journal of Engineering Research and Applications (IJERA) ISSN: 2248-9622 www.ijera.com Vol. 2, Issue 2,Mar-Apr 2012, pp.1614-1618 CPU architectures. The methods to port the Linux kernel to a remote server if you want to compile kernel new board are therefore very architecture dependent. For remotely. example, PowerPC and ARM are very different. PowerPC  $ make xconfig - X windows (Qt) based relies on device trees to describe hardware details whereas configuration tool, works best under KDE desktop ARM relies on source code only. In the source tree, each ● $ make gconfig - X windows (Gtk) based architecture has its own directory arch/arm for the ARM configuration tool, works best under Gnome Dekstop. architecture. For building the linux kernel, cross-compiler should be made accessible on your execution path. Figure 3: Configuring Linux Kernel using make menuconfig. 2.4 Compile kernel Figure 2:Linux kernel architecture The Linux kernel supports a lot of different CPU architectures.The methods to port the Linux kernel to a new 2.1 Get Latest Linux kernel code board are therefore very architecture dependent. In the source tree, each architecture has its own directory arch/arm for the Visit http://kernel.org/ and download the latest source code. ARM architecture.For building the linux kernel, cross- File name would be linux-x.y.z.tar.bz2, where x.y.z is actual compiler should be made accessible on your execution path. version number. For example file inux-2.6.25.tar.bz2 Entering make command would start compilation and create a represents 2.6.25 kernel version. Use wget command to compressed kernel image. The resulting kernel image is download kernel source code: placed in arch/arm/boot directory.  $export ARCH=arm  $wget http://www.kernel.org/pub/linux/kernel/v2.6/linux- x.y.z.tar.bz2  $ export CROSS_COMPILE= arm-none-linux- gnueabi 2.2 Extract tar (.tar.bz3) file The tar program provides the ability to create tar archives, as  $ make well as various other kinds of manipulation.Typing the following command will extract it to current directory: 3. X-LOADER AND U-BOOT  # tar -xjvf linux-2.6.25.tar.bz2 X-loader is a small first stage boot loader derived from the u- boot base code to be loaded into the internal static ram. 2.3 Configure kernel Because the internal static ram is very small (64k-32k), x- Before you configure kernel make sure you have development loader is stripped down to the essentials and is used to tools (gcc compilers and related tools) are installed on your initialize memory and enough of the peripheral devices to system. If gcc compiler and tools are not installed then use access and load the second stage loader (U-Boot) into main apt-get command under Debian Linux to install development memory.U-Boot is designed to be the "Universal Bootloader" tools. and certainly goes a long ways to support multiple processors,  # apt-get install gcc boards, and OS's. It's primary purpose is to setup the kernel Now you can start kernel configuration by typing any one of environment; and load and boot the kernel. The sources of u- the command: boot and x-loader specific to the ARM board can be obtained and built using make utility on terminal. The procedure for  $ make menuconfig - Text based color menus, building it is same as it is for linux kernel. The output of the radiolists & dialogs. This option also useful on build process is u-boot.bin and MLO. 1615 | P a g e
  • 3. Pratyusha.Gandham, Ramesh N.V.K / International Journal of Engineering Research and Applications (IJERA) ISSN: 2248-9622 www.ijera.com Vol. 2, Issue 2,Mar-Apr 2012, pp.1614-1618 FAT32 boot partition and a larger ext3 partition for the 3.1 Building X-loader filesystem or rootfs. Following are the steps to partition the In order to compile the X-loader, you need to set the SD card on a linux machine. CROSS_COMPILE environment variable and specify the path to tool chain. 4.1 Formatting the SD Card To determine which device the SD Card Reader is on your  #export system,plug the SD Card into the SD Card Reader and then PATH=/usr/local/xtools/arm--linux-uclibcgnueabi/bi plug the SD Card Reader into your system. After doing that, n:$PATH do the following to determine which device it is on your  #export CROSS_COMPILE= arm-none-linux- system. gnueabi- $ [dmesg | tail] ... To set the configuration for the target board and build the [ 6854.215650] sd 7:0:0:0: [sdc] Mode Sense: 0b 00 00 08 image, give the command: [ 6854.215653] sd 7:0:0:0: [sdc] Assuming drive cache: write  # make BOARDNAME_config through  # make [ 6854.215659] sdc: sdc1 [ 6854.218079] sd 7:0:0:0: [sdc] Attached SCSI removable The resulting file is stored in the x-loader main directory as disk x--load.bin. This file must be “signed” in order to be executed ... by the processor. Using the signGP tool in the tools/ In this case, it shows up as /dev/sdc. subdirectory of the main directory of the lab, sign the x-load.bin file. This produces an x-load.bin.ift file. You can Fdisk utilty is used to partition SD card on a linux machine. copy it to the MMC card, renaming it as MLO. The following command starts the fdisk. We must clear the partition table before changing the underlying geome 3.2 Building U-boot  Command (m for help): [d] U-Boot is a typical free software project.It is freely available Selected partition 1 at http://www.denx.de/wiki/U-Boot.Get the source code from the website, and uncompress it.The include/configs/ directory 4.2 Set the Geometry of the SD Card contains one configuration file for each supported board.It If the print out above does not show 255 heads, 63 defines the CPU type, the peripherals and their configuration, sectors/track, then do the following expert mode steps to redo the memory mapping, the U-Boot features that should be the SD Card: compiled in, etc.Assuming that your board is already  Go into expert mode. supported by U-Boot, there should be one file corresponding Command (m for help): [x] to your board, for example include/configs/omap2420h4.h.U- -Boot must be configured before being compiled.  Set the number of heads to 255. Expert Command (m for help): [h]  #make BOARDNAME_config Number of heads (1-256, default xxx): [255] Make sure that the cross-compiler is available in PATH  Set the number of sectors to 63.  #export Expert Command (m for help): [s] PATH=/usr/local/uclibc-0.9.29-2/arm/bin/:$PATH Number of sectors (1-63, default xxx): [63]  Now Calculate the number of Cylinders for your SD Compile U-Boot, by specifying the cross-compiler prefix. Card. Example, if your cross-compiler executable is arm-linux-gcc: #cylinders = FLOOR (the number of Bytes on the SD Card  #make CROSS_COMPILE=arm-linux (from above) / 255 / 63 / 512 )So for this example: This command would result in u-boot.bin file in working 2021654528 / 255 / 63 / 512 = 245.79. So we use 245 (i.e. directory truncate, don't round). 4.SD CARD CONFIGURATION  Set the number of cylinders to the number calculated. Some ARM boards do not have any onboard flash, to keep their bootloader. Rather, code onboard the board (presumably Expert Command (m for help): [c] in ROM) reads the second-stage bootloaders from the SD card Number of cylinders (1-256, default xxx): [enter the number .For the OMAP to find and boot off the SD Card, the first you calculated] primary partition must contain a FAT32 partition formatted with 255 heads and 63 sectors. It is very specific, but not hard  Return to Normal mode. to setup. The SD Card should have 2 partitions : a smaller Expert Command (m for help): [r] 1616 | P a g e
  • 4. Pratyusha.Gandham, Ramesh N.V.K / International Journal of Engineering Research and Applications (IJERA) ISSN: 2248-9622 www.ijera.com Vol. 2, Issue 2,Mar-Apr 2012, pp.1614-1618 the “u-boot.bin” and the third file is the kernel, “uImage”. The 4.3 Partitioning the SD card root system has now to be untared to the second partition. 4.3.1 Create the FAT32 partition for booting  Command (m for help): [n] 5. ARM BOARD SERIAL TERMINAL SET-UP Command action For a Linux machine, a serial terminal such as Minicom or e extended Kermit can be used. Minicom is a text-based modem control p primary partition (1-4) and terminal emulation program for Unix-like operating [p] systems whereas gtkterm is a terminal emulator written with Partition number (1-4): [1] GTK+.It is lightweight and simple that drives serial ports First cylinder (1-245, default 1): [(press Enter)] Ubuntu users wanting a graphical terminal program can install Using default value 1 gtkterm. Later versions which include many bug fixes can be Last cylinder or +size or +sizeM or +sizeK (1-245, default obtained from the current maintainer's website.On a Windows 245): [+50] PC, you could use HyperTerminal or TeraTerm. Insert the SD card into the SD card slot of the target board. Connect the  Command (m for help): [t] target board to host machine using RS232 serial cable. Apply Selected partition 1 power supply to the target board. Hex code (type L to list codes): [c] Changed system type of partition 1 to c (W95 FAT32 (LBA)) 6. BOOTING UP THE ARM BOARD Command (m for help): [a] The term „booting‟ is short for „bootstrapping‟, which refers to Partition number (1-4): [1] the process by which a computer prepares itself to load an operating system. Small, resource-constrained systems such as 4.3.2 Create the Linux partition for the root file system the BeagleBoard use a slightly different, multi step process  Command (m for help): [n] because of the constrained memory. The board boots up in Command action four stages . The boot process on the ARM Board works like e extended this: p primary partition (1-4) X-Loader -> U-Boot -> Kernel [p] Partition number (1-4): [2] First cylinder (52-245, default 52): [(press Enter)] Using default value 52 Last cylinder or +size or +sizeM or +sizeK (52-245, default 245): [(press Enter)] Using default value 245  Save the new partition records on the SD Card This is an important step. All the work up to now has been temporary.  Command (m for help): [w] 4.4 Formating the partitions The two partitions are given the volume names LABEL1 and LABEL2 by these commands. You can substitute your own volume labels. $ [sudo mkfs.msdos -F 32 /dev/sdc1 -n LABEL1] mkfs.msdos 2.11 (12 Mar 2005) $ [sudo mkfs.ext3 -L LABEL2 /dev/sdc2] mke2fs 1.40-WIP (14-Nov-2006) Figure4: Booting up the arm board 4.5 Finalizing SD Card Finalizing SD card involves coping x-loader, u-boot, and 7.Conclusion kernel images to the boot partition.You can have multiple The paper discussed a generic environment build of Linux for kernel images and name isn't important.The signed x-loader ARM core family. This generic build has a limited must be called MLO on the card.The first file you need to functionality, as it just enables the kernel to boot and send copy is the “MLO” from X-Loader. This has to be the first file debug messages through the configured serial port. For a full as it is the primary bootloader and the system just looks on the fledged embedded module his is quit elementary without the first few cluster on the SD Card to find it. The second file is support for various peripherals through device drivers which 1617 | P a g e
  • 5. Pratyusha.Gandham, Ramesh N.V.K / International Journal of Engineering Research and Applications (IJERA) ISSN: 2248-9622 www.ijera.com Vol. 2, Issue 2,Mar-Apr 2012, pp.1614-1618 are paramount to the module. Linux kernel though monolithic has an excellent modular approach which enables the driver modules to be attached and detached at run time itself. This very much suits the embedded environment which are always constrained or system memory. ACKNOWLEDGEMENT We thank to our principal, Prof. K. Raja Shekar Rao, for providing necessary facilities towards carrying out this work. We acknowledge the diligent efforts of our Head of the Department Dr.S.Balaji in assisting us towards implementation of this idea. REFERENCES [1] HU Jie, ZHANG Gen-bao, “Research transplanting method of embedded linux kernel based on ARM platform”, 2010 International Conference of Information Science and Management Engineering, E- ISBN : 978-1-4244-7670-1, 8 Aug. 2010 [2] http://www.kernel.org. [3] http://www.arm.linux.org.uk/developer/machines [4] http://sourceforge.net/projects/u-boot [5] Vincent Sanders, “Booting ARM Linux”, rev.1.10,June2004.http://www.simtec.co.uk/products/S WLINUX/files/booting_article.html [6] Wooking and Tak-Shing, “Porting the Linux kernel to a new ARM Platform”, Aleph One, vol. 4, summer 2002. [7] Chun-yue Bi; Yun-peng Liu; Ren-fang Wang; “Research of key technologies for embedded Linux based on ARM”, Computer Application and System Modeling (ICCASM),2010 International Conference, 22-24 Oct. 2010, E-ISBN : 978-1-4244-7237-6. [8] DongSeok Cho; DooHwan Bae, “Case Study on Installing a Porting Process for Embedded Operating System in a Small Team”, Secure Software Integration & Reliability Improvement Companion (SSIRI-C), 2011 5th International Conference, 27-29 June 2011, E- ISBN : 978-0-7695-4454-0. 1618 | P a g e