SlideShare a Scribd company logo
1 of 24
Download to read offline
Linux without a boot loader – the
OMAP way!

OR
Why I stopped being scared of X-
loader and started using Linux


 Nishanth Menon
 25 August 2010
Introduction
   Why do we need a bootloader?

   Too many bootloaders, yet, not one that works
    for me..

   Heresy: What if Linux is used as a bootloader?
        A single s/w package- Reduce maintenance.
        New features – easier to borrow from Linux
        It'd be kinda fun

   Builds on ELC2010 SFO Greg Ungerer, Magnus
    Damm 's work
                                                      2/
Agenda 1/2

   Concepts of OMAP GP device boot load process

   Why x-loader?

   Content of a Linux image without bootloader

   The tools
        Tagger
        Gpsign

   Demo
                                                   3/
Agenda 2/2

   What next? Using Linux as a bootloader

   Problems with the Approach

   Summary

   Terminology

   References


                                             4/
Concepts of OMAP boot load process
                        X-loader    U-Boot   Kernel
                                                         I/O device
                                                        (Nand/MMC)



                                   U-Boot    Kernel
ROM Code                            “XIP”              Memory mapped
                                                       device(NOR)
  ROM
   ROM




                                                        Peripheral
                         2nd       U-Boot    Kernel
                                                        (USB/UART)



SDRAM    NOR    SRAM
 SDRAM    NOR    SRAM                           Scope of this presentation
                                                               5/
Why X-loader?

   SRAM is tiny: 64K(OMAP3 GP), 32K(OMAP4)

   “Traditional Bootloaders” are bloated!– e.g.
        U-boot: beagleboard build is 196K!!
        Barebox: first beagleboard version of
         barebox was 36k, it is around 40+k now!

   There is never going to be a solution as long as
    we need to keep adding new features!

                                                       6/
What I love about X-loader

   “shared code” with TI u-boot

   Does the stuff (well.. mostly)
       Simple code (usually!)

   TINY.. well.. mostly so, until we started adding
    FAT, MMC, USB...

   TI mostly has some variant for every OMAP


                                                       7/
What I hate about X-loader
   It does way more than what it needs to do the job
    - “load and execute u-boot”

   There is NO mainline x-loader code

   Toooo many variants of x-loader.. There is a
    broken up community of x-loader – each centered
    around some silicon variant

   I am gonna stop now..


                                                        8/
Do I REALLY need x-loader?




                NO
There are alternatives:          Psuedocode:
                                 Switch cpsr to svc
                                 Disable watchdog
 Barebox?                       Enable uart
                                 Copy image from x to sdram
 my_own_stupid_bootloader.s     Give control to image

 Linux? But it is 3 megs big!!
     Soln: Load it to SDRAM directly

                                                              9/
Basic things for Linux to boot on
                OMAP?
   Basic h/w configuration:
        Make the SDRAM ready – clocks
        configured
        Very basic mux – we expect the kernel to
        take care of it's own needs..
   One serial port configured
   Setup ATAGs as required for any Linux port of
    ARM to boot

    Load the kernel up in SDRAM
Ref: http://www.arm.linux.org.uk/developer/booting.php
                                                         10 /
Linux image without bootloader
            Load address, size
                                     gpsign
                                      gpsign
 Boot      Configuration Header
Header

          Disable watchdog
           Disable watchdog
          Configure one uart
           Configure one uart
  Sty     Setup
           Setup                     tagger
                                      tagger
          r0 ==00
           r0
          r1 ==mach ID
           r1 mach ID
          r2 ==ATAG address
           r2 ATAG address

bzImage

                   piggy
                                  make bzImage
                                   make bzImage
                  zImage


                                                  11 /
How does tagger work?

                                                        Sty

           tagger
            tagger
                                                       ATAG


                                                      bzImage


                                       Sty template
                        Config file
                         Config file
bzImage
 bzImage             -tags
                       -tags
                     - -machid           Marker:
                         machid           Size

                                        Marker:
                                        MACHID

                                                                12 /
