140 likes | 282 Views
Computer System Laboratory. Lab4 - Bootloader. Experimental Goal. Learn how to build U-Boot bootloader for PXA270. Environment. Host System Windows XP Build System VirtualBox + Ubuntu 8.04 Target System Creator XScale PXA270 Software DENX U-Boot
E N D
Computer System Laboratory Lab4 - Bootloader
Experimental Goal • Learn how to build U-Boot bootloader for PXA270. / 14
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 Software / 14
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. / 14
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 0x00000000. • In other words, bootloader is usually located at 0x00000000. • Typical space allocation / 14
Memory Layout of PXA270 0xa0000000 0x00000000 U-Boot 0x00080000 Linux kernel 0x00480000 0xa1080000 U-Boot (TFTP) Root Filesystem 0x01380000 0xa3f80000 U-Boot (Domingo) 0x02000000 0xa4000000 Flash RAM / 14
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 8.04. • 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). / 14
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”. reference: wikipedia – Das U-Boot, http://en.wikipedia.org/wiki/Das_U-Boot / 14
U-Boot Compilation (1/2) • Step1: download patched source codes of U-Boot (mt-u-boot-1.1.2.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.. / 14
U-Boot Compilation (2/2) • 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. • E.g. Create_XScale_PXA270 is for our target board. • % cd u-boot-1.1.2 • % ./mt-crpxa270_config.sh • You can read the script to understand how to compile U-Boot for PXA270. • The resulting u-boot.binis the bootloader we want. • Then, you can refer Lab2 to copy the u-boot.bin to PXA270. / 14
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-1.1.2 • % 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. / 14
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. / 14
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. / 14
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. • Please send your report to both TAs. • csiedatou@gmail.com, meenchen79@gmail.com • Please use this title format: [CSL] G# Lab# Ver# • E.g., [CSL] G13 Lab4 Ver1 / 14