Download presentation
Presentation is loading. Please wait.
Published byRosamund Blankenship Modified over 9 years ago
1
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Lab4 - Bootloader 2014/10/14/ 13 1
2
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Learn how to build U-Boot bootloader for PXA270. 2014/10/14/ 13 2
3
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Host System Windows XP Build System VirtualBox + Ubuntu 8.04 Target System Creator XScale PXA270 Software DENX U-Boot You can find all software on RSWiki CSL Course Software.RSWiki CSL Course Software 2014/10/14/ 13 3
4
Lab 4 Department of Computer Science and Information Engineering National Taiwan University A typical flow when booting a computer. Load BIOS and do hardware self-test. Execute bootloader in master boot record (MBR) which is the first sector of disk. Load kernel and root filesystem. Initialize hardware. … 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: 2014/10/14/ 13 4
5
Lab 4 Department of Computer Science and Information Engineering National Taiwan University 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). 2014/10/14/ 13 5
6
Lab 4 Department of Computer Science and Information Engineering National Taiwan University 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”. 2014/10/14/ 13 6 Reference: Das U-Boot, http://en.wikipedia.org/wiki/Das_U-Boothttp://en.wikipedia.org/wiki/Das_U-Boot
7
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Step 1: download the patched source codes of U-Boot (mt-u-boot- 1.1.2.tar.gz) in Ubuntu 8.04.mt-u-boot- 1.1.2.tar.gz Step 2: extract source codes. Step 3: please check the path of toolchain arm-elf-* is in PATH. The toolchain arm-elf-* will be used in the compilation. 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. For instance of PXA270, U-boot will be copied to 0xA3F80000 when it is loaded by CPU and it uses 0x00020000 to 0x0003FFFF as the boot parameters. 2014/10/14/ 13 7
8
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Step 4: compile U-Boot. U-Boot must be configured for the target board 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-1.1.2 % make mrproper This command often uses to clean all the object files and configurations. You can see Makefile and check what it has done. % make Create_XScale_PXA270_config % make The resulting u-boot.bin is the bootloader we want so that we can copy it to PXA270. 2014/10/14/ 13 8
9
Lab 4 Department of Computer Science and Information Engineering National Taiwan University 2014/10/14/ 13 9 0xA0000000 0xA4000000 RAM U-Boot Flash 0x00000000 0x00040000 0x00080000 diag 0x00480000 0x01380000 Linux kernel 1 Root Filesystem 0x00020000 U-Boot parameters 0x02000000 0x01C00000 Linux kernel 2U-Boot 0xA3F80000
10
Lab 4 Department of Computer Science and Information Engineering National Taiwan University If you want to change default configuration for PXA270, you can modify the specified files and recompile U-Boot. % cd u-boot-1.1.2 % nano 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. etc. Tips: 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. 2014/10/14/ 13 10
11
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Step 1: please modify the boot command in U-Boot. CONFIG_BOOTCOMMAND = “ run linux ” CONFIG_LINUX = “ bootm 80000 ” Step 2: please try to change the command prompt and display with your group id. 2014/10/14/ 13 11
12
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Step 3: copy the uImage provided in lab3 to flash address 0x01C00000. The erased end address is 0x1FFFFFF (32 sectors). Step 4: compile your U-Boot and copy to flash address 0x00000000. Make sure you also erase the boot parameters sector ( 0x00020000 to 0x0003FFFF ), or your modified settings could not work. Step 5: reset PXA270 and then you will see new configuration. Try to do some settings so that you can choose which to boot on, the two Linux kernels,or the program diag. 2014/10/14/ 13 12
13
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Show your own command prompt in U-Boot. Show that you can choose what to boot on, and it is as simple as possible. Please hand in your lab report to the FTP. Server: 140.112.90.174 Username: csl2014 Password: csl2014HomeWork Directory: lab4 Please use this format for filename: “G# Ver#”, where G# is your group id and Ver# is revision version number. E.g., G1 Ver2 2014/10/14/ 13 13
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.