- Timestamp:
-
02/23/13 09:44:24 (11 years ago)
- Author:
-
C Rempel
- Comment:
-
Created page with "Note: this stub is to help with the LEON3 Qemu tutorial. The following instructions built the image and were run on a Debian Sqeeze host. Download the latest release of the ..."
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v1
|
v1
|
|
| 1 | = Building U-Boot = |
| 2 | |
| 3 | |
| 4 | Note: this stub is to help with the LEON3 Qemu tutorial. The following instructions built the image and were run on a Debian Sqeeze host. |
| 5 | |
| 6 | Download the latest release of the [http://www.denx.de/wiki/U-Boot/WebHome universal boot loader] from [ftp://ftp.denx.de/pub/u-boot/u-boot-latest.tar.bz2 the ftp] or, you can check out the developer branch using git. |
| 7 | $ git clone git://git.denx.de/u-boot.git |
| 8 | $ cd u-boot |
| 9 | |
| 10 | Locate the board to build. For example, if you wanted to build u-boot for the leon3... |
| 11 | u-boot$ grep -R "leon3" |
| 12 | |
| 13 | Set the toolchain |
| 14 | $ export CROSS_COMPILE=/opt/rtems-4.11/bin/sparc-rtems4.11- |
| 15 | Build the package with the following configure command: |
| 16 | |
| 17 | $ /configure --prefix=/tmp/g2/build |
| 18 | $ make all install |
| 19 | |
| 20 | where the prefix can be anything suitable for your machine. If configure fails with a missing LZO library check you have the lzo-devel package installed. |
| 21 | |
| 22 | To make the floppy image follow the instructions in the Grub Wiki at http://grub.enbug.org/TestingOnX86. This script is adapted from the instructions: |
| 23 | |
| 24 | #! /bin/sh -x |
| 25 | grub=/tmp/g2/build |
| 26 | workspace=/tmp/g2 |
| 27 | mnt=$workspace/mnt/loop |
| 28 | file=$workspace/rtems-boot.img |
| 29 | export PATH=$grub/bin:$grub/sbin:$PATH |
| 30 | mkdir -p $workspace |
| 31 | cd $workspace |
| 32 | grub-mkimage -o core.img _chain ls pc multiboot gpt fat boot reboot configfile cat help |
| 33 | dd if=/dev/zero of=$file bs=512 count=2880 |
| 34 | /sbin/mkdosfs $file |
| 35 | mkdir -p $mnt |
| 36 | mount -o loop -t vfat $file $mnt |
| 37 | mkdir -p $mnt/boot/grub |
| 38 | cp $grub/lib/grub/i386-pc/boot.img core.img $grub/lib/grub/i386-pc/*.mod $mnt/boot/grub |
| 39 | echo "configfile (hd0,0)/rtems-grub.cfg" > $mnt/boot/grub/grub.cfg |
| 40 | echo '(fd0)' $file > tmp_device.map |
| 41 | grub-setup -d $mnt/boot/grub -r '(fd0)' -m tmp_device.map '(fd0)' |
| 42 | rm -f tmp_device.map |
| 43 | umount $mnt |