191 Star 1.2K Fork 234

GVP泰晓科技 / Linux Lab

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or Download
uboot.md 2.15 KB
Copy Edit Web IDE Raw Blame History
falcon authored 2017-09-15 22:16 . doc: live: update more urls

** Learning Uboot in Linux Lab **

Introduction

  1. Linux Lab

    • Docker, one image everywhere
    • Qemu emulated boards: ARM, MIPS, PowerPc, X86
    • Uboot, Linux, Buildroot, C, Assembly, Shell
    • Online available: noVNC(webVNC) and Gateone(webssh)
  2. U-boot

Quick Start

  1. Choose a board: vexpress-a9
    • make BOARD=vexpress-a9
    • boards/vexpress-a9/Makefile
  2. Boot with Uboot
    • make boot
    • -kernel /path/to/u-boot
    • prebuilt/: prebuilt uboot, kernel/dtb and rootfs
  3. Boot without Uboot
    • make boot U=0
    • -kernel /path/to/linux/*Image
    • How Qemu pass arguments to Linux?
      • -append 'root=/dev/ram0 ...'

Hacking Uboot: part1

  1. Download
    • make uboot-source
  2. Checkout
    • make uboot-checkout
  3. Patch
    • make uboot-patch
  4. Configure
    • make uboot-defconfig
    • make uboot-menuconfig
  5. Compile
    • make uboot
  6. Boot to CLI
    • make boot
    • Hit any key to stop autoboot and enter into CLI
  7. Load and Run Linux
    • print bootcmd
    • run bootcmd

Hacking Uboot: part2

  1. Using Uboot CLI

    • env: print
    • cmd: help
  2. Pass arguments to Kernel (from Uboot)

    • bootargs
    • setenv bootargs ...
  3. Loading Linux/dtb/rootfs

    • tftp: /etc/default/tftpd-hpa, ./tftpboot/
    • flash: ./tftpboot/pflash.img
    • sdcard: ./tftpboot/sd.img
  4. Pass arguments to Uboot (from Qemu)

    • env import addr size
    • flash: The last 1M partition
  5. Booting as we want

    • BOOTDEV: tftp, flash, sd
    • ROOTDEV: /dev/ram0, /dev/mmcblk0, /dev/nfs
    • make boot BOOTDEV=tftp ROOTDEV=/dev/nfs

Comment ( 0 )

Sign in to post a comment

Shell
1
https://gitee.com/tinylab/linux-lab.git
git@gitee.com:tinylab/linux-lab.git
tinylab
linux-lab
Linux Lab
master

Search

182229 41614e54 1850385 182230 7885ed45 1850385