SlideShare uma empresa Scribd logo
1 de 30
Baixar para ler offline
Embedded Linux Boot Process
General Booting
ROM code X - Loader U - Boot Kernel
Internal ROM Internal SRAM External DDR External DDR
Booting Process
● X – loader :
– Basic hardware init (GPIO, clock, SDRAM, etc)
– Load and start u-boot
● U – boot :
– Hardware initializations
– Load and start kernel
● Kernel :
– Drivers initializations
– Mount root file system
● Init :
– First user-space processes
– Launch RC scripts
– Start graphic environment
ROM code
● After a processor is reset, it executes ROM startup
code
● The ROM startup code initializes the cpu, memory
controller and on-chip devices, and it configures the
memory map
● Searches the booting devices for a valid booting
image
● Loads the x-loader into SRAM and executes it
X - loader
● It is first stage boot loader
● It is also called as MLO(Memory LOader)
● Runs in an Internal SRAM
● Initializes clocks and memory
● Loads the second stage boot loader(u-boot) in
SDRAM and executes it
U - boot
● U-boot is Universal boot loader, an open
source boot loader
● Performs some additional platform
initialization
● Sets the boot arguments
● Passes control to the kernel image
Kernel
● Decompress the kernel into SDRAM
● Sets up peripherals, such as LCD, HDMI, I2C,
bus, USB, SD card, audio, etc
● Mounts the root file system that contains all
userspace libraries/applications
● Root file system then executes init process
Booting Techniques
1. Flash Memory
2. EMMc/SD card
3. TFTP/NFS
4. UART/USB
● By default, the ROM code in the Sitara AM3359 will
boot from the MMC1 interface first (the onboard
eMMC), followed by MMC0 (external uSD), UART0
and USB0.
● If the boot switch (S2) is held down during power-up,
the ROM will boot from the SPI0 Interface first,
followed by MMC0 (external uSD), USB0 and UART0.
● This allows the BeagleBone Black to bypass the
onboard eMMC and boot from the removable uSD
(provided no valid boot device is found on SPI0.) This
can be used to recover from a corrupted onboard
eMMC/U-Boot.
Booting from flash:
● Since default boot is from nand flash, nothing
to be done by us for booting from flash.
● Connect usb-to-serial convertor from board to
pc for console (“minicom”).
● Power the board with usb cable, now the board
automatically boots from flash and it will ask
for login, use “root” it will not ask password
for root. Now you will be getting beaglebone
login prompt.
Recovering flash memory:
● By default it will boot from flash memory.
● If it is not booted, here are steps to boot from
flash
● Unable to boot from flash memory then :
copy beaglebone image to sd card using:
● Insert sd card to board, holding down user
boot button power up the board and wait until
you see the user leds on, now release boot
button
sudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdbsudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdbsudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdbsudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdbsudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdbsudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdbsudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdbsudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdb
● Login : root
● U get this prompt as below
– root@beagleBone:~#
– In that use this command
vi /boot/uEnv.txt
In this file, you find last line was commented.
Release that comment and save the file
● Then remove sd card and boot
● It will boot from flash memory
● After booting from flash:
Booting from uSD card:
● To boot from uSD card, first we have to
copy bootloaders and rootfilesystem to
uSD card.
● Before you do copy, we have to partition
the uSD card
1. FAT filesystem and Bootable
2.Linux filesystem
● After Partitioning the SD card, it will be like this :
Disk /dev/sdb: 7.4 GiB, 7948206080 bytes, 15523840 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 198655 196608 96M e W95 FAT16
(LBA)
/dev/sdb2 198656 7577599 7378944 3.5G 83 Linux
● After partioning, create file system on newly
created partitions using commands:
1. sudo mkfs.vfat -F 32 /dev/sdb1 -n boot
2. sudo mke2fs -L RootFs /dev/sdb2
● Copy files to partions Boot and RootFs:
– MLO, u-boot.img, user.txt, uEnv.txt, .dtb files to
Boot
– RootFs.xz to RootFs (extract after copying to sd
card)
● Insert SD card to board for booting
● To boot from uSD card, hold down the user boot
button and power up the board
Demo of Stage by Stage booting
● First copy the MLO source code to sd card and
insert to board
● Boot from sd card
● ROM code finds the MLO in sd card and starts
booting
● MLO searches for u-boot.img and there is no
u-boot.img
● It throws an error message as “error reading
u-boot.img”
MLO
U - boot
● After that copy environment variables and .dtb
file in sd card
● Boot from sd card
● Now u-boot.img find all those files it needed and
boots
● U-boot.img now loads and starts the kernel
● Finally booted from sd card, both login and
password as 'ubuntu'
● Now it is booted and you get prompt like this
ubuntu
● After that copy environment variables and .dtb
file in sd card
● Boot from sd card
● Now u-boot.img find all those files it needed
and boots
● U-boot.img now loads and starts the kernel
● Finally booted from sd card, both login and
password as 'ubuntu'
● Now it is booted and you get prompt like this
ubuntu@ubuntu-armhf:~$
U – boot and kernel
Booting from TFTP server
● Copy the uImage and .dtb files to path: /tftpboot
● We are going to boot u-boot through sd card, so copy those
files in sd card
● Install nfs server
sudo apt-get install rpcbind nfs-kernel-server
● Edit /etc/exports
/home
192.168.0.0/255.255.255.0(rw,sync,no_subtree_check)
/usr/local
192.168.0.0/255.255.255.0(rw,sync,no_subtree_check)
● After editing exports do:
sudo exportfs -ra
● Place the root file system in nfs
● User.txt in sd card contents:
serverip=192.168.1.5
ipaddr=192.168.1.6
nfsargs= setenv bootargs mpurate=${mpurate} console=$
{console} vram=${vram} root=/dev/nfs
nfsroot=192.168.1.5:/home/asvkarthick/workspace/Beagleb
one_black/sysplay/Templates/BootingNfs/NFS,nolock
rootdelay=15 ip=dhcp,rsize=1024,wsize=1024
uenvcmd=run nfsargs;mmc rescan; tftpboot 0x81000000
am335x-boneblack.dtb; tftpboot 0x80200000 uImage;
bootm 0x80200000 - 0x81000000;
● Connect ethernet cable from board to pc
● Start the “minicom”
● Power up the board and before the board get booted, press
enter or any key continously so it will go to u-boot prompt
● Using dhcp command, get server and our ip address
● Set ip address and server ip address
setenv ipaddr 192.168.0.250
setenv serverip 192.168.0.251
● Next load the kernel and device tree blob
tftpboot 0x81000000 am335x-boneblack.dtb
tftpboot 0x80200000 uImage-BBB
● Boot from memory location, it will be booted now:
bootm 0x80200000 - 0x81000000
Booting From UART
● For this boot, flash memory should erased before the boot
● Connect the serial port, start minicom, reset the board, now
it will display
ccccccccccc
● cntrl+A & S, it display 4 options, select xmodem from that
option, select first stage boot loader, then ok. It will copy
this BL to RAM, it will initiate or load DDR.
● Use loadb <addr of DDR> , cntrl+A and S --> kermit, select
MLO again, write to nand flash
nand write <addr of DDR> <MLO offset> <size of MLO>
● Next execute by command:
go <addr of DDR>
● Then, load <addr of DDR> and using kermit mode send u-
boot.img(second stage bootloader), write to nand
nand write <addr of DDR> <u-boot offset> <size of u-
boot.img>
● Next execute by command:
go <addr of DDR>
● Then, load <addr of DDR> and using kermit mode send
kernel (uImage), write to nand
nand write <DDR addr> <kernel offset> <sizeof kernel>
● Next execute by command:
boot
● For every execute command it will run each
stage of bootloader and at last for kernel we
have to use “boot” command for loading
kernel
● Thus now all file got transfered or written to
flash(nand) and booted via serial
Thank You
Presentation by
RASHILA R R
raghupathy.rashila@adeptchips.com