Sty in the works
                                                      1 – the
                                                      setup        Disable
                                                                    WDT
                                     Sty

                                                                  Cache, int
                                                                   disable
             ATAG

                                           2 – hand                 Setup
                                           over to                  UART
                                           piggy
                piggy                                              Setup
                                                                  Uart mux
4- give                 3-
control to                             zImage
                        uncompres
kernel                                                          Relocate atag to
                        s the real
                                                                First 16k memory
                        image



      Uncompressed kernel
                                                                                   13 /
GP Sign – Boot Header
                                      Load address
                                      Size of image


                                          Clock
                                       configuration
         gpsign
          gpsign
                                           DDR
                                       configuration

                                       GPMC CS0
                                       configuration

                       Config file
                        Config file       MMC
image
 image             - -clock config
                       clock config    configuration
                   - -ddr config
                       ddr config
                                      Configuration
                                        Header
                                          image

                                                       14 /
How does this GP image boot?
Load address                                                  OMAP
Size of image
                 2                 OMAP
                 Figures out       RomCode
    Clock
                 where to
 configuration
                 load

     DDR
 configuration
                 1                    3-                    DPLLs
                 Configures         Loads
 GPMC CS0        clocks             image
 configuration                                            4 – gives
                                                           control

    MMC
 configuration

Configuration
  Header                                                SDRAM
                                                         SDRAM
    image
                 There is more that happens in HS/EMU device..
                                                                      15 /
Demo




       16 /
Next steps 1/2: optimize

    Choose a sane kernel configuration for the
    environment you'd like to work on
     If your board has ethernet, enable ethernet, use
      nfs as rootfs
     If you board has usb, you may want to try out
      usbnet
     Reduce statically built kernel drivers and have
      only the kernel modules you need (if you dont
      care for multimedia in your bootloader, why
      have dspbridge, audio drivers enabled?)

                                                         17 /
Next steps 2/2: power features
    Write your own custom shell scripts if your “users”
    are interested in “u-boot like” environment, -e.g.
    setenv/saveenv pair could be:
    setenv() { x=$1;shift;export $x="$*";}
    saveenv() { export>/etc/exported_vars;}
and the /etc/profile file uses that file..

    Use kexec! With kexec you get bootm equivalent.
       You can wrap kexec inside a bootm as well.

    Remember you now have the power to do what you
    can imagine without thinking how to port it..

                                                           18 /
Ok, so what's the catch? (1/2)
    Deployment issues
       Single bootimage requirement for multiple
        board variants and (clocks sdrc, machid are
        all coded in),
       Training new users and re-training old users?

    NAND technology and badblocks → with large
    uImage, any bad block can make the image no
    longer usable.. but we can debate that at a later
    date ;)


                                                        19 /
Ok, so what's the catch? (2/2)

    “MLO file” MMC with FAT partition on
    OMAP3 has limitations of 128k sized image(so
    not kernel or u-boot at least :(), but it will
    become usable with OMAP4 -are there options?
    Probably (see references)

    So now we need to maintain and test kernel in
    two defconfig configurations? - yeah maybe..



                                                     20 /
Summary
   Linux without a bootloader provides a lot of
    flexibilities

   There are limitations as well – wont solve everyone's
    problems.

   Could be suited in a single platform environment

   Not really hardcore tested solution beyond “lab
    environment”

                                                       21 /
Terminology
   XIP – Execute in Place
   U-Boot – Das U-Boot – the Universal Boot
    loader
   X-loader – TI variant of U-Boot. A stripped
    down version
   Barebox – Somewhere between Linux and U-
    boot – can also be used as a boot loader
   Busybox – a filesystem with tiny versions of
    standard unix utils
   OMAP-Uboot-utils – a bunch of utilities to do
    the grunt workof this presentation
                                                    22 /
References
   ARM linux kernel boot requirements:
    http://www.arm.linux.org.uk/developer/booting.php

   ELC2010 work (SFO)
           Greg Ungerer: Linux without a bootloader
    http://elinux.org/images/7/7b/LinuxWithoutABootLoader.pdf
           Magnus Damm: Linux as a bootloader
    http://elinux.org/images/2/2f/ELC-2010-Damm-Kexec.pdf
           Grant Likely: Device tree support
    http://elinux.org/images/b/b6/ARM_Device_Tree_Status_Report.pdf

        Ghorai Sukumar: eMMC boot
http://omapedia.org/wiki/E-MMC_boot#You_can_boot_omap3630_without_x-loader

     Kexec: http://www.ibm.com/developerworks/linux/library/l-kexec.html

      Omap u-boot utils: http://code.google.com/p/omap-u-boot-utils/

                                                                             23 /
Backup

   Reference code:
http://github.com/nmenon/uomapfs
 branch: ldemo
 You get kexec, linux-omap omap-uboot-fs and a
   bunch of reference configuration files for
   SDP3630 which can be easily customized and
   improved for development platforms.




                                                  24 /

More Related Content

What's hot

Linux Porting
Linux PortingLinux Porting
Linux PortingChamp Yen
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBshimosawa
 
Embedding Linux On The Encore Simputer
Embedding Linux On The Encore SimputerEmbedding Linux On The Encore Simputer
Embedding Linux On The Encore SimputerSatpal Parmar
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
 
Linux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emptionLinux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emptionHemanth Venkatesh
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device driversHoucheng Lin
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Thomas Petazzoni
 
Basics of boot-loader
Basics of boot-loaderBasics of boot-loader
Basics of boot-loaderiamumr
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)shimosawa
 
