<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ruly-rudel</title>
    <description>The latest articles on DEV Community by ruly-rudel (@rulyrudel).</description>
    <link>https://dev.to/rulyrudel</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F51473%2F1b38570f-bd11-4db9-a011-a8727378bd03.png</url>
      <title>DEV Community: ruly-rudel</title>
      <link>https://dev.to/rulyrudel</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rulyrudel"/>
    <language>en</language>
    <item>
      <title>How to execute u-boot on qemu-system-arm</title>
      <dc:creator>ruly-rudel</dc:creator>
      <pubDate>Thu, 28 Dec 2017 03:14:41 +0000</pubDate>
      <link>https://dev.to/rulyrudel/how-to-execute-u-boot-on-qemu-system-arm-2b22</link>
      <guid>https://dev.to/rulyrudel/how-to-execute-u-boot-on-qemu-system-arm-2b22</guid>
      <description>&lt;h1&gt;
  
  
  Summary
&lt;/h1&gt;

&lt;p&gt;Currently, I check u-boot execution on qemu-system-arm with VExpress A9 environment. In this document, an u-boot built for ARM EABI with hardware-floating-point-instructions at ELF format is attached directly to the qemu DRAM area using -kernel option. Boot from Flash device will be next step.&lt;/p&gt;

&lt;h1&gt;
  
  
  Environment
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;ubuntu-ja-16.04&lt;/li&gt;
&lt;li&gt;gcc 5.4.0&lt;/li&gt;
&lt;li&gt;arm-linux-gnueabihf-gcc 5.4.0&lt;/li&gt;
&lt;li&gt;qemu 2.5.0&lt;/li&gt;
&lt;li&gt;u-boot 2017.11&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  Tool instration
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;g++-arm-linxu-gnueabihf
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;qemu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Build u-boot
&lt;/h1&gt;

&lt;p&gt;At first, get a tarball of u-boot 2017.11 from &lt;a href="https://www.amazon.com/clouddrive/share/HtTEzbceyJDyHv7anDLboEjTe0OkFbYReMxRp3CF20n/folder/R_7ocFWRQ9SjOtOWX1EWLQ?_encoding=UTF8&amp;amp;mgh=1&amp;amp;ref_=cd_ph_share_link_copy"&gt;Official u-boot distribution site&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;bzcat u-boot-2017.11.tar.bz2 | &lt;span class="nb"&gt;tar &lt;/span&gt;xvf -
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;u-boot-2017.11
&lt;span class="nv"&gt;$ &lt;/span&gt;make vexpress_ca9x4_defconfig &lt;span class="nv"&gt;CROSS_COMPILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;arm-linux-gnueabihf-
&lt;span class="nv"&gt;$ &lt;/span&gt;make all &lt;span class="nv"&gt;CROSS_COMPILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;arm-linux-gnueabihf-
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Execute u-boot on qemu
&lt;/h1&gt;

&lt;p&gt;-nographic option disables framebuffer and redirect tty via UART to stdin/stdout. Also, with -no-reboot option causes reset command on u-boot to quit qemu.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;qemu-system-arm &lt;span class="nt"&gt;-machine&lt;/span&gt; vexpress-a9 &lt;span class="nt"&gt;-nographic&lt;/span&gt; &lt;span class="nt"&gt;-no-reboot&lt;/span&gt; &lt;span class="nt"&gt;-kernel&lt;/span&gt; u-boot
pulseaudio: set_sink_input_volume&lt;span class="o"&gt;()&lt;/span&gt; failed
pulseaudio: Reason: Invalid argument
pulseaudio: set_sink_input_mute&lt;span class="o"&gt;()&lt;/span&gt; failed
pulseaudio: Reason: Invalid argument


U-Boot 2017.11 &lt;span class="o"&gt;(&lt;/span&gt;Dec 29 2017 - 16:07:51 +0900&lt;span class="o"&gt;)&lt;/span&gt;

DRAM:  128 MiB
WARNING: Caches not enabled
Flash: 128 MiB
MMC:   MMC: 0
&lt;span class="k"&gt;***&lt;/span&gt; Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   smc911x-0
Hit any key to stop autoboot:  0 
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; reset
resetting ...
&lt;span class="nv"&gt;$ &lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
  </channel>
</rss>