Mais conteúdo relacionado

Mais procurados

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
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)shimosawa
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchlinuxlab_conf
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)RuggedBoardGroup
 
RISC-V Boot Process: One Step at a Time
RISC-V Boot Process: One Step at a TimeRISC-V Boot Process: One Step at a Time
RISC-V Boot Process: One Step at a TimeAtish Patra
 
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
 
LCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLinaro
 
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
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introductionYi-Hsiu Hsu
 
Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)Macpaul Lin
 
linux device driver
linux device driverlinux device driver
linux device driverRahul Batra
 
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewLinux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewRajKumar Rampelli
 
Introduction Linux Device Drivers
Introduction Linux Device DriversIntroduction Linux Device Drivers
Introduction Linux Device DriversNEEVEE Technologies
 
Tuning Android for low RAM
Tuning Android for low RAMTuning Android for low RAM
Tuning Android for low RAMChris Simmonds
 

Mais procurados (20)

U boot-boot-flow
U boot-boot-flowU boot-boot-flow
U boot-boot-flow
 
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
 
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
RISC-V Boot Process: One Step at a Time
RISC-V Boot Process: One Step at a TimeRISC-V Boot Process: One Step at a Time
RISC-V Boot Process: One Step at a Time
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
A practical guide to buildroot
A practical guide to buildrootA practical guide to buildroot
A practical guide to buildroot
 
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
 
LCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted FirmwareLCU13: An Introduction to ARM Trusted Firmware
LCU13: An Introduction to ARM Trusted Firmware
 
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
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introduction
 
Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)
 
BeagleBone Black Bootloaders
BeagleBone Black BootloadersBeagleBone Black Bootloaders
BeagleBone Black Bootloaders
 
linux device driver
linux device driverlinux device driver
linux device driver
 
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewLinux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
 
Introduction Linux Device Drivers
Introduction Linux Device DriversIntroduction Linux Device Drivers
Introduction Linux Device Drivers
 
BusyBox for Embedded Linux
BusyBox for Embedded LinuxBusyBox for Embedded Linux
BusyBox for Embedded Linux
 
Tuning Android for low RAM
Tuning Android for low RAMTuning Android for low RAM
Tuning Android for low RAM
 

Semelhante a Embedded_Linux_Booting

建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card艾鍗科技
 
Kernel entrance to-geek-
Kernel entrance to-geek-Kernel entrance to-geek-
Kernel entrance to-geek-mao999
 
Linux: the first second
Linux: the first secondLinux: the first second
Linux: the first secondAlison Chaiken
 
HKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case studyHKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case studyLinaro
 
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
 
Когда предрелизный не только софт
Когда предрелизный не только софтКогда предрелизный не только софт
Когда предрелизный не только софтCEE-SEC(R)
 
Grub and dracut ii
Grub and dracut iiGrub and dracut ii
Grub and dracut iiplarsen67
 
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
 
Open Enea Linux workshop at the Embedded Conference Scandinavia 2014
Open Enea Linux workshop at the Embedded Conference Scandinavia 2014Open Enea Linux workshop at the Embedded Conference Scandinavia 2014
Open Enea Linux workshop at the Embedded Conference Scandinavia 2014EneaSoftware
 
Bsdtw17: ruslan bukin: free bsd/risc-v and device drivers
Bsdtw17: ruslan bukin: free bsd/risc-v and device driversBsdtw17: ruslan bukin: free bsd/risc-v and device drivers
Bsdtw17: ruslan bukin: free bsd/risc-v and device driversScott Tsai
 
How To Setup NVIDIA CUDA Drvier on Ubuntu
How To Setup NVIDIA CUDA Drvier on UbuntuHow To Setup NVIDIA CUDA Drvier on Ubuntu
How To Setup NVIDIA CUDA Drvier on UbuntuSEUNGWOO LEE
 
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...Ron Munitz
 
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
 
Starting Raspberry Pi
Starting Raspberry PiStarting Raspberry Pi
Starting Raspberry PiLloydMoore
 
Linux: the first second
Linux: the first secondLinux: the first second
Linux: the first secondAlison Chaiken
 

Semelhante a Embedded_Linux_Booting (20)

建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card建構嵌入式Linux系統於SD Card
建構嵌入式Linux系統於SD Card
 
Kernel entrance to-geek-
Kernel entrance to-geek-Kernel entrance to-geek-
Kernel entrance to-geek-
 
How to build and load linux to embedded system
How to build and load linux to embedded systemHow to build and load linux to embedded system
How to build and load linux to embedded system
 
Linux: the first second
Linux: the first secondLinux: the first second
Linux: the first second
 
Ramdisk
RamdiskRamdisk
Ramdisk
 
HKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case studyHKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case study
 
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
 
Understanding The Boot Process
Understanding The Boot ProcessUnderstanding The Boot Process
Understanding The Boot Process
 
Когда предрелизный не только софт
Когда предрелизный не только софтКогда предрелизный не только софт
Когда предрелизный не только софт
 
Grub and dracut ii
Grub and dracut iiGrub and dracut ii
Grub and dracut ii
 
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
 
Open Enea Linux workshop at the Embedded Conference Scandinavia 2014
Open Enea Linux workshop at the Embedded Conference Scandinavia 2014Open Enea Linux workshop at the Embedded Conference Scandinavia 2014
Open Enea Linux workshop at the Embedded Conference Scandinavia 2014
 
