顯示具有 BeagleBoardPkg 標籤的文章。 顯示所有文章
顯示具有 BeagleBoardPkg 標籤的文章。 顯示所有文章

2013年6月7日 星期五

Build EDK2 BeagleBoardPkg on Mac OS X

Install XCode


Install MacPorts


Install ARM toolchain 

sudo port install arm-none-eabi-gcc 

Within Darwin section in  BeagleBoardPkg/build.sh

Change XCODE32 to ARMGCC

Build

./build.sh

Linaro image tools for Mac OS X

Not available yet
https://bugs.launchpad.net/linaro-image-tools
My workaround is making image on the Ubuntu and load it to Mac
Looking forward tools for Mac OS X
Temporarily switch back to Ubuntu 

2013年6月6日 星期四

Build BeagleBoardPkg using gcc-arm-linux-gnueabi

Install ARM EABI GCC

sudo apt-get install gcc-arm-linux-gnueabi

Modification in BeagleBoardPkg/build.sh

#
# Pick a default tool type for a given OS if no toolchain already defined
#
...
#TARGET_TOOLS=ARMGCC
TARGET_TOOLS=ARMLINUXGCC
...

undefined reference to `__stack_chk_fail'
undefined reference to `__stack_chk_guard'

Append -fno-stack-protector to DEBUG_ARMLINUXGCC_ARM_CC_FLAGS
Append -fno-stack-protector to RELEASE_ARMLINUXGCC_ARM_CC_FLAGS

2013年6月1日 星期六

UEFI Boot Linaro images on qEmu based BeagleBoard

Build EDK2 BeagleBoardPkg


Boot Linaro-m alip (Kubuntu 10.10)

Install needed packages
KPH$ sudo apt-get install parted dosfstools uboot-mkimage python-argparse python-dbus python-debian python-parted qemu-arm-static btrfs-tools command-not-found

Create and change to working directory
KPH$ cd $(WORKROOT)
KPH$ mkdir -p linaro-m/alip && cd linaro-m/alip

Get image and hardware packs
KPH$ wget http://releases.linaro.org/platform/linaro-m/alip/final/linaro-m-alip-tar-20101109-0.tar.gz http://releases.linaro.org/platform/linaro-m/hwpacks/final/hwpack_linaro-omap3_20101109-1_armel_supported.tar.gz

Install Linaro image tools
KPH$ sudo add-apt-repository ppa:linaro-maintainers/tools
KPHsudo apt-get update
KPHsudo apt-get install linaro-image-tools

Create u-boot and Linux Linaro image
KPHsudo linaro-media-create --image_file alip.img --dev beagle --binary linaro-m-alip-tar-20101109-0.tar.gz --hwpack hwpack_linaro-omap3_20101109-1_armel_supported.tar.gz
KPH$ sudo chmod a+rw alip.img

Replace u-boot.bin with UEFI
KPHmkdir /tmp/alip_boot/
KPHsudo mount -o loop,offset=$[63*512] $(WORKROOT)/linaro-m/alip/alip.img /tmp/alip_boot
KPH$ sudo cp $(EDK2ROOT)/edk2/Build/BeagleBoard/RELEASE_ARMGCC/FV/BEAGLEBOARD_EFI.fd /tmp/alip_boot/u-boot.bin
KPH$ sudo umount /tmp/alip_boot

ARM UEFI only supports zImage currently, so add zImage to the sdcard
KPH$ tar xzf hwpack_linaro-omap3_20101109-1_armel_supported.tar.gz
KPH$ cd pkgs/
KPH$ dpkg -x linux-image-2.6.35-1008-linaro-omap_2.6.35-1008.15_armel.deb .
KPH$ sudo mount -o loop,offset=$[63*512] $(WORKROOT)/linaro-m/alip/alip.img /tmp/alip_boot
KPH$ sudo cp boot/vmlinuz-2.6.35-1008-linaro-omap /tmp/alip_boot/zImage

Install ARM qEmu
KPH$ sudo add-apt-repository ppa:linaro-maintainers/tools
KPH$ sudo apt-get update
KPH$ sudo apt-get install qemu-user-static qemu-system

Test UEFI on qEmu
KPH$ sudo qemu-system-arm -M beagle -serial stdio -sd alip.img

Add a boot device entry and boot from it

The default boot selection will start in   7 seconds

[1] Linux from SD

[2] Shell
[3] Boot Manager
Start: 3
[1] Add Boot Device Entry
[2] Update Boot Device Entry
[3] Remove Boot Device Entry
[4] Update FDT path
[5] Return to main menu
Choice: 1
[1] SemihostFs (0 MB)
[2] boot (51 MB)
[3] VenHw(4D00EF14-C4E0-426B-81B7-30A00A14AAD6)
Select the Boot Device: 2
File path of the EFI Application or the kernel: zImage
Has FDT support? [y/n] nAdd an initrd: [y/n] yFile path of the initrd: uInitrd
Arguments to pass to the binary: console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw earlyprintk fixrtc nocompcache vram=12M omapfb.mode=dvi:1280x720MR-16@60
Description for this new Entry: alip
[1] Add Boot Device Entry
[2] Update Boot Device Entry
[3] Remove Boot Device Entry
[4] Update FDT path
[5] Return to main menu
Choice: 5
[1] Linux from SD
[2] alip
[3] Shell
[4] Boot Manager
Start: 2
   PEI    661 ms
   DXE   4558 ms
   BDS   5380 ms
