Changes

QEMU

1,817 bytes added, 10:06, 31 August 2012
Board Emulation
Download QEMU sources from linaro git repository:
<pre>$ [http://git.linaro.org/gitweb?p=qemu/qemu-linaro.git;a=summary git clone git://git.linaro.org/qemu/qemu-linaro.git]</pre> Download IGEP support patch for QEMU from this [http://downloadswww.igepisee.esbiz/component/zoo/QEMUitem/0001qemu-IGEP_QEMU_support.path emulator link ]and after that apply the patch as:
<pre>$ cd qemu-linaro
$ patch -p1 &lt; 0001-IGEP_QEMU_support.path</pre>
Configure the sources for build with this command:
<pre>$ ./configure --target-list=arm-softmmu --prefix=<span style="color: rgb(255, 0, 0);">/opt/qemu-linaro</span></pre>
Build the sources:
<pre>$ make </pre>
Install QEMU:
<pre>$ make install</pre>Optionally you can download from [http://downloadswww.igepisee.esbiz/QEMUcomponent/zoo/item/qemu-linaro.tar.gz emulator here] the QEMU binaries, we suggest install it under /opt directory with the right user execution permissions.<br>
== Board Emulation ==
Go to your qemu install directory.<br> <pre>$ cd /opt/qemu-linaro/bin</pre> We provide a QEMU ready image based on Ubuntu/Linaro Nano (Oneric 11.11) image, it can be download from [http://www.isee.biz/component/zoo/item/qemu-emulator here] (first uncompress it).<br>
$ cd /opt/qemuThe image has 2 partitions (you can see the partitions using fdisk -linaro/binul command as: fdisk -ul igep-nano.img)<br>
We provide a QEMU ready image based on Ubuntu/Linaro Nano (Oneric 11.11) image, it can be download from [http://downloads.igep.es/QEMU/igep.nano.img here].Device&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Boot&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Start&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Blocks&nbsp;&nbsp; Id&nbsp; System<br>
The image has 2 partitions (you can see the partitions using fdisk -ul command as: fdisk -ul igep-nano.imgimg1&nbsp;&nbsp; *&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 63&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 106494&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 53232&nbsp;&nbsp;&nbsp; c&nbsp; FAT32 LBA (Boot)<br>
Deviceigep-nano.img2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;106496&nbsp; Boot&nbsp;&nbsp;&nbsp;1048575&nbsp;&nbsp; Start&nbsp;&nbsp;&nbsp;470016&nbsp;&nbsp;83&nbsp;&nbsp;&nbsp; End&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Blocks&nbsp;&nbsp; Id&nbsp; SystemLinux (Root filesystem)<br>
Optionally you can mount the partitions in you host PC and modify the content as:<br> <pre>First Partition: $ mount -o loop,offset=$[63*512] igep-nano.img1&nbsp;&nbsp; img /mnt/tmp</pre><pre>Second Partition: $ mount -o loop,offset=$[106496*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; 63&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 106494&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 53232&nbsp;&nbsp;&nbsp; c&nbsp; FAT32 LBA (Boot)512] igep-nano.img /mnt/tmp</pre> Now you're ready for execute the emulator in a console with this command:<br> <pre>qemu-system-arm -M igep -m 512 -clock unix -serial stdio -drive file=igep-nano.img,if=sd,cache=writeback -usb -monitor telnet:localhost:7100,server,nowait,nodelay -device usb-kbd -device usb-mouse</pre> Parameters:<br>
igep-nano.img2m&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 106496&nbsp;&nbsp;&nbsp;&nbsp; 1048575&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 470016&nbsp;&nbsp; 83&nbsp; Linux (Root filesystem)<br>: Memory assigned to the Virtualized board in Mega Bytes.
Optionally you can mount the partitions in you host PC and modify the content [[Image:QEMU boot.png|thumb|center]] == Tips == === Resize Rootfs Partition === We will resize our rootfs partition adding 1 GB at end.  First we create a new raw file using qemu-img as:<brpre>$ qemu-img create -f raw addon.raw 1G </pre>First PartitionWith addon.raw we concatenate it at end of our image file as: <pre>$ mount -o loop,offset$[63*512] cat addon.raw &gt;&gt; igep-nano.img /mnt/tmp</pre>Next step it's modify the partition table information. We will use cfdisk utility for modify the information. <pre>Second Partition: $ mount -o loop,offset$[106496*512] sudo cfdisk igep-nano.img /mnt/tmp </pre>Now youNext step it're ready for execute s select your rootfs partition as this picture shows  [[Image:Cfdisk change size partition.png|thumb|center]]Select the emulatormenu '''RESIZE''' and select '''CHANGE&nbsp;SIZE'''&nbsp;option.  [[Image:Cfdisk change size partition option.png|thumb|center]]Select resize at '''END'''.  [[Image:<br>Cfdisk resize end.png|thumb|center]]Enter the MAX new size and press enter key.  We will write the changes to the disk using the '''commit''' menu option and select '''YES''' (confirm the changes).  The next step it's update the file-system structure. <pre>qemu$ sudo losetup /dev/loop0 igep-systemnano.img -arm -M igep -m o $[106496*512 ] $ sudo e2fsck -clock unix -serial stdio -drive file=igep-nanof /dev/loop0 e2fsck 1.41.img,if=sd,cache=writeback 14 (22-usb Dec-monitor telnet2010)rootfs:localhostrecovering journalPass 1:7100Checking inodes,serverblocks,nowait,nodelay</pre>and sizesPass 2: Checking directory structurePass 3: Checking directory connectivityPass 4: Checking reference countsParametersPass 5:<br>Checking group summary information
<br>rootfs: ***** FILE SYSTEM WAS MODIFIED *****rootfs: 11969/5579872 files (0.6% non-contiguous), 1126338/22491136 blocks
<br>$ sudo resize2fs /dev/loop0
$ sudo losetup -d /dev/loop0 <br/pre>Now you should see your new partition with your wished new size.
<br>[[Category:Development_tools|QEMU]]