Sunday, August 22, 2010

Android for MIPS

I recently learnt about this effort to port over Android to the MIPS platform at the this website and decided to investigate what it was about.

Before I could check out any source code, I had to install Curl and Git. For Git install see my previous post. Curl can be installed as follows:
sudo apt-get install curl

Next, install repo, which is a google tool (read the google blog post for details:
curl http://android.git.kernel.org/repo >/home/am/repo

Once repo is set up, run repo sync to check out the generic Android for MIPS source

Git Install

Git is an open source distributed version control system that hosts a lot of the open source code (including itself). So, installing Git on your Linux machine is a good idea, coz, you will likely end up using it to download something pretty soon

Follow these steps to install Git (I did this on Ubuntu 10.04):
1. Download latest tar or gz file from here.
2. untar it to a local directory.
3. cd to the git directory.
4. run ./configure (or sudo ./configure, if in user mode)
5. run make.
6. if you see the following error: fast-import.c:2848: error: ‘Z_BEST_COMPRESSION’ undeclared (first use in this function).... you are missing zlib1g-dev. If so, install it as follows:
sudo apt-get install zlib1g-dev
and then run make again, it should work this time.
7. run make install
Done!

VirtualBox For Windows 7 and Ubuntu 10.04

So, I decided to investigate setting up a virtual machine so I don't have to constantly reboot as I go between Windows and Linux.
After doing some quick research on all the various options out there (VMWare, VirtualBox, Microsoft Virtual PC,...) I decided to go with Sun VirtualBox.

The setup was fairly easy:
1. You decide a "host OS" that you want to use (in my case it was Windows 7).
2. Download and install VirtualBox from http://www.virtualbox.org/wiki/Downloads
3. Decide on the guest OS (or OSes) you want to install (in my case Ubuntu 10.04)
4. Run the VirtualBox console.
5. Select New Machine - this brings up the wizard.
6. Give it a name and select the operating system type from the dropdown.
7. Browse to the ISO image to install
8. Install the OS.

There is one quirk I've encountered so far - When I run my guest OS (Ubuntu) and try the switch to full screen - I see a full screen, but the actual OS itself, remains in the same size screen. I found the solution to this problem at this link :
This post was particularly useful:
Start the guest
  • Open a terminal window
  • sudo -i press enter
  • apt-get install build-essential
  • apt-get install Linux-headers-generic
Leave the terminal open you are going to need it again.

When this is done the devices tab is at the top left of the guest window (called a VM which stands for virtual machine) then click install guest additions.
This will put a CD on the desktop. Double click to open and then select the guest additions for your machine (see note below) and right click-drag and drop on the terminal window.
Click once in the terminal to get focus and then hit enter. Wait for everything to finish and then reboot the machine. Watch for any errors and if you have any report back here with the exact error message.

Note: Select VBoxLinuxAdditions-amd64.run for 64 bit or VBoxLinuxAdditions-x86.run for 32 bit

After you have the Guest additions installed you use the mouse to adjust the screen to the size you want or you can use the (Host+f) toggle for full screen or the (Host+L) toggle for seamless. The Host key is the right Ctrl key which a MAC does not have so to use this feature you will need to go into the main VirtualBox Program and at the top left click file, then preferences and then input. Click once where it says Right Control and then press the left ctrl key on your MAC keyboard. Close and then start the guest again for this to take effect.