Linux Kernel Image
Linux Kernel ImageLinux Kernel Image
Linux Kernel Image艾鍗科技
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchlinuxlab_conf
 
Linux Kernel Platform Development: Challenges and Insights
 Linux Kernel Platform Development: Challenges and Insights Linux Kernel Platform Development: Challenges and Insights
Linux Kernel Platform Development: Challenges and InsightsGlobalLogic Ukraine
 
Device tree support on arm linux
Device tree support on arm linuxDevice tree support on arm linux
Device tree support on arm linuxChih-Min Chao
 
Making your own bootloader
Making your own bootloaderMaking your own bootloader
Making your own bootloaderiamumr
 

What's hot (20)

Linux Porting
Linux PortingLinux Porting
Linux Porting
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
Building
BuildingBuilding
Building
 
Embedding Linux On The Encore Simputer
Embedding Linux On The Encore SimputerEmbedding Linux On The Encore Simputer
Embedding Linux On The Encore Simputer
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Linux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emptionLinux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emption
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)
 
Basics of boot-loader
Basics of boot-loaderBasics of boot-loader
Basics of boot-loader
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
Getting started with BeagleBone Black - Embedded Linux
Getting started with BeagleBone Black - Embedded LinuxGetting started with BeagleBone Black - Embedded Linux
Getting started with BeagleBone Black - Embedded Linux
 
Linux Kernel Image
Linux Kernel ImageLinux Kernel Image
Linux Kernel Image
 
Board Bringup
Board BringupBoard Bringup
Board Bringup
 
What is Bootloader???
What is Bootloader???What is Bootloader???
What is Bootloader???
 
QEMU in Cross building
QEMU in Cross buildingQEMU in Cross building
QEMU in Cross building
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
 
Linux Kernel Platform Development: Challenges and Insights
 Linux Kernel Platform Development: Challenges and Insights Linux Kernel Platform Development: Challenges and Insights
Linux Kernel Platform Development: Challenges and Insights
 
Device tree support on arm linux
Device tree support on arm linuxDevice tree support on arm linux
Device tree support on arm linux
 
Making your own bootloader
Making your own bootloaderMaking your own bootloader
Making your own bootloader
 

Viewers also liked

MeeGo on OMAP4 PandaBoard
MeeGo on OMAP4 PandaBoardMeeGo on OMAP4 PandaBoard
MeeGo on OMAP4 PandaBoardNishanth Menon
 
Qi -- Lightweight Boot Loader Applied in Mobile and Embedded Devices
Qi -- Lightweight Boot Loader Applied in Mobile and Embedded DevicesQi -- Lightweight Boot Loader Applied in Mobile and Embedded Devices
Qi -- Lightweight Boot Loader Applied in Mobile and Embedded DevicesNational Cheng Kung University
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverNanik Tolaram
 
