Friday, December 2, 2016

QEMU : Installing Debian on Qemu emulated MIPS - Linux(x86) host

Hello People,

So, Here I needed to test some drivers functionality with 16K page size specifically. After walking through my options I settled with Linux on Qemu emulated MIPS. QEMU is a generic and open source machine emulator.



Here are the steps to install Debian on emulated MIPS machine using Qemu:


Preparation:
Here I am using Ubuntu 14.04 x86 system as my host machine.

1 . Installing Qemu on host system - install qemu package,

apt-get install qemu

2. Need to download a debian-installer kernel (vmlinux-3.16.0-4-4kc-malta) and initrd (initrd.gz) to boot from.

Setting up the MIPS system:

1. First need to create a virtual disk to install Debian on,

qemu-img create -f qcow2 debian_mips.qcow2 10G

This will create virtual disk of 10G size.

2. Next, install Debian to this virtual disk
qemu-system-mips -hda debian_mips.qcow2 -kernel vmlinux-3.16.0-4-4kc-malta -initrd initrd.gz -append "console=ttyS0" -nographic

Then follow shown on terminal as of normal Debian installation to the end.
This will take quite a while (so better get that fresh cup of coffee) as it will download all packages needed for installation.

boot:
After installations, next step is to boot into the system we just installed.

qemu-system-mips -hda debian_mips.qcow2 -kernel vmlinux-3.16.0-4-4kc-malta -append "root=/dev/sda1 console=ttyS0" -nographic

VoilĂ , you will be booted into MIPS system with Debian Linux!!
Rest is just usual Debian/Linux.


Accessing Host: 
Next thing that any developer will need is access to the Host system for exchanging all sort of stuff....driver, applicatin, source code etc.

You can SSH into the Host as bellow or just do SCP.
ssh host_user@10.0.2.2

Referances:
Networking: http://wiki.qemu.org/Documentation/Networking
Qemu: http://wiki.qemu.org/Main_Page

Cheers!!

Friday, September 23, 2016

Android CTS 7.0_r1 : Running modules list through automated script

Hello Guys,
How are you doing? hope all is well. Its been while, lets get started!

So whats new? Yeah Android 7 is new! Android 7 has been out now for a while and everybody (device vendors) wants it up and running as soon as possible. So here I am trying to get Android 7 up for some super secrete project, just kidding, yes I (and my team) had just completed bring up of the device with Android N (i.e. Android 7, called Nougat) yeeeh! but that's just the half battle, still need to run Android Compatibility Test Suite (CTS) to win the rest.



So, here is the issue, The device I have has some serious battery problem, it cant charge through USB if its connected to computer, it needs to be connect to charger to do so. So every time I kick CTS plan device goes down before it completes. The solution is instead of running whole plan run module by module and get result but its heck lot of manual work and I have to keep eye on it. Also in CTS 7 google has changed structure a bit lot.

So here I am going to give you scripts which helps you run CTS modules one-by-one and also saves results location in log file. So if device goes down while running some module you can continue from where you left. You just need to follow some steps as bellow:


1. Download CTS 7  

You can download CTS package from : CTS download   and extract it.

 

2. Get list of modules

After extracting CTS package go to android-cts/tools directory and execute following command to get available modules list,
Then copy list of modules to a file e.g. modules.lst or you can get it here 

3. Script to run modules one-by-one from the list

Now what you need is a script that runs modules from above list one-by-one, here it is, 

Running the CTS modules using script,

If device dies while running some module using the script, you can press 'ctrl+c' to stop script in between and remove modules from 'modules.lst' file which ran to completion successfully, then run the script again as before to continue from where you left.

4. Collecting logs of CTS

Result of each module ran using above script can be found in android-cts/results/ directory in separate sub-directories with sub-directory name as time-stamp when respective module has started. Above script collects all modules time-stamp in log file, modules.lst.log, which you can use latter to correlate time-stamps recorded to find each modules result/log directory. See snap-shot bellow,

That's it guys, have a nice day!!
Cheers!!!

Tuesday, July 26, 2016

Ubuntu 14.04 : How to install 4.4.8 Kernel

Hello,

Here are some simple steps to install Kernel 4.4.8 on your Ubuntu machine.
Open terminal and execute following commands in given order.

32bit Ubutnu:

Lets download the packages needed for installation.

Now, install downloaded packages: it will take a while, just sit back and relax

64bit Ubuntu:

Same way as earlier, lets download required packages first,
Installing downloaded packages: same as that of 32bit

We are done! Just reboot system and you should see newer Kernel installed on your system.
Cheers!!

Thursday, March 31, 2016

issue "/usr/include/linux/errno.h:1:23: fatal error: asm/errno.h: No such file or directory" while cross-compiling

Aloha,

So, making this post as it did cost me more than couple of hours to figure-out what the hell is happening.

I was building some (secrete) driver for android yesterday and I needed to install cross-compile tool-chain  for same, but while installing tool-chain on Ubuntu some of the packages already installed got removed by package installer.

Next, I set up the environment for building driver and kicked the build. Suddenly I started getting following error from compiler:


I did not noticed that some package has been forcefully removed while installing tool-chain. After some Googl'ing I found the package that needs to be installed.

Just install following package and issue will disappear :)

$sudo apt-get install linux-libc-dev:i386

cheers!!