Total Time = 10600 ms
Uncompressing Linux... done, booting the kernel.
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 2.6.35-1008-linaro-omap (buildd@hawthorn) (gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) ) #15-Ubuntu Fri Oct 22 11:56:29 UTC 2010 (Ubuntu 2.6.35-1008.15-linaro-omap 2.6.35.7)

(booting messages)

Seeing messages below on Terminal means boot is done
Welcome to Linaro!
 * Documentation:  http://www.linaro.org

1 package can be updated.
0 updates are security updates.

root@localhost:~# 

Takes a while for the GUI desktop on qEmu



























With similar steps you could try another images you like. 
Enjoy. :)

==================================================

Issues

SD: CMD12 in a wrong state
Mouse and keyboard do not work
==================================================

References

Follow steps in the link below first
https://wiki.linaro.org/Resources/HowTo/Qemu-beagleboard

Choose pre-built images of linaro-m (older Ubuntu Maverick version)
http://releases.linaro.org/platform/linaro-m/

Using UEFI to boot Linux
http://sourceforge.net/apps/mediawiki/tianocore/index.php?title=BeagleBoardPkg#Using_UEFI_to_boot_Linux

2013年5月31日 星期五

Build EDK2 BeagleBoardPkg for booting qEmu BeagleBoard

Build BeagleBoardPkg

Get ARM GCC tools by following BeagleBoardPkg/readme.txt first, then follow the link below
Some build errors and tool-deprecated issues need to be done 

Get arm-none-eabi toolchain

4.4.1 (recommended)
https://code.google.com/p/arduino/downloads/detail?name=gcc-arm-none-eabi-4.4.1-2010q1-188-linux32.tar.gz&can=2&q=

Note that if you choose 4.6 or above will probably get compatibility errors, such as -combine option deprecated issue.

4.6
https://launchpad.net/gcc-arm-embedded/4.6/4.6-2012-q2-update/+download/gcc-arm-none-eabi-4_6-2012q2-20120614.tar.bz2

Error: unknown pseudo-op: `.arch_extension' 

Find where the code ".arch_extension" is (in ArmSmc.S) and modify as below

#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 6
".arch_extension sec\n" #endif

BeagleBoardPkg should be successfully built

Qemu-arm-static not found

Follow link below to install qEmu first

Add boot device entry

Because Terminal on Ubuntu cannot completely clear bootargs content and update it, we need to add an entry for booting.

The default boot selection will start in   7 seconds
[1] Linux from SD
[2] Shell
[3] Boot Manager
Start: 3
[1] Add Boot Device Entry
[2] Update Boot Device Entry
[3] Remove Boot Device Entry
[4] Update FDT path
[5] Return to main menu
Choice: 1

bunch of  "SD: CMD12 in a wrong state" messages

[1] SemihostFs (0 MB)
[2] boot (51 MB)
[3] VenHw(4D00EF14-C4E0-426B-81B7-30A00A14AAD6)
Select the Boot Device: 2
File path of the EFI Application or the kernel: zImage
Has FDT support? [y/n] nAdd an initrd: [y/n] yFile path of the initrd: uInitrd
Arguments to pass to the binary: console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw earlyprintk fixrtc nocompcache vram=12M omapfb.mode=dvi:1280x720MR-16@60
Description for this new Entry: Linaro Linux
[1] Add Boot Device Entry
[2] Update Boot Device Entry
[3] Remove Boot Device Entry
[4] Update FDT path
[5] Return to main menu
Choice: 5
[1] Linux from SD
[2] Linaro Linux
[3] Shell
[4] Boot Manager
Start: 2

bunch of  "SD: CMD12 in a wrong state" messages

   PEI    383 ms
   DXE   2744 ms
   BDS   2845 ms
Total Time = 5974 ms

Uncompressing Linux... done, booting the kernel.
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu

booting kernel logs

Welcome to Linaro!
 * Documentation:  http://www.linaro.org
root@localhost:~#

Build using gcc-arm-linux-gnueabi (Working on it)

http://kphuang1009.blogspot.tw/2013/06/build-beagleboardpkg-using-gcc-arm.html

Issues

"SD: CMD12 in a wrong state" issue

Rollback to Older Linaro qemu version 

Compile using gcc-4.4

undefined reference to symbol 'timer_settime@@GLIBC_2.3.3'
sudo apt-get install python2.4

Try another qemu omap3 project

https://code.google.com/p/qemu-omap3/wiki/UserManual#Download_The_Source_Code

Get warning messages after configuring qemu-omap3
WARNING: "gcc" looks like gcc 4.x
Looking for gcc 3.x
gcc 3.x not found!
QEMU is known to have problems when compiled with gcc 4.x
It is recommended that you use gcc 3.x to build QEMU
To use this compiler anyway, configure with --disable-gcc-check

Tried to install gcc 3.x to build Linaro qEmu
http://askubuntu.com/questions/39628/old-version-of-gcc-for-new-ubuntu

Error: zlib check failed
Reinstall zlib
sudo apt-get install --reinstall zlibc zlib1g zlib1g-dev