Bsdtw17: ruslan bukin: free bsd/risc-v and device drivers
Bsdtw17: ruslan bukin: free bsd/risc-v and device driversBsdtw17: ruslan bukin: free bsd/risc-v and device drivers
Bsdtw17: ruslan bukin: free bsd/risc-v and device drivers
 
Uclinux
UclinuxUclinux
Uclinux
 
How To Setup NVIDIA CUDA Drvier on Ubuntu
How To Setup NVIDIA CUDA Drvier on UbuntuHow To Setup NVIDIA CUDA Drvier on Ubuntu
How To Setup NVIDIA CUDA Drvier on Ubuntu
 
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
Bringing up Android on your favorite X86 Workstation or VM (AnDevCon Boston, ...
 
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
 
Starting Raspberry Pi
Starting Raspberry PiStarting Raspberry Pi
Starting Raspberry Pi
 
RamDisk
RamDiskRamDisk
RamDisk
 
Linux: the first second
Linux: the first secondLinux: the first second
Linux: the first second
 

Embedded_Linux_Booting

  • 2. General Booting ROM code X - Loader U - Boot Kernel Internal ROM Internal SRAM External DDR External DDR
  • 3. Booting Process ● X – loader : – Basic hardware init (GPIO, clock, SDRAM, etc) – Load and start u-boot ● U – boot : – Hardware initializations – Load and start kernel ● Kernel : – Drivers initializations – Mount root file system ● Init : – First user-space processes – Launch RC scripts – Start graphic environment
  • 4. ROM code ● After a processor is reset, it executes ROM startup code ● The ROM startup code initializes the cpu, memory controller and on-chip devices, and it configures the memory map ● Searches the booting devices for a valid booting image ● Loads the x-loader into SRAM and executes it
  • 5. X - loader ● It is first stage boot loader ● It is also called as MLO(Memory LOader) ● Runs in an Internal SRAM ● Initializes clocks and memory ● Loads the second stage boot loader(u-boot) in SDRAM and executes it
  • 6. U - boot ● U-boot is Universal boot loader, an open source boot loader ● Performs some additional platform initialization ● Sets the boot arguments ● Passes control to the kernel image
  • 7. Kernel ● Decompress the kernel into SDRAM ● Sets up peripherals, such as LCD, HDMI, I2C, bus, USB, SD card, audio, etc ● Mounts the root file system that contains all userspace libraries/applications ● Root file system then executes init process
  • 8. Booting Techniques 1. Flash Memory 2. EMMc/SD card 3. TFTP/NFS 4. UART/USB
  • 9. ● By default, the ROM code in the Sitara AM3359 will boot from the MMC1 interface first (the onboard eMMC), followed by MMC0 (external uSD), UART0 and USB0. ● If the boot switch (S2) is held down during power-up, the ROM will boot from the SPI0 Interface first, followed by MMC0 (external uSD), USB0 and UART0. ● This allows the BeagleBone Black to bypass the onboard eMMC and boot from the removable uSD (provided no valid boot device is found on SPI0.) This can be used to recover from a corrupted onboard eMMC/U-Boot.
  • 10. Booting from flash: ● Since default boot is from nand flash, nothing to be done by us for booting from flash. ● Connect usb-to-serial convertor from board to pc for console (“minicom”). ● Power the board with usb cable, now the board automatically boots from flash and it will ask for login, use “root” it will not ask password for root. Now you will be getting beaglebone login prompt.
  • 11. Recovering flash memory: ● By default it will boot from flash memory. ● If it is not booted, here are steps to boot from flash ● Unable to boot from flash memory then : copy beaglebone image to sd card using: ● Insert sd card to board, holding down user boot button power up the board and wait until you see the user leds on, now release boot button sudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdbsudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdbsudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdbsudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdbsudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdbsudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdbsudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdbsudo dd if=bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img of=/dev/sdb
  • 12. ● Login : root ● U get this prompt as below – root@beagleBone:~# – In that use this command vi /boot/uEnv.txt In this file, you find last line was commented. Release that comment and save the file ● Then remove sd card and boot ● It will boot from flash memory
  • 13. ● After booting from flash:
  • 14. Booting from uSD card: ● To boot from uSD card, first we have to copy bootloaders and rootfilesystem to uSD card. ● Before you do copy, we have to partition the uSD card 1. FAT filesystem and Bootable 2.Linux filesystem
  • 15. ● After Partitioning the SD card, it will be like this : Disk /dev/sdb: 7.4 GiB, 7948206080 bytes, 15523840 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x00000000 Device Boot Start End Sectors Size Id Type /dev/sdb1 * 2048 198655 196608 96M e W95 FAT16 (LBA) /dev/sdb2 198656 7577599 7378944 3.5G 83 Linux
  • 16. ● After partioning, create file system on newly created partitions using commands: 1. sudo mkfs.vfat -F 32 /dev/sdb1 -n boot 2. sudo mke2fs -L RootFs /dev/sdb2 ● Copy files to partions Boot and RootFs: – MLO, u-boot.img, user.txt, uEnv.txt, .dtb files to Boot – RootFs.xz to RootFs (extract after copying to sd card) ● Insert SD card to board for booting
  • 17. ● To boot from uSD card, hold down the user boot button and power up the board
  • 18. Demo of Stage by Stage booting ● First copy the MLO source code to sd card and insert to board ● Boot from sd card ● ROM code finds the MLO in sd card and starts booting ● MLO searches for u-boot.img and there is no u-boot.img ● It throws an error message as “error reading u-boot.img”
  • 19. MLO
  • 21. ● After that copy environment variables and .dtb file in sd card ● Boot from sd card ● Now u-boot.img find all those files it needed and boots ● U-boot.img now loads and starts the kernel ● Finally booted from sd card, both login and password as 'ubuntu' ● Now it is booted and you get prompt like this ubuntu
  • 22. ● After that copy environment variables and .dtb file in sd card ● Boot from sd card ● Now u-boot.img find all those files it needed and boots ● U-boot.img now loads and starts the kernel ● Finally booted from sd card, both login and password as 'ubuntu' ● Now it is booted and you get prompt like this ubuntu@ubuntu-armhf:~$
  • 23. U – boot and kernel
  • 24. Booting from TFTP server ● Copy the uImage and .dtb files to path: /tftpboot ● We are going to boot u-boot through sd card, so copy those files in sd card ● Install nfs server sudo apt-get install rpcbind nfs-kernel-server ● Edit /etc/exports /home 192.168.0.0/255.255.255.0(rw,sync,no_subtree_check) /usr/local 192.168.0.0/255.255.255.0(rw,sync,no_subtree_check) ● After editing exports do: sudo exportfs -ra
  • 25. ● Place the root file system in nfs ● User.txt in sd card contents: serverip=192.168.1.5 ipaddr=192.168.1.6 nfsargs= setenv bootargs mpurate=${mpurate} console=$ {console} vram=${vram} root=/dev/nfs nfsroot=192.168.1.5:/home/asvkarthick/workspace/Beagleb one_black/sysplay/Templates/BootingNfs/NFS,nolock rootdelay=15 ip=dhcp,rsize=1024,wsize=1024 uenvcmd=run nfsargs;mmc rescan; tftpboot 0x81000000 am335x-boneblack.dtb; tftpboot 0x80200000 uImage; bootm 0x80200000 - 0x81000000;
  • 26. ● Connect ethernet cable from board to pc ● Start the “minicom” ● Power up the board and before the board get booted, press enter or any key continously so it will go to u-boot prompt ● Using dhcp command, get server and our ip address ● Set ip address and server ip address setenv ipaddr 192.168.0.250 setenv serverip 192.168.0.251 ● Next load the kernel and device tree blob tftpboot 0x81000000 am335x-boneblack.dtb tftpboot 0x80200000 uImage-BBB ● Boot from memory location, it will be booted now: bootm 0x80200000 - 0x81000000
  • 27. Booting From UART ● For this boot, flash memory should erased before the boot ● Connect the serial port, start minicom, reset the board, now it will display ccccccccccc ● cntrl+A & S, it display 4 options, select xmodem from that option, select first stage boot loader, then ok. It will copy this BL to RAM, it will initiate or load DDR. ● Use loadb <addr of DDR> , cntrl+A and S --> kermit, select MLO again, write to nand flash nand write <addr of DDR> <MLO offset> <size of MLO>
  • 28. ● Next execute by command: go <addr of DDR> ● Then, load <addr of DDR> and using kermit mode send u- boot.img(second stage bootloader), write to nand nand write <addr of DDR> <u-boot offset> <size of u- boot.img> ● Next execute by command: go <addr of DDR> ● Then, load <addr of DDR> and using kermit mode send kernel (uImage), write to nand nand write <DDR addr> <kernel offset> <sizeof kernel>
  • 29. ● Next execute by command: boot ● For every execute command it will run each stage of bootloader and at last for kernel we have to use “boot” command for loading kernel ● Thus now all file got transfered or written to flash(nand) and booted via serial
  • 30. Thank You Presentation by RASHILA R R raghupathy.rashila@adeptchips.com