Linux SD/MMC device driver
Linux SD/MMC device driverLinux SD/MMC device driver
Linux SD/MMC device driver艾鍗科技
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowOpersys inc.
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal BootloaderSatpal Parmar
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debuggingUtkarsh Mankad
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessNanik Tolaram
 
Q4.11: Introduction to eMMC
Q4.11: Introduction to eMMCQ4.11: Introduction to eMMC
Q4.11: Introduction to eMMCLinaro
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesChris Simmonds
 
Learning android with AOSP
Learning android with AOSPLearning android with AOSP
Learning android with AOSPJorge Barroso
 

Viewers also liked (14)

MeeGo on OMAP4 PandaBoard
MeeGo on OMAP4 PandaBoardMeeGo on OMAP4 PandaBoard
MeeGo on OMAP4 PandaBoard
 
Qi -- Lightweight Boot Loader Applied in Mobile and Embedded Devices
Qi -- Lightweight Boot Loader Applied in Mobile and Embedded DevicesQi -- Lightweight Boot Loader Applied in Mobile and Embedded Devices
Qi -- Lightweight Boot Loader Applied in Mobile and Embedded Devices
 
MMC Booklet
MMC BookletMMC Booklet
MMC Booklet
 
Aosp+
Aosp+Aosp+
Aosp+
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
Linux SD/MMC device driver
Linux SD/MMC device driverLinux SD/MMC device driver
Linux SD/MMC device driver
 
Digital Tv Overview
Digital Tv OverviewDigital Tv Overview
Digital Tv Overview
 
Embedded Android Workshop with Marshmallow
Embedded Android Workshop with MarshmallowEmbedded Android Workshop with Marshmallow
Embedded Android Workshop with Marshmallow
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
 
Q4.11: Introduction to eMMC
Q4.11: Introduction to eMMCQ4.11: Introduction to eMMC
Q4.11: Introduction to eMMC
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot images
 
Learning android with AOSP
Learning android with AOSPLearning android with AOSP
Learning android with AOSP
 

Similar to Linux-without-a-bootloader

建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card艾鍗科技
 
Raspberry pi on java 20121110
Raspberry pi on java 20121110Raspberry pi on java 20121110
Raspberry pi on java 20121110Masafumi Ohta
 
XT Best Practices
XT Best PracticesXT Best Practices
XT Best PracticesJeff Larkin
 
[05][cuda 및 fermi 최적화 기술] hryu optimization
[05][cuda 및 fermi 최적화 기술] hryu optimization[05][cuda 및 fermi 최적화 기술] hryu optimization
[05][cuda 및 fermi 최적화 기술] hryu optimizationlaparuma
 
BlackHat 2009 - Hacking Zigbee Chips (slides)
BlackHat 2009 - Hacking Zigbee Chips (slides)BlackHat 2009 - Hacking Zigbee Chips (slides)
BlackHat 2009 - Hacking Zigbee Chips (slides)Michael Smith
 
Rtos ameba
Rtos amebaRtos ameba
Rtos amebaJou Neo
 
Bootloader and MMU (english)
Bootloader and MMU (english)Bootloader and MMU (english)
Bootloader and MMU (english)Sneeker Yeh
 
GoSF Jan 2016 - Go Write a Plugin for Snap!
GoSF Jan 2016 - Go Write a Plugin for Snap!GoSF Jan 2016 - Go Write a Plugin for Snap!
GoSF Jan 2016 - Go Write a Plugin for Snap!Matthew Broberg
 
