{"id":2405,"date":"2011-11-13T12:01:00","date_gmt":"2011-11-13T11:01:00","guid":{"rendered":"http:\/\/touk.pl\/blog\/?guid=b5f7469cf134721d9b4b1dce0510c2c6"},"modified":"2023-03-22T12:18:57","modified_gmt":"2023-03-22T11:18:57","slug":"running-qt4-examples-on-embedded-linux-using-arm-emulator","status":"publish","type":"post","link":"https:\/\/touk.pl\/blog\/2011\/11\/13\/running-qt4-examples-on-embedded-linux-using-arm-emulator\/","title":{"rendered":"Running Qt4 Examples on Embedded Linux using ARM emulator"},"content":{"rendered":"<p>In this article I will show how to run Qt4-Embedded Examples on Angstrom Linux using QEMU. The procedure doesn&#8217;t require any compilation or cross compilation. It uses Angstrom Linux precompiled packages, online image builder, and works both on Windows and Linux. Qt4 Embedded allows to run Qt applications directly in Linux Framebuffer, bypassing X Windows completely. This is especially important during embedded development, because it allows to save a lot of memory and start up time. Qt4 has a rich set of examples directly embedded into Qt sources. Below is a few samples of how it looks like:<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a style=\"margin-left: 1em;margin-right: 1em\" href=\"http:\/\/4.bp.blogspot.com\/-jUm0ASwaFq0\/Tr-hgg0YI2I\/AAAAAAAAAG8\/TzNh1CODlF8\/s1600\/path-stroking.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/4.bp.blogspot.com\/-jUm0ASwaFq0\/Tr-hgg0YI2I\/AAAAAAAAAG8\/TzNh1CODlF8\/s400\/path-stroking.png\" alt=\"\" width=\"400\" height=\"315\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a style=\"margin-left: 1em;margin-right: 1em\" href=\"http:\/\/1.bp.blogspot.com\/-tVh_Fr_p7zk\/Tr-hlnMtt0I\/AAAAAAAAAHI\/ym51KOisNuQ\/s1600\/tetrix.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/1.bp.blogspot.com\/-tVh_Fr_p7zk\/Tr-hlnMtt0I\/AAAAAAAAAHI\/ym51KOisNuQ\/s400\/tetrix.png\" alt=\"\" width=\"400\" height=\"315\" border=\"0\" \/><\/a><\/div>\n<p>I will show how to run them. First, you need to install QEMU. For Windows, the easiest way is to download zipped executables, which I shared here:<\/p>\n<p><a href=\"http:\/\/www.4shared.com\/folder\/hjxINbny\/embedded.html\">Qemu-windows-0151<\/a>. For Linux it&#8217;s usually <strong>apt-get install qemu-system<\/strong>. Then, we need to build Angstrom image. For those unpatient, I shared a prebuilt image here: <a href=\"http:\/\/www.4shared.com\/folder\/hjxINbny\/embedded.html\">angstrom-qt4-embedded<\/a>. Angstrom has online image builder available here: <a href=\"http:\/\/narcissus.angstrom-distribution.org\">Angstrom Image Builder<\/a>. You need to pick console image and download it. The small trick is that you need to download kernel image yourself (from here: <a href=\"http:\/\/feeds.angstrom-distribution.org\/feeds\/unstable\/ipk\/glibc\/armv5te\/machine\/qemuarm\/kernel-image-2.6.37.2_2.6.37-r4.6_qemuarm.ipk\">kernel-image-2.6.37.2_2.6.37-r4.6_qemuarm.ipk<\/a>) and unpack it using <strong>ar -x kernel-image.ipk<\/strong> command. This is because online image builder doesn&#8217;t include kernel image for some reason. However this step is not required if you download the image I shared. Next, you need to start QEMU using kernel image and prebuilt angstrom image. The command looks like this: <strong>qemu-system-arm -M versatilepb -usb -usbdevice wacom-tablet -show-cursor -m 64 -kernel zImage-2.6.37.2 -hda disk.img -append &#8220;root=\/dev\/sda2 rw&#8221;<\/strong> For convenience, I prepared <strong>run<\/strong> script, which does that. Next, you need to login as root and install qt4-embedded using command: <strong>opkg install qt4-embedded<\/strong>. This can be again skipped if you use the image I prepared. In order to run demos, you need to use this command: <strong>qtdemoE -qws<\/strong> It looks like this:<\/p>\n<div class=\"separator\" style=\"clear: both;text-align: center\"><a style=\"margin-left: 1em;margin-right: 1em\" href=\"http:\/\/2.bp.blogspot.com\/-yMcGfePvTh0\/Tr-fnEwUsTI\/AAAAAAAAAGw\/31Jk69Wji48\/s1600\/angstrom-console.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/2.bp.blogspot.com\/-yMcGfePvTh0\/Tr-fnEwUsTI\/AAAAAAAAAGw\/31Jk69Wji48\/s400\/angstrom-console.png\" alt=\"\" width=\"600\" height=\"472\" border=\"0\" \/><\/a><\/div>\n<p>You can run the other examples from Qt, in standalone mode from<\/p>\n<p><strong>\/usr\/bin\/qtopia<\/strong> directory. You need to use similar command <strong>app -qws<\/strong>. The command is required to initialize Qt framebuffer. It is possible to run a few executables on the same display. In order to do this, you need to run the first one only with <strong>qws<\/strong> parameter. The other apps will connect to it. Have fun!<\/p>\n","protected":false},"excerpt":{"rendered":"In this article I will show how to run Qt4-Embedded Examples on Angstrom Linux using QEMU. The procedure&hellip;\n","protected":false},"author":35,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[693,697],"_links":{"self":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/2405"}],"collection":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/comments?post=2405"}],"version-history":[{"count":12,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/2405\/revisions"}],"predecessor-version":[{"id":15479,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/posts\/2405\/revisions\/15479"}],"wp:attachment":[{"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/media?parent=2405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/categories?post=2405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/touk.pl\/blog\/wp-json\/wp\/v2\/tags?post=2405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}