1 Booting Linux with U-boot Jason Kridner June 7, 2010 Archived at:

Slides:



Advertisements
Similar presentations
TI Information – Selective Disclosure Boot TI Keystone II Linux Kernel (UBI File-system) Vincent Han Mar,
Advertisements

Chapter 9: Understanding System Initialization The Complete Guide To Linux System Administration.
Giving Linux the Boot This session covers all facets of the Linux boot process from power up to running a user application beginning with ROM boot loader.
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Lab4 - Bootloader 2014/10/14/ 13 1.
SAM9263-EK RevB WinCE 6.0 DEMO (All-in-NAND) AT91 SAM9 Product Group. Version 1.1 May 2008.
GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi.
Lesson 22 – Introduction to Linux Systems Administration.
CCNA Guide to Cisco Networking Fundamentals Fourth Edition
System Startup and Shutdown
Beagle Board 101 Gerald Coley and Jason Kridner September 22, 2009
Linux-MVME Targets Using Motorola Board Support
COMPUTER SYSTEM LABORATORY Lab8 - Debugging II. Lab 8 Experimental Goal Learn how to debug Linux in source-level by Domingo and diagnose target boards.
DELTA TAU Data Systems, Inc. 1 UMAC TurboTurbo PMAC PCIGeo Drive Single Source Machine Control motion logic data Power PMAC as a Linux Computer January.
Spring 2014 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
1 © 2002, Cisco Systems, Inc. All rights reserved. Router boot procedure.
COMPUTER SYSTEM LABORATORY Lab4 - Bootloader. Lab 4 Experimental Goal Learn how to build U-Boot bootloader for PXA /10/8/ 142.
Introduction to The Linaro Toolchain Embedded Processors Training Multicore Software Applications Literature Number: SPRPXXX 1.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
IOS Upgrade using Cisco Universal Serial Bus (USB) Card.
AT91SAM9261-EK WinCE 6.0 DEMO ATMEL AT91 Application & Support Group
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
1 Embedded Linux porting Speaker: Yi-Ji Jheng Date:
Embedded Linux porting Kernel
AT91SAM9261-EK WinCE 5.0 DEMO ATMEL AT91 Application & Support Group Version 1.O February 2007.
Porting Android to Beagleboard
Beagle Board Fast Boot Hui Chen Keji Ren Dec 10 th, 2009 EE382N-4 Project.
©SIProp Project, Boot File of Pandaboard Noritsuna Imamura
Installation Overview Lab#2 1Hanin Abdulrahman. Installing Ubuntu Linux is the process of copying operating system files from a CD, DVD, or USB flash.
Ericsson-LG Enterprise Proprietary | | Page 1 Slide title 30 pt Text and bullet level 1 minimum 24 pt Bullets level 2-5 minimum 20 pt Do not.
Linux+ Guide to Linux Certification, Third Edition
COMPUTER SYSTEM LABORATORY Lab6 - Root Filesystem.
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
1 © 2003, Cisco Systems, Inc. All rights reserved. CCNA 2 Module 2 Introduction to Routers.
Business Enabled Communications
SAM9260-EK WinCE DEMO AT91 SAM9 Product Group. Version 1.0 October 2006.
7200 Samsung Confidential & Proprietary Information Copyright 2006, All Rights Reserved. 1/16 OfficeServ 7200 Enterprise IP Solutions Data Server S/W Upgrade.
TI Information – Selective Disclosure Boot TI Keystone II Linux Kernel (RAM File-system) Vincent Han Mar,
SAM9260-EK WinCE DEMO AT91 SAM9 Product Group. Version 1.0 October 2006.
RT-LAB Electrical Applications 1 Opal-RT Technologies Use of the “Store Embedded” mode Solution RT-LAB for PC-104.
CCNA2 Chapter 2 Cisco IOS Software. Cisco’s operating system is called Cisco Internetwork Operating System (IOS) IOS provides the following network services:
7200 Samsung Confidential & Proprietary Information Copyright 2006, All Rights Reserved. 1/7 OfficeServ 7200 Enterprise IP Solutions Data Server S/W Upgrade.
© 2006 Cisco Systems, Inc. All rights reserved.Cisco PublicITE I Chapter 6 1 Router Initialization steps.
Linux Development Lecture 7. Schedule Linux Root Filesystem.
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 – Bootloader + OS Kernel 2015/10/27/ 25 1.
Lab 8 Department of Computer Science and Information Engineering National Taiwan University Lab8 - Root Filesystem 2015/11/10/ 22 1.
Implementation of Embedded OS
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 - OS Kernel 2014/10/21/ 16 1.
Implementation Method Linux-USB Gadget Framework –The Linux-USB Gadget Framework makes it easy for peripherals and other devices embedding GNU/Linux system.
Embedded Software Design Week II Linux Intro Linux Kernel.
The World Leader in High Performance Signal Processing Solutions Das U-Boot: Blackfin Guts.
Chap. 4 ARM Boot Loader Internals. 2 S3C2500 ARM940T Core module ARM9TDMI CoreIC.
U-Boot CS-423 Dick Steflik. U-Boot Actual Name: Das U-Boot Universal Bootstrap Loader Used on PPC, ARM, AVR32, MIPS, x86, 68K, Nios and MicroBlaze architectures.
Pats Embedded Linux Seminar (PELS) Session 2 Wim Torfs University of Antwerp PATS research group.
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com The U-boot bootloader Michael.
By Ganesan Alagu Ganesh Feb 26, 2008
Implementation of Embedded OS
Guide to Linux Installation and Administration, 2e
Computer System Laboratory
Download Image to EVB Board and Flash Programming
By Ganesan Alagu Ganesh Feb 21, 2008
ELG) System Develop. Team
Implementation of Embedded OS
AVR32 UC3 EVK1100 Control Panel Tutorial
CONFIGURING HARDWARE DEVICE & START UP PROCESS
AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.
SUSE Linux Enterprise Desktop Administration
Computer System Laboratory
Lecture9: Embedded Network Operating System: cisco IOS
Computer System Laboratory
Presentation transcript:

1 Booting Linux with U-boot Jason Kridner June 7, 2010 Archived at:

The five (5) boot phases 1. ROM loads x-load (MLO) 2. X-load loads u-boot 3. U-boot reads commands 4. Commands load kernel 5. Kernel reads root file system 2

(1) ROM loads x-load (MLO) ROM attempts to load boot image ◦ Sequence of attempts depends if USER button pressed For MMC/SD boot ◦ Must have 255 heads and 63 sectors/track ◦ First partition is FAT and bootable ◦ Must have “MLO” as first file and directory entry  “MLO” is x-load.bin.ift renamed ◦ Use mkcard.sh X-load image must be “signed” ◦ signGP app is open source There are utilities for USB and serial boot ◦ 3

(2) X-load loads u-boot X-load is a utility derived from u-boot ◦ Small enough to fit in internal RAM ◦ Configures external RAM  Could otherwise be done in configuration header, but doesn’t allow for multiple memory types Looks first on MMC/SD ◦ If it finds u-boot.bin, loads and runs it 4

(3) U-boot reads commands U-boot version allows interaction over the serial and USB ports ◦ Serial cable provided in case you have a laptop ◦ USB driver looks like a USB-to-serial converter device ◦ Use gserial.inf to install a driver in Windows U-boot environment variables read from flash ◦ Stored in the third flash partition (mtd2) ◦ ‘bootcmd’ variable stores the commands to execute ◦ ‘bootdelay’ is number of seconds to allow interruption of the boot Default ‘bootcmd’ reads ‘boot.scr’ auto-script 5

(4) Commands load kernel U-boot loads kernel and passes it ‘bootargs’ ◦ Default environment is used when variables haven’t been stored in flash  Rev C boards are shipped without variables stored in flash ◦ Console can be used to interrupt the boot process and modify variables  The Rev B u-boot only supported the console over the serial port  The Rev C u-boot adds support for the console over the USB OTG port  Future modifications may support USB keyboard/mouse and DVI-D monitor ◦ Fourth flash partition (mtd3) is reserved for the kernel bootm – executes kernel from RAM 6

