• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Linux Porting

Linux Porting






Total Views
Views on SlideShare
Embed Views



7 Embeds 1,705

http://sysplay.in 850
http://profession.sarika-pugs.com 805
http://ivalmiki.com 31
http://www.sysplay.in 9
http://localhost 4
http://www.linkedin.com 4
https://www.linkedin.com 2



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.


110 of 12 previous next Post a comment

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
  • Hi Arun,
    If you are interested in exploring Embedded Linux Porting with Beagle board, here's an update. Starting coming Saturday (12th Jan '13), is planned our next weekend workshop on Embedded Linux Porting with Beagle Board. Check out the details here @ http://sysplay.in

    Are you sure you want to
    Your message goes here
  • There may not be any book for a specific board porting. You may get more help in corresponding linux forums.
    Are you sure you want to
    Your message goes here
  • Hi Anil thanks for your ppt, please suugest me some books for board porting,i want to make custom configuration changes to kernel for my hardware based on mpc 8641d.
    Are you sure you want to
    Your message goes here
  • Not meant for the same :)
    Are you sure you want to
    Your message goes here
  • Pls enable the download
    Are you sure you want to
    Your message goes here

110 of 12 previous next

Post Comment
Edit your comment

    Linux Porting Linux Porting Presentation Transcript

    • Linux Porting & Linux Support Package © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> All Rights Reserved.
    • What to Expect? Kernel Basics for Linux Porting W's of Linux Porting W's of Linux Support Package (LSP) Architecture of LSPs Browse & Understand the LSPs LSP & Board Bringup Connections © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 2 All Rights Reserved.
    • Some Basics For Understanding Linux Porting © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 3 All Rights Reserved.
    • Kernel Items to Consider Version Major Minor Sequence Extra version /proc/version Source Repositories & Mailing Lists Architecture Specific Architecture Merging Efforts © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 4 All Rights Reserved.
    • Kernel Configuration (Detailed) Changing the .config by hand Preparing & Using a default config Other Configs: rand, allmod, allyes, allno Adding an Entry Change in Kconfig Change in Makefile Let's have a demonstration The autoconf.h © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 5 All Rights Reserved.
    • Kernel Image Components Observe the Makefile &/or vmlinux build with V=1 Objects arch/<arch>/kernel/head.o Kernel Architecture specific startup code arch/<arch>/kernel/init-task.o Initial thread & task structs required by Kernel init/built-in.o Main kernel initialization code … Linker script arch/<arch>/kernel/vmlinux.lds Kernel Bootstrap Loader Initialize Processor's internal caches and C runtime environment (head*.o) Decompression & re-location (misc.o) Processor-specific initialization, e.g. endian related (*endian.o) © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 6 All Rights Reserved.
    • Kernel Initialization (Detailed) Kernel Entry Point arch/<arch>/kernel/head*.o Kernel Startup init/main.c → start_kernel(); Browse the code Architecture Setup Command Line Processing & __setup macro(arg, f) Subsystem Initializations & Initcalls (for memory free up) Kernel init Thread → init process Idle Process © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 7 All Rights Reserved.
    • Linux Porting © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 8 All Rights Reserved.
    • What is Porting? “To Port” is “To Carry” Adapting to the Environment That it was not Designed for And by “(Embedded) Linux Porting” we mean Adapting Linux to work on an Embedded Platform So, what does it take to port Linux At high level, the 5's of Embedded Systems And at kernel level, the 5 M's of OS © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 9 All Rights Reserved.
    • 5 M's of OS (Revisited) Architecture Porting Processor Management Memory Management Board Porting I/O Management Storage Management Network Management © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 10 All Rights Reserved.
    • Linux Porting Architecture Porting is a subject in itself Would talk in a separate session Board Porting Board-specific Initialization Code And majorly Drivers Porting So, part of the Kernel Space Two categories of Drivers Standard Device Drivers Part of the Kernel Or, Needs to be done as for writing the standard Linux Drivers At the standard directory locations Custom Device / Interface Drivers Board-specific Custom Code required Needs to be specifically brought-in with the Kernel © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 11 All Rights Reserved.
    • What is Linux Support Package? Collection of this board specific Initialization & Custom Code is referred as Board Support Package (BSP) – normal language Or, Linux Support Package (LSP) – Linux language © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 12 All Rights Reserved.
    • Sources of LSPs Board Vendor For a reference board, Or For a board based on the reference design Develop your Own for a Custom Board developed In-House First, search the kernel source for existing code If found, use it Else, if found something close, modify & use it Otherwise, following material would provide further guidelines © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 13 All Rights Reserved.
    • Architecture of Linux Support Packages © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 14 All Rights Reserved.
    • Components of LSP As LSP is very specific to a board. It consists of code for things hard-wired on the board A Usual List Interrupt Request Numbers Audio Codecs Keypad Interfaces Switch Interfaces LED Interfaces ... © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 15 All Rights Reserved.
    • LSP Placement With these in mind, and a board being tied to an architecture, the natural place for an LSP becomes under the kernel's “arch” sub-tree To be more specific, under the specific <arch> of the arch/ Architecture Specific Code resides under arch/<arch> → Sources include/asm-<arch> → Headers So, Board Specific Code resides under arch/<arch>/mach-<board_name> → Sources include/asm/mach-<board_name> → Headers mach stands for Machine, lingo for Board in Linux community Many LSP vendors, violate these norms, and Place headers with sources Place the LSP at other inappropriate locations © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 16 All Rights Reserved.
    • Design & Layout of LSPs Where does a keypad driver go? Under drivers, Or Linux Support Package What about code for Audio chip, when the controller doesn't have built-in audio support (say I2S)? Such gray areas create confusion People place the code as per their judgment Hence, we follow some thumb rules Design & Layout Rules of Thumb Look for something similar, already in kernel source Follow the norm If not there, start from the LSP Over time, if it becomes generic enough, move to drivers For all the above, appropriately update Kconfig & Makefile © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 17 All Rights Reserved.
    • Initialization Code LSP Board specific Code UART Configuration – UART Pins, UART vs Device mapping, ... Ethernet Configuration – Interrupt Pin, ... … (the various device configurations) Let's browse the code © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 18 All Rights Reserved.
    • Custom Code LSP Interrupts Input / Output Management Audio Video Embedded Storage Management Flash Partitioning NB Separate sessions planned for each © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 19 All Rights Reserved.
    • Let's Browse some LSPs © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 20 All Rights Reserved.
    • LSP & Board Bringup Connections © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 21 All Rights Reserved.
    • BSP in Bootloader Bootloader does some of the Board-specific tasks, which are done in kernel Device Initialization Some Device Access This could be taken advantage from Could serve as the reference for the LSP Many a times, it becomes other way round Code developed for LSP may help enhance Bootloader Improving a better Board Bringup Experience © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 22 All Rights Reserved.
    • Board Id Unique Number designated to every Board Type Part of the LSP and exposed to Bootloader Populated by Bootloader Verified by LSP Let's browse to view it © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 23 All Rights Reserved.
    • Hacking the LSP Very often, we have initial boot, test & board bringup programs, written to run on the bare board They may be really useful to hack the LSP When it is not working as expected © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 24 All Rights Reserved.
    • What all have we learnt? Kernel Basics for Linux Porting W's of Linux Porting W's of Linux Support Package (LSP) Architecture of LSPs Browse & Understand the LSPs LSP & Board Bringup Connections © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 25 All Rights Reserved.
    • Any Queries? © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 26 All Rights Reserved.