COMPUTER SYSTEM LABORATORY Lab4 - Bootloader
Lab 4 Experimental Goal Learn how to build U-Boot bootloader for PXA /10/8/ 142
Lab 4 Environment Host System Windows XP Build System VirtualBox + Ubuntu 8.04 Target System Creator XScale PXA270 Software DENX U-Boot You can download all software from RSWiki CSL Course SoftwareRSWiki CSL Course Software 2013/10/8/ 143
Lab 4 Bootloader Concept (1/2) A typical flow when booting a computer. Load BIOS and self check. Execute bootloader. Initialize hardware. Load kernel and filesystem. … Bootloader Initialize hardware. Load kernel and filesystem. 2013/10/8/ 144
Lab 4 Bootloader Concept (2/2) When a computer is powered on, CPU will execute the first instruction from a specified address: ROM, EEPROM, Flash memory, etc.. In ARM system, the address usually is 0x In other words, bootloader is usually located at 0x Typical space allocation 2013/10/8/ 145
Lab 4 Memory Layout of PXA /10/8/ 146 0x x x x x U-Boot Linux kernel Root Filesystem Flash 0xa xa xa3f xa U-Boot (TFTP) RAM U-Boot (Domingo)
Lab 4 Bootloader Examples Bootloader highly depends on architecture. Some popular bootloaders: LILO, GRUB, GRUB2 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 Windows XP. U-Boot We will use U-Boot for PXA270 (ARM architecture). 2013/10/8/ 147
Lab 4 Introduction to U-Boot Das U-Boot (Universal Bootloader) is an open source, primary bootloader used in embedded systems. It is available for a number of different computer architectures, including PPC, ARM, MIPS, x86, etc.. The current name Das U-Boot adds a German definite article as a pun to the German word for “submarine”. 2013/10/8/ 148 reference: wikipedia – Das U-Boot,
Lab 4 U-Boot Compilation (1/2) Step1: download patched source codes of U-Boot (mt-u-boot tar.gz).mt-u-boot tar.gz Step2: extract source codes. Step3: please refer to Lab3 to check arm-elf-* toolchain path in PATH. Tips: The include/configs/ directory under U-Boot source directory contains configuration files for supported boards. It defines the CPU type, the peripherals and their configuration, the memory mapping, the U-Boot features that should be compiled in, etc /10/8/ 149
Lab 4 U-Boot Compilation (2/2) Step4: compile U-Boot. U-Boot must be configured before being compiled, i.e. make _config, where is the name of the configuration file in include/configs/, without the.h. E.g. Create_XScale_PXA270 is for our target board. % cd u-boot %./mt-crpxa270_config.sh You can read the script to understand how to compile U-Boot for PXA270. The resulting u-boot.bin is the bootloader we want. Then, you can refer Lab2 to copy the u-boot.bin to PXA /10/8/ 1410
Lab 4 Configure U-Boot If you want to change default configuration for PXA270, you can modify the specified file and recompile U-Boot. % cd u-boot % vim include/configs/Create_XScale_PXA270.h CONFIG_SERVERIP: host system IP. CONFIG_IPADDR: target system IP. CONFIG_BOOTARGS: boot arguments. CONFIG_BOOTCOMMAND: boot command. CONFIG_BOOTDELAY: U-Boot delay (do not set to 0!). CONFIG_LINUX: Linux kernel start command. 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. 2013/10/8/ 1411
Lab 4 Build Your Own U-Boot (1/2) Step1: please modify the configuration in U-Boot. CONFIG_BOOTCOMMAND = “run linux” CONFIG_LINUX = “bootm 80000” Step2: recompile your U-Boot. Step3: please refer to Lab2 to transfer your u-boot.bin to PXA270. Step4: please refer to Lab2 to copy the u-boot.bin to flash. 2013/10/8/ 1412
Lab 4 Build Your Own U-Boot (2/2) Step5: reset PXA270 and then you will see new configuration. If you have copied Linux ( uImage ) to flash 0x80000 in Lab2, you can boot Linux by new U-Boot. 2013/10/8/ 1413
Lab 4 Lab Requirement & Bonus Show what parameters you have modified for your U-Boot. Bonus: Answer the question of lab4 on RSWiki CSL course website. Write it in your report.RSWiki CSL course website Please send your report to both TAs. Please use this title format: [CSL] G# Lab# Ver# E.g., [CSL] G13 Lab4 Ver1 2013/10/8/ 1414