Monday, May 31, 2010

Compile kernel

git clone git://gitorious.org/0xlab-kernel/kernel.git
git checkout -b kernel_omap3 origin/omap3
make omap3_beagle_defconfig

boot option (to start from SD card)
===============
root=/dev/mmcblk0p2 init=/init rw console=ttyS2,115200n8
===============

make ARCH=arm CROSS_COMPILE=../prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- uImage

Compile u-boot

U-Boot is the interface between X-loader and Kernel Image. Wrong u-Boot could disable your USB port and other things. If you want to use GPIO, you can also enable GPIO in u-Boot. The beagleboard x-loader looks for u-boot.bin file on your MMC card. If none was found, the beagleboard will use the default NAND u-boot.bin file, which could have the USB disabled.


Modify the file

===============
pico ./include/configs/omap3_beagle.h
make omap3_beagle_config
make
===============

Make from source

before you make, you need a buildspec.mk file to speicify the beagleboard.

===================
echo "TARGET_PRODUCT := beagleboard" > buildspec.mk
echo “INSTALL_PREBUILT_DEMO_APKS := true” >> buildspec.mk
===================

Then use:

===================
make -j2
===================

The output of the make is a root file system in out/target/product/beagleboard/system.img


===================
* Format the first partition over than 100MB with VFAT on a SD card.
* Download the installer uImage.bin
* Rename out/target/product/beagleboard/system.img to android-beagle.ubi
* Rename arch/arm/boot/uImage to 0xkernel-beagle.bin
* Copy above three files into the first partition of SD/MMC card
* Plug the SD card in Beagle board SD slot and restart the Beagleboard
* Wait for UI installer over. The installer would perform NAND flashing and u-boot environment setup.
* Unplug SD card from the Beagleboard and reboot
* Enjoy!
===================

Sunday, May 30, 2010

More clear picture

After search more a little bit, it seems the Zoom is another device from TI. Even Zoom uses the omap processor, it has a different structure than the beagleboard. Therefore, the source code I downloaded for the Zoom can not be used for beagleboard.

The 0xdroid has been working. I am going to keep using that platform for development. All the source code are:

http://code.google.com/p/0xdroid/wiki/Source

It provided an installer called uImage.bin. After an u-boot is loaded, the uImage is loaded since u-boot thinks it's a kernel. The downloaded uImage.bin is actually more than a kernel. It also flash the u-boot to NAND.

If you want the normal ubuntu boot up with x-loader, u-boot, uImage and root file system, here is how to set up the u-boot for the correct kernel command.

http://code.google.com/p/0xdroid/wiki/boot_nand

The u-boot and kernel information can be found at:

http://gitorious.org/0xlab-kernel

Friday, May 28, 2010

More android source

http://elinux.org/Android_on_OMAP
http://discuz-android.blogspot.com/2008/01/extract-google-android-file-system.html
http://wiki.kldp.org/wiki.php/AndroidPortingOnRealTarget
http://bs-android.seesaa.net/article/121303869.html
http://groups.google.com/group/rowboat/browse_thread/thread/825b5fa1142333a0
http://developer.android.com/resources/tutorials/testing/activity_test.html
http://www.yuan.se/?p=32
http://groups.google.com/group/0xlab-discuss/browse_thread/thread/35bc7fc86ab12d53/4cb21c93cf0daeed

Wednesday, May 26, 2010

More about Android

Just found out Android, like linux, has many distribution. One of them is called 0xdroid. It is easy to use and seems to have some documents.

To build Android from scratch, you can check the following link.

http://code.google.com/p/0xdroid/wiki/Source

However, I am still confused about the u-boot.bin.

Latest x-load and u-boot:

http://gitorious.org/beagleboard-validation/

Friday, May 21, 2010

Switch to andriod

Due to the need for another project I will explore Andriod.

There are sources I am checking out. The second one is a little bit outdated.

http://omappedia.org/wiki/Android_Getting_Started#Accessing_Source_Code
http://omappedia.org/wiki/Android_Video_Run_From_SD_Tutorial

I followed the steps installed all the required software.

===================
sudo apt-get install git-core flex bison gperf libesd0-dev
sudo apt-get install libwxgtk2.6-dev zlib1g-dev build-essential
sudo apt-get install libstdc++5 tofrodos libsdl-dev zip curl x-dev
sudo apt-get install libx11-dev libncurses5-dev sun-java5-jdk libc6-dev g++ gcc
===================

The second step is to install the cross compile. Since I used OpenEmbedded. I will keep the OE CC tool for now.

The Andriod uses repo, a tool similar to git. Unlike the above page, I move the repo tool to /usr/bin so I don't have to update my $PATH

===================
curl http://android.git.kernel.org/repo >~/repo
chmod a+x ~/repo
sudo mv repo /usr/bin
===================

Next get the source code. For different source code branches, you can check out: http://git.omapzoom.org/?p=platform/omapmanifest.git;a=summary

===================
mkdir andriod
cd andriod
repo init -u git://git.omapzoom.org/repo/android/platform/omapmanifest.git
repo sync
===================

After a long time ......
You can start build u-boot and x-loader

===================
cd ~/andriod/bootable/bootloader/uboot
make omap3430zoom2_config
make
===================

xloader
===================
cd ~/andriod/bootable/bootloader/x-loader
make omap3430zoom2_config
make
make ift
===================



How to clone kernel source:

===================
git clone git://git.omapzoom.org/kernel/omap.git /home/setup/android/kernel/
cd /home/setup/android/kernel/
git checkout --track origin/android-omap-2.6.32 -b android-omap-2.6.32
git pull
make omap_zoom3_defconfig
make uImage
===================

If you have an error, try the following branch.
git checkout --track origin/p-android-omap-2.6.32 -b p-android-omap-2.6.32

If you don't have mkimage, it's in ~/andriod/bootable/bootloader/u-boot/tools. You can add the path or copy it to /usr/bin