Default bootcmd for Rev C bootcmd= if mmcinit; then if run loadbootscript; then run bootscript; else if run loaduimage; then if run loadramdisk; then run ramboot; else run mmcboot; fi; else run nandboot; fi; fi; else run nandboot; fi 7

Default bootcmd for xM Rev A if mmc init ${mmcdev}; then if userbutton; then setenv bootscr boot.scr; else setenv bootscr user.scr; fi if run loadbootscript; then run bootscript; else if run loaduimage; then if run loadramdisk; then run ramboot; else run mmcboot; fi; else run nandboot; fi; else run nandboot; fi 8

U-boot command summary Basic commands ◦ help – provide the list of commands (varies by build) ◦ printenv – lists the contents of the current environment ◦ saveenv – writes the current environment to the flash ◦ setenv ‘string’ – sets environment variable ◦ autoscr – run script from RAM MMC/SD ◦ mmcinit – initializes the MMC/SD card ◦ fatls mmc 0 – reads FAT directory on the first partition ◦ fatload mmc 0 – load a file into RAM NAND ◦ nand unlock – enables writing to the NAND ◦ nandecc – configures ECC mode (OMAP3 specific) ◦ nand erase – erases portion of NAND flash ◦ nand read – reads into RAM ◦ nand write – writes from RAM Serial ◦ loadb – reads into RAM via kermit file send 9

(5) Kernel reads root file system Kernel mounts root file system based on ‘bootargs’ ◦ NAND (JFFS2): root=/dev/mtdblock4 rw rootfstype=jffs2 ◦ RAMDISK: root=/dev/ram0 rw ramdisk_size=32768 initrd=0x ,32M ◦ MMC/SD: root=/dev/mmcblk0p2 rw rootwait ◦ NFS: root=/dev/nfs rw nfsroot= :/data/target ip= :: nolock,rsize=1024,wsize=1024 rootdelay=2 10

Configuring the display video=omapfb vram=10M omap-dss.def_disp=lcd omapfb.vram=4M,3M,3M omapfb.video_mode=1024x768MR- 11

Other bootargs nohz=off ◦ Power management (dynamic tick) mem=88M ◦ Reserve memory 12

Writing our own boot script 13

Build u-boot and mkimage cd ~/u-boot-omap3 make omap3_beagle_config make 14 For the xM demo image, look in /usr/share/esc-training/u- boot

Build my.scr cd ~/u-boot-omap3 cp /media/mmcblk0p1/menu/kridner.script my.script nano my.script./tools/mkimage -A arm -T script -C none -d my.script my.scr Be very careful before executing the next step ◦ cp my.scr /media/mmcblk0p1/boot.scr ◦ If unsure, run /switchboot now ◦ boot 15 These instructions are not for the xM demo image, instead look at /boot/u-boot-scripts

Edit environment in flash make env nano /etc/fw_env.config ◦ /dev/mtd2 0 0x x20000./tools/env/fw_printenv ln -s tools/env/fw_printenv fw_setenv./fw_setenv usbtty ‘cdc_acm’./fw_setenv stdout ‘serial,usbtty’./fw_setenv stdin ‘serial,usbtty’./fw_setenv stderr ‘serial,usbtty’./tools/env/fw_printenv 16 These instructions are not for the xM

Trying usbtty cp ~/gserial.inf /media/mmcblk0p1/ halt Remove power and SD card Copy gserial.inf from SD to PC Plug USB from Beagle to your PC ◦ Select driver Start Hyperterminal ◦ Newest serial port, max baud, n81, no flow Optional ◦ nand erase 0x x These instructions are not for the xM

Creating a ramdisk.gz dd if=/dev/zero of=ramdisk bs=1k count=32768 mkfs.ext2 ramdisk mount -o loop ramdisk /mnt tar -xvjf fs.tar.bz2 -C /mnt ◦ Other methods to copy may be fine umount /mnt gzip ramdisk 18