[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practicalMoabi.com
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Jian-Hong Pan
 
Embedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hood
Embedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hoodEmbedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hood
Embedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hoodEmbeddedFest
 
Open Source Data Deduplication
Open Source Data DeduplicationOpen Source Data Deduplication
Open Source Data DeduplicationRedWireServices
 
Enabling POWER 8 advanced features on Linux
Enabling POWER 8 advanced features on LinuxEnabling POWER 8 advanced features on Linux
Enabling POWER 8 advanced features on LinuxSebastien Chabrolles
 
Hardware backdooring is practical : slides
Hardware backdooring is practical : slidesHardware backdooring is practical : slides
Hardware backdooring is practical : slidesMoabi.com
 
Vortex86 Sx Linux How To
Vortex86 Sx Linux How ToVortex86 Sx Linux How To
Vortex86 Sx Linux How ToRogelio Canedo
 

Similar to Linux-without-a-bootloader (20)

建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card
 
Raspberry pi on java 20121110
Raspberry pi on java 20121110Raspberry pi on java 20121110
Raspberry pi on java 20121110
 
XT Best Practices
XT Best PracticesXT Best Practices
XT Best Practices
 
[05][cuda 및 fermi 최적화 기술] hryu optimization
[05][cuda 및 fermi 최적화 기술] hryu optimization[05][cuda 및 fermi 최적화 기술] hryu optimization
[05][cuda 및 fermi 최적화 기술] hryu optimization
 
BeagleBone Black Booting Process
BeagleBone Black Booting ProcessBeagleBone Black Booting Process
BeagleBone Black Booting Process
 
BlackHat 2009 - Hacking Zigbee Chips (slides)
BlackHat 2009 - Hacking Zigbee Chips (slides)BlackHat 2009 - Hacking Zigbee Chips (slides)
BlackHat 2009 - Hacking Zigbee Chips (slides)
 
Rtos ameba
Rtos amebaRtos ameba
Rtos ameba
 
Ubuntu
UbuntuUbuntu
Ubuntu
 
Bootloader and MMU (english)
Bootloader and MMU (english)Bootloader and MMU (english)
Bootloader and MMU (english)
 
GoSF Jan 2016 - Go Write a Plugin for Snap!
GoSF Jan 2016 - Go Write a Plugin for Snap!GoSF Jan 2016 - Go Write a Plugin for Snap!
GoSF Jan 2016 - Go Write a Plugin for Snap!
 
[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical[Defcon] Hardware backdooring is practical
[Defcon] Hardware backdooring is practical
 
Gpu archi
Gpu archiGpu archi
Gpu archi
 
Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021Let's trace Linux Lernel with KGDB @ COSCUP 2021
Let's trace Linux Lernel with KGDB @ COSCUP 2021
 
Ramdisk
RamdiskRamdisk
Ramdisk
 
Embedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hood
Embedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hoodEmbedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hood
Embedded Fest 2019. Игорь Опанюк. Das U-boot v2019: a look under the hood
 
Open Source Data Deduplication
Open Source Data DeduplicationOpen Source Data Deduplication
Open Source Data Deduplication
 
Enabling POWER 8 advanced features on Linux
Enabling POWER 8 advanced features on LinuxEnabling POWER 8 advanced features on Linux
Enabling POWER 8 advanced features on Linux
 
App container rkt
App container rktApp container rkt
App container rkt
 
Hardware backdooring is practical : slides
Hardware backdooring is practical : slidesHardware backdooring is practical : slides
Hardware backdooring is practical : slides
 
Vortex86 Sx Linux How To
Vortex86 Sx Linux How ToVortex86 Sx Linux How To
Vortex86 Sx Linux How To
 

Recently uploaded

Manipur-Book-Final-2-compressed.pdfsal'rpk
Manipur-Book-Final-2-compressed.pdfsal'rpkManipur-Book-Final-2-compressed.pdfsal'rpk
Manipur-Book-Final-2-compressed.pdfsal'rpkbhavenpr
 
Brief biography of Julius Robert Oppenheimer
Brief biography of Julius Robert OppenheimerBrief biography of Julius Robert Oppenheimer
Brief biography of Julius Robert OppenheimerOmarCabrera39
 
57 Bidens Annihilation Nation Policy.pdf
57 Bidens Annihilation Nation Policy.pdf57 Bidens Annihilation Nation Policy.pdf
57 Bidens Annihilation Nation Policy.pdfGerald Furnkranz
 
Rohan Jaitley: Central Gov't Standing Counsel for Justice
Rohan Jaitley: Central Gov't Standing Counsel for JusticeRohan Jaitley: Central Gov't Standing Counsel for Justice
Rohan Jaitley: Central Gov't Standing Counsel for JusticeAbdulGhani778830
 
complaint-ECI-PM-media-1-Chandru.pdfra;;prfk
complaint-ECI-PM-media-1-Chandru.pdfra;;prfkcomplaint-ECI-PM-media-1-Chandru.pdfra;;prfk
complaint-ECI-PM-media-1-Chandru.pdfra;;prfkbhavenpr
 
VIP Girls Available Call or WhatsApp 9711199012
VIP Girls Available Call or WhatsApp 9711199012VIP Girls Available Call or WhatsApp 9711199012
VIP Girls Available Call or WhatsApp 9711199012ankitnayak356677
 
Quiz for Heritage Indian including all the rounds
Quiz for Heritage Indian including all the roundsQuiz for Heritage Indian including all the rounds
Quiz for Heritage Indian including all the roundsnaxymaxyy
 
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victory
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep VictoryAP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victory
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victoryanjanibaddipudi1
 
Referendum Party 2024 Election Manifesto
Referendum Party 2024 Election ManifestoReferendum Party 2024 Election Manifesto
Referendum Party 2024 Election ManifestoSABC News
 
IndiaWest: Your Trusted Source for Today's Global News
IndiaWest: Your Trusted Source for Today's Global NewsIndiaWest: Your Trusted Source for Today's Global News
IndiaWest: Your Trusted Source for Today's Global NewsIndiaWest2
 
Global Terrorism and its types and prevention ppt.
Global Terrorism and its types and prevention ppt.Global Terrorism and its types and prevention ppt.
Global Terrorism and its types and prevention ppt.NaveedKhaskheli1
 
Top 10 Wealthiest People In The World.pdf
Top 10 Wealthiest People In The World.pdfTop 10 Wealthiest People In The World.pdf
Top 10 Wealthiest People In The World.pdfauroraaudrey4826
 
Opportunities, challenges, and power of media and information
Opportunities, challenges, and power of media and informationOpportunities, challenges, and power of media and information
Opportunities, challenges, and power of media and informationReyMonsales
 

Recently uploaded (13)

Manipur-Book-Final-2-compressed.pdfsal'rpk
Manipur-Book-Final-2-compressed.pdfsal'rpkManipur-Book-Final-2-compressed.pdfsal'rpk
Manipur-Book-Final-2-compressed.pdfsal'rpk
 
Brief biography of Julius Robert Oppenheimer
Brief biography of Julius Robert OppenheimerBrief biography of Julius Robert Oppenheimer
Brief biography of Julius Robert Oppenheimer
 
57 Bidens Annihilation Nation Policy.pdf
57 Bidens Annihilation Nation Policy.pdf57 Bidens Annihilation Nation Policy.pdf
57 Bidens Annihilation Nation Policy.pdf
 
Rohan Jaitley: Central Gov't Standing Counsel for Justice
Rohan Jaitley: Central Gov't Standing Counsel for JusticeRohan Jaitley: Central Gov't Standing Counsel for Justice
Rohan Jaitley: Central Gov't Standing Counsel for Justice
 
complaint-ECI-PM-media-1-Chandru.pdfra;;prfk
complaint-ECI-PM-media-1-Chandru.pdfra;;prfkcomplaint-ECI-PM-media-1-Chandru.pdfra;;prfk
complaint-ECI-PM-media-1-Chandru.pdfra;;prfk
 
VIP Girls Available Call or WhatsApp 9711199012
VIP Girls Available Call or WhatsApp 9711199012VIP Girls Available Call or WhatsApp 9711199012
VIP Girls Available Call or WhatsApp 9711199012
 
Quiz for Heritage Indian including all the rounds
Quiz for Heritage Indian including all the roundsQuiz for Heritage Indian including all the rounds
Quiz for Heritage Indian including all the rounds
 
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victory
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep VictoryAP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victory
AP Election Survey 2024: TDP-Janasena-BJP Alliance Set To Sweep Victory
 
Referendum Party 2024 Election Manifesto
Referendum Party 2024 Election ManifestoReferendum Party 2024 Election Manifesto
Referendum Party 2024 Election Manifesto
 
IndiaWest: Your Trusted Source for Today's Global News
IndiaWest: Your Trusted Source for Today's Global NewsIndiaWest: Your Trusted Source for Today's Global News
IndiaWest: Your Trusted Source for Today's Global News
 
Global Terrorism and its types and prevention ppt.
Global Terrorism and its types and prevention ppt.Global Terrorism and its types and prevention ppt.
Global Terrorism and its types and prevention ppt.
 
Top 10 Wealthiest People In The World.pdf
Top 10 Wealthiest People In The World.pdfTop 10 Wealthiest People In The World.pdf
Top 10 Wealthiest People In The World.pdf
 
Opportunities, challenges, and power of media and information
Opportunities, challenges, and power of media and informationOpportunities, challenges, and power of media and information
Opportunities, challenges, and power of media and information
 

Linux-without-a-bootloader

  • 1. Linux without a boot loader – the OMAP way! OR Why I stopped being scared of X- loader and started using Linux Nishanth Menon 25 August 2010
  • 2. Introduction  Why do we need a bootloader?  Too many bootloaders, yet, not one that works for me..  Heresy: What if Linux is used as a bootloader?  A single s/w package- Reduce maintenance.  New features – easier to borrow from Linux  It'd be kinda fun  Builds on ELC2010 SFO Greg Ungerer, Magnus Damm 's work 2/
  • 3. Agenda 1/2  Concepts of OMAP GP device boot load process  Why x-loader?  Content of a Linux image without bootloader  The tools  Tagger  Gpsign  Demo 3/
  • 4. Agenda 2/2  What next? Using Linux as a bootloader  Problems with the Approach  Summary  Terminology  References 4/
  • 5. Concepts of OMAP boot load process X-loader U-Boot Kernel I/O device (Nand/MMC) U-Boot Kernel ROM Code “XIP” Memory mapped device(NOR) ROM ROM Peripheral 2nd U-Boot Kernel (USB/UART) SDRAM NOR SRAM SDRAM NOR SRAM Scope of this presentation 5/
  • 6. Why X-loader?  SRAM is tiny: 64K(OMAP3 GP), 32K(OMAP4)  “Traditional Bootloaders” are bloated!– e.g.  U-boot: beagleboard build is 196K!!  Barebox: first beagleboard version of barebox was 36k, it is around 40+k now!  There is never going to be a solution as long as we need to keep adding new features! 6/
  • 7. What I love about X-loader  “shared code” with TI u-boot  Does the stuff (well.. mostly)  Simple code (usually!)  TINY.. well.. mostly so, until we started adding FAT, MMC, USB...  TI mostly has some variant for every OMAP 7/
  • 8. What I hate about X-loader  It does way more than what it needs to do the job - “load and execute u-boot”  There is NO mainline x-loader code  Toooo many variants of x-loader.. There is a broken up community of x-loader – each centered around some silicon variant  I am gonna stop now.. 8/
  • 9. Do I REALLY need x-loader? NO There are alternatives: Psuedocode: Switch cpsr to svc Disable watchdog  Barebox? Enable uart Copy image from x to sdram  my_own_stupid_bootloader.s Give control to image  Linux? But it is 3 megs big!!  Soln: Load it to SDRAM directly 9/
  • 10. Basic things for Linux to boot on OMAP?  Basic h/w configuration:  Make the SDRAM ready – clocks configured  Very basic mux – we expect the kernel to take care of it's own needs..  One serial port configured  Setup ATAGs as required for any Linux port of ARM to boot  Load the kernel up in SDRAM Ref: http://www.arm.linux.org.uk/developer/booting.php 10 /
  • 11. Linux image without bootloader Load address, size gpsign gpsign Boot Configuration Header Header Disable watchdog Disable watchdog Configure one uart Configure one uart Sty Setup Setup tagger tagger r0 ==00 r0 r1 ==mach ID r1 mach ID r2 ==ATAG address r2 ATAG address bzImage piggy make bzImage make bzImage zImage 11 /
  • 12. How does tagger work? Sty tagger tagger ATAG bzImage Sty template Config file Config file bzImage bzImage -tags -tags - -machid Marker: machid Size Marker: MACHID 12 /
  • 13. Sty in the works 1 – the setup Disable WDT Sty Cache, int disable ATAG 2 – hand Setup over to UART piggy piggy Setup Uart mux 4- give 3- control to zImage uncompres kernel Relocate atag to s the real First 16k memory image Uncompressed kernel 13 /
  • 14. GP Sign – Boot Header Load address Size of image Clock configuration gpsign gpsign DDR configuration GPMC CS0 configuration Config file Config file MMC image image - -clock config clock config configuration - -ddr config ddr config Configuration Header image 14 /
  • 15. How does this GP image boot? Load address OMAP Size of image 2 OMAP Figures out RomCode Clock where to configuration load DDR configuration 1 3- DPLLs Configures Loads GPMC CS0 clocks image configuration 4 – gives control MMC configuration Configuration Header SDRAM SDRAM image There is more that happens in HS/EMU device.. 15 /
  • 16. Demo 16 /
  • 17. Next steps 1/2: optimize  Choose a sane kernel configuration for the environment you'd like to work on  If your board has ethernet, enable ethernet, use nfs as rootfs  If you board has usb, you may want to try out usbnet  Reduce statically built kernel drivers and have only the kernel modules you need (if you dont care for multimedia in your bootloader, why have dspbridge, audio drivers enabled?) 17 /
  • 18. Next steps 2/2: power features  Write your own custom shell scripts if your “users” are interested in “u-boot like” environment, -e.g. setenv/saveenv pair could be: setenv() { x=$1;shift;export $x="$*";} saveenv() { export>/etc/exported_vars;} and the /etc/profile file uses that file..  Use kexec! With kexec you get bootm equivalent.  You can wrap kexec inside a bootm as well.  Remember you now have the power to do what you can imagine without thinking how to port it.. 18 /
  • 19. Ok, so what's the catch? (1/2)  Deployment issues  Single bootimage requirement for multiple board variants and (clocks sdrc, machid are all coded in),  Training new users and re-training old users?  NAND technology and badblocks → with large uImage, any bad block can make the image no longer usable.. but we can debate that at a later date ;) 19 /
  • 20. Ok, so what's the catch? (2/2)  “MLO file” MMC with FAT partition on OMAP3 has limitations of 128k sized image(so not kernel or u-boot at least :(), but it will become usable with OMAP4 -are there options? Probably (see references)  So now we need to maintain and test kernel in two defconfig configurations? - yeah maybe.. 20 /
  • 21. Summary  Linux without a bootloader provides a lot of flexibilities  There are limitations as well – wont solve everyone's problems.  Could be suited in a single platform environment  Not really hardcore tested solution beyond “lab environment” 21 /
  • 22. Terminology  XIP – Execute in Place  U-Boot – Das U-Boot – the Universal Boot loader  X-loader – TI variant of U-Boot. A stripped down version  Barebox – Somewhere between Linux and U- boot – can also be used as a boot loader  Busybox – a filesystem with tiny versions of standard unix utils  OMAP-Uboot-utils – a bunch of utilities to do the grunt workof this presentation 22 /
  • 23. References  ARM linux kernel boot requirements: http://www.arm.linux.org.uk/developer/booting.php  ELC2010 work (SFO)  Greg Ungerer: Linux without a bootloader http://elinux.org/images/7/7b/LinuxWithoutABootLoader.pdf  Magnus Damm: Linux as a bootloader http://elinux.org/images/2/2f/ELC-2010-Damm-Kexec.pdf  Grant Likely: Device tree support http://elinux.org/images/b/b6/ARM_Device_Tree_Status_Report.pdf  Ghorai Sukumar: eMMC boot http://omapedia.org/wiki/E-MMC_boot#You_can_boot_omap3630_without_x-loader  Kexec: http://www.ibm.com/developerworks/linux/library/l-kexec.html  Omap u-boot utils: http://code.google.com/p/omap-u-boot-utils/ 23 /
  • 24. Backup  Reference code: http://github.com/nmenon/uomapfs branch: ldemo  You get kexec, linux-omap omap-uboot-fs and a bunch of reference configuration files for SDP3630 which can be easily customized and improved for development platforms. 24 /