Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer System Laboratory

Similar presentations


Presentation on theme: "Computer System Laboratory"— Presentation transcript:

1 Computer System Laboratory
Lab4 Bootloader

2 Experimental Goal Build the U-Boot and use JTAG to download U-Boot to the target board without bootloader Lab4 2019/4/20

3 Environment Host System Build System Target System Software
Windows XP/Ubuntu 8.04 Build System Ubuntu 8.04 Target System XScale PXA270 Software DENX U-Boot source code You can download all the source codes from RSWiki CSL Course Software Lab4 2019/4/20

4 Bootloader Concept A typical flow when booting a computer Bootloader
Load BIOS and self check Execute bootloader Load kernel and filesystem Initialize hardware elements Bootloader Lab4 2019/4/20

5 Bootloader Concept (Cont.)
All CPUs will execute the first instruction from a specified address when power on ROM, EEPROM, Flash memory, etc ARM system will execute from 0x Typical space allocation Lab4 2019/4/20

6 System Memory Layout memory layout 0x00000000 0xa0000000 U-Boot 3
Linux kernel 0x 0xa U-Boot 2 Linux File System 0x 0xa3f80000 U-Boot 1 0x 0xa Flash memory RAM Lab4 2019/4/20

7 Bootloader Examples Bootloader highly dependents on architecture
Some popular bootloaders LILO, GRUB You can see /boot/grub/menu.lst for the settings in Ubuntu Windows Boot Manager You can see the settings in C:\boot.init in XP U-Boot We will use U-Boot for PXA270 (ARM architecture) Lab4 2019/4/20

8 Introduction to U-Boot
Das U-Boot (Universal Bootloader) is an open source, primary bootloader used in embedded system It is available for a number of different computer architectures, including PPC, ARM, MIPS, x86 The current name Das U-Boot adds a German definite article as a pun to the German word for “submarine” ~ from Wikipedia Lab4 2019/4/20

9 U-Boot Compilation Step1 : download patched source code
Step2 : extract source code % tar –zxvf mt-u-boot tar.gz Step3 : check Lab1’s arm-elf toolchain path in PATH Tips The include/configs/ directory under U-Boot source directory contains one configuration file for each supported board It defines the CPU type, the peripherals and their configuration, the memory mapping, the U-Boot features that should be compiled in, etc Lab4 2019/4/20

10 U-Boot Compilation (Cont.)
Step4 : compile U-Boot U-Boot must be configured before being compiled, i.e. make <target board>_config, where <target board> is the name of the configuration file in include/configs/, without the .h % cd u-boot-1.1.2 % ./mt-crpxa270_config.sh The resulting u-boot.bin is the bootloader we want Lab4 2019/4/20

11 Download U-Boot to Target Board
Step1 : open Domingo (refer to Lab3) Step2 : load u-boot.bin (the address of SDRAM lies within the range 0xa xa ) Lab4 2019/4/20

12 Download U-Boot to Target Board (Cont.)
Step3 : change the PC value in registers Step4 : open Serial Console Step5 : click Debug  Free Go Hit any key to stop U-Boot autoboot Step6 : use “flinfo” command to check if U-Boot can control flash memory Lab4 2019/4/20

13 Transfer File via TFTP Step1 : openTFTP Server (Windows version, refer to Lab2) Step2 : change Host IP address (according to your U-Boot setting, use “printenv serverip” command in U-Boot shell) Step3 : copy u-boot.bin to TFTP Server’s root directory Step4 : download U-Boot via Ethernet cable $ tftp a u-boot.bin Tip U-Boot has a built-in TFTP client Lab4 2019/4/20

14 Copy to Flash memory Step1 : disable flash write protection
$ protect off 0 7ffff Step2 : erase the specified range of bytes $ erase 0 7ffff Step3 : copy U-Boot to reset address $ cp.b a Step4 : change environment variable (optional) $ setenv ipaddr <target-system-ip> $ setenv serverip <host-system-ip> $ saveenv Now, you can abandon Domingo, remember to change Host System IP if you change environment variable Lab4 2019/4/20

15 Configure U-Boot If you want to change U-Boot default environment, modify the specified file and recompile U-Boot % cd u-boot-1.1.2 % vim include/configs/Create_XScale_PXA270.h Host System IP : CONFIG_SERVERIP Target System IP : CONFIG_IPADDR Boot arguments : CONFIG_BOOTARGS Boot command : CONFIG_BOOTCOMMAND U-Boot delay : CONFIG_BOOTDELAY (do not set to 0!) Linux kernel start command : CONFIG_LINUX Tip The U-Boot environment variable ‘bootargs’ is used to hold the parameter options passed to the Linux kernel, as the kernel’s command line parameters Lab4 2019/4/20

16 Exercise Use U-Boot to automatically start last week’s test program after reset This time, let LED really be blinking in your own way, such as blinking once every number of your group second. Tip Use “setenv bootcmd” command to modify U-Boot boot command Use U-Boot “go <addr>” to start program at address ‘addr’ For more information about LED control register, please refer to Create XScale-PXA270 User’s Guide, 4.3.2 Lab4 2019/4/20


Download ppt "Computer System Laboratory"

Similar presentations


Ads by Google