compile-linux-kernel-arm-qemu

Fix Qemu Linux Kernel Compilation Issue

Over the past few days, some readers have noticed a known bug while compiling the qemu linux kernel. This problem can occur for many reasons. Let’s discuss this below.

Updated: ASR Pro

  • 1. Download and install ASR Pro
  • 2. Launch the program and select your language
  • 3. Follow the on-screen instructions to start scanning for problems
  • Improve your computer's performance by clicking here to download the software.

    </p> <p>Last time I experimented, I focused on compiling ARM programs on U-Boot bare-and-hardware; Now I want to compile a real Linux kernel to build ARM from scratch. I don’t have a perfect physical ARM device handy, so instead I use QEMU as before.</p> <p>The main kernel supports QEMU and the VersatilePB platform, so I chose this target for testing purposes only. The toolbox I’ll be using is the EABI Left Hand Toolkit from CodeSourcery. As of the release of the 2010q1 toolkit, the manual explicitly states that the compiler should not be used primarily for developing the Linux kernel; it was still possible to use the GNU/Linux toolset for the same domain.</p> <p>Vanilla version can be downloaded from kernel site. Took org; the most recent (version 2.6.I Unpacked 33) issue into a folder. From this file I ran:</p> <p><img src="/posts/compile-linux-kernel-arm-qemu.png" style="margin-top:20px; margin-bottom:20px; width: 50%; height: auto; display: block; margin: 0 auto;" alt="compile linux kernel arm qemu"></p> <pre><code>make ARCH=arm polyvalent_defconfig</code></pre> <p><img src="https://i.ytimg.com/vi/ARpYV2dIuxI/maxresdefault.jpg" style="margin-top:20px; margin-bottom:20px; display: block; margin: 0 auto;" alt="compile linux kernel arm qemu"></p> <p>This command contains a predefined configuration that is used in the system and can create launch targetscore and inside your VersatilePB board. I wanted to change it a bit, so I ran :</p> <pre><code>make ARCH=arm menuconfig</code></pre> <p><iframe loading="lazy" style="margin-top:20px; margin-bottom:20px; display: block; margin: 0 auto;" width="560" height="315" src="https://www.youtube.com/embed/ARpYV2dIuxI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></p> <p>I’ve removed the Carry module (for simplicity) and enabled EABI enhancement as a binary format (allowing for side effects of the old ABI). This is required to run software compiled with the CodeSourcery toolkit. I exited the menu and saved the configuration, then ran:</p> <pre><code>make ARCH=arm CROSS_COMPILE=arm-none-eabi-all</code></pre> <p>If you are using the GNU/Linux toolkit, you should use the following command instead:</p> <pre><code>make ARCH=arm run cross_compile=arm-none-linux-gnueabi-all</code></pre> <p>This is a build of the main file using a good ARM compiler; The build creates another compressed core between the binaries in a file with a specific name zImage, which can be found via arch/arm/boot. This image can be run from QEMU (assuming you are in the arch/arm/boot directory) with the following prompt:</p> <pre><code>qemu-system-arm -M polyvalentpb -m 128M -kernel zImage</code></pre> <p>QEMU running Der image: linux kernel shows a lot of tutorial messages, then complains it can’t find the baseexternal file system. Next, let’s create the simplest filesystem we can create: it was built from a single “Hello, world” executable that can be built using the entire GNU/Linux source code tool chain. </p> <pre><code>#include <stdio.h>empty function() printf("Hello world!n"); pendant (1);</code></pre> <p>Note: 1 An infinite loop is introduced because whenever Linux first runs software on the root filesystem it is expected that the program will not exit.after installing exactly the GNU/Linux ARM toolkit (note that it is different from the pure EABI toolkit), I ran:</p> <pre><code>arm-none-linux-gnueabi-gcc Test -old-school.c -o test</code></pre> <p>This creates an ARM ELF executable, statically linked as needed (all libraries are still linked together in a separate binary). Now we can create a neat filesystem with the cpio tool and the following:</p> <pre><code>Echo Test | cpio --format=newc -u Rootfs</code></pre> <p>Tool > cpio takes your list of files and creates a corresponding archive; newc format is The most important initramfs system file format known to the Linux kernel. Rootfs The file in our case is a binary file of the image file system containing a single file, that is, the ELF test program. QEMU can be licensed from a binary filesystem image for your current kernel using the initrd option; because the kernel also needs to know that this root filesystem will be in RAM (because this is where QEMU recommends using the initrd binary) and that the main program to run is our research executable, so the command bar looks like this: </p> <div style="background: rgba(156, 156, 156, 0.07);margin:20px 0 20px 0;padding:20px 10px 20px 10px;border: solid 1px rgba(0,0,0,0.03);text-align: left;"><h2>Updated: <a href="https://link.advancedsystemrepairpro.com/d7b96561?clickId=fileologist.com" target="_blank" rel="nofollow">ASR Pro</a></h2> <p>Is your computer running slow? Is it plagued with frustrating errors and problems? Then you need <a href="https://link.advancedsystemrepairpro.com/d7b96561?clickId=fileologist.com" target="_blank" rel="nofollow">ASR Pro</a> the ultimate software for repairing and optimizing your Windows PC. With <a href="https://link.advancedsystemrepairpro.com/d7b96561?clickId=fileologist.com" target="_blank" rel="nofollow">ASR Pro</a>, you can fix any Windows issue with just a few clicks including the dreaded Blue Screen of Death. Plus, the software will detect and resolve files and applications that are crashing frequently, so you can get back to work as quickly as possible. Don't let your computer hold you back download <a href="https://link.advancedsystemrepairpro.com/d7b96561?clickId=fileologist.com" target="_blank" rel="nofollow">ASR Pro</a> today!</p> <br><a href="https://link.advancedsystemrepairpro.com/d7b96561?clickId=fileologist.com" target="_blank" rel="nofollow" alt="download"><img src="/wp-content/download1.png" style="width:340px;"></a></div> <pre><code>qemu-system-arm -M universalpb -m 128M -kernel zImage -initrd rootfs -append"root=/dev/ram rdinit=/test"</code></pre> <p>The QEMU window displays the startup messages everyone has seen before, but the completion line says “Hello a World!” Then we will talk about creating a working file system with a command shell and at least basic functionality.</p> </section> </p> <a href="https://link.advancedsystemrepairpro.com/d7b96561?clickId=fileologist.com" target="_blank" rel="nofollow"> Improve your computer's performance by clicking here to download the software. </a> </p> <p><a href="https://fileologist.com/sv/atgarda-problem-med-qemu-linux-karnsystem/" class="translate">Kompilera Linux Karnarm Qemu</a><br /> <a href="https://fileologist.com/pt/corrigir-o-problema-de-compilacao-do-kernel-do-qemu-red-hat/" class="translate">Compilar O Kernel Linux Arm Qemu</a><br /> <a href="https://fileologist.com/es/solucionar-el-problema-del-sistema-kernel-de-qemu-linux/" class="translate">Compilar Linux Kernel Brazo Qemu</a><br /> <a href="https://fileologist.com/pl/napraw-problem-z-kompilacja-jadra-qemu-linux/" class="translate">Skompiluj Ramie Jadra Linuxa Qemu</a><br /> <a href="https://fileologist.com/ko/qemu-linux-%ec%bb%a4%eb%84%90-%ec%8b%9c%ec%8a%a4%ed%85%9c-%eb%ac%b8%ec%a0%9c-%ec%88%98%ec%a0%95/" class="translate">리눅스 커널 암 Qemu 컴파일</a><br /> <a href="https://fileologist.com/ru/%d0%b8%d1%81%d0%bf%d1%80%d0%b0%d0%b2%d0%b8%d1%82%d1%8c-%d1%81%d0%b8%d1%81%d1%82%d0%b5%d0%bc%d0%bd%d1%83%d1%8e-%d0%bf%d1%80%d0%be%d0%b1%d0%bb%d0%b5%d0%bc%d1%83-%d1%81-%d1%8f%d0%b4%d1%80%d0%be%d0%bc-qem/" class="translate">Skompilirovat Qemu Yadra Yadra Linux</a><br /> <a href="https://fileologist.com/nl/probleem-met-qemu-linux-kernelsysteem-oplossen/" class="translate">Compileer Linux Kernelarm Qemu</a><br /> <a href="https://fileologist.com/fr/resoudre-qemu-unix-comme-probleme-de-compilation-du-noyau/" class="translate">Compiler Le Bras Du Noyau Linux Qemu</a><br /> <a href="https://fileologist.com/it/risolto-il-problema-di-compilazione-del-kernel-qemu-ubuntu/" class="translate">Compilare Kernel Linux Arm Qemu</a><br /> <a href="https://fileologist.com/de/problem-mit-dem-qemu-linux-kernel-system-behoben/" class="translate">Linux Kernel Arm Qemu Kompilieren</a></p> <div class="saboxplugin-wrap" itemtype="http://schema.org/Person" itemscope itemprop="author"><div class="saboxplugin-tab"><div class="saboxplugin-gravatar"><img src="https://fileologist.com/wp-content/uploads/garywall.jpg" width="100" height="100" alt="Gary Wall" itemprop="image"></div><div class="saboxplugin-authorname"><a href="https://fileologist.com/author/garywall/" class="vcard author" rel="author" itemprop="url"><span class="fn" itemprop="name">Gary Wall</span></a></div><div class="saboxplugin-desc"><div itemprop="description"></div></div><div class="clearfix"></div></div></div><div class='yarpp yarpp-related yarpp-related-website yarpp-template-thumbnails'> <!-- YARPP Thumbnails --> <h3>Related posts:</h3> <div class="yarpp-thumbnails-horizontal"> <a class='yarpp-thumbnail' rel='norewrite' href='https://fileologist.com/en/linux-kernel-lvm/' title='Fix Lvm Linux Kernel Issue'> <img width="150" height="150" src="https://fileologist.com/wp-content/uploads/2022/02/linux-kernel-lvm-150x150.png" class="attachment-thumbnail size-thumbnail wp-post-image" alt="" loading="lazy" data-pin-nopin="true" srcset="https://fileologist.com/wp-content/uploads/2022/02/linux-kernel-lvm-150x150.png 150w, https://fileologist.com/wp-content/uploads/2022/02/linux-kernel-lvm-298x300.png 298w, https://fileologist.com/wp-content/uploads/2022/02/linux-kernel-lvm-120x120.png 120w, https://fileologist.com/wp-content/uploads/2022/02/linux-kernel-lvm.png 400w" sizes="(max-width: 150px) 100vw, 150px" /><span class="yarpp-thumbnail-title">Fix Lvm Linux Kernel Issue</span></a> <a class='yarpp-thumbnail' rel='norewrite' href='https://fileologist.com/en/compilation-debug-true/' title='How To Easily Fix Debug Compilation = True'> <img width="150" height="150" src="https://fileologist.com/wp-content/uploads/2021/11/compilation-debug-true-150x150.png" class="attachment-thumbnail size-thumbnail wp-post-image" alt="" loading="lazy" data-pin-nopin="true" srcset="https://fileologist.com/wp-content/uploads/2021/11/compilation-debug-true-150x150.png 150w, https://fileologist.com/wp-content/uploads/2021/11/compilation-debug-true-120x120.png 120w" sizes="(max-width: 150px) 100vw, 150px" /><span class="yarpp-thumbnail-title">How To Easily Fix Debug Compilation = True</span></a> <a class='yarpp-thumbnail' rel='norewrite' href='https://fileologist.com/en/vba-compile-error-in-hidden-module/' title='How To Fix Vba Compilation Error In Hidden Module Easily'> <img width="150" height="150" src="https://fileologist.com/wp-content/uploads/2022/02/vba-compile-error-in-hidden-module-150x150.jpg" class="attachment-thumbnail size-thumbnail wp-post-image" alt="" loading="lazy" data-pin-nopin="true" srcset="https://fileologist.com/wp-content/uploads/2022/02/vba-compile-error-in-hidden-module-150x150.jpg 150w, https://fileologist.com/wp-content/uploads/2022/02/vba-compile-error-in-hidden-module-120x120.jpg 120w" sizes="(max-width: 150px) 100vw, 150px" /><span class="yarpp-thumbnail-title">How To Fix Vba Compilation Error In Hidden Module Easily</span></a> <a class='yarpp-thumbnail' rel='norewrite' href='https://fileologist.com/en/mpfr-compile-error/' title='I Have A Problem With Mpfr Compilation Error'> <img width="150" height="150" src="https://fileologist.com/wp-content/uploads/2022/03/mpfr-compile-error-150x150.png" class="attachment-thumbnail size-thumbnail wp-post-image" alt="" loading="lazy" data-pin-nopin="true" srcset="https://fileologist.com/wp-content/uploads/2022/03/mpfr-compile-error-150x150.png 150w, https://fileologist.com/wp-content/uploads/2022/03/mpfr-compile-error-120x120.png 120w" sizes="(max-width: 150px) 100vw, 150px" /><span class="yarpp-thumbnail-title">I Have A Problem With Mpfr Compilation Error</span></a> </div> </div> <div class="clear"></div> </div> <footer class="entry-meta"> <div class="entry-tax"> <span>Tags: </span><a href="https://fileologist.com/tag/android/" rel="tag">android</a><i>, </i><a href="https://fileologist.com/tag/android-emulator/" rel="tag">android emulator</a><i>, </i><a href="https://fileologist.com/tag/buildroot/" rel="tag">buildroot</a><i>, </i><a href="https://fileologist.com/tag/debian/" rel="tag">debian</a><i>, </i><a href="https://fileologist.com/tag/debug/" rel="tag">debug</a><i>, </i><a href="https://fileologist.com/tag/embedded-linux/" rel="tag">embedded linux</a><i>, </i><a href="https://fileologist.com/tag/gdb/" rel="tag">gdb</a><i>, </i><a href="https://fileologist.com/tag/gdbserver/" rel="tag">gdbserver</a><i>, </i><a href="https://fileologist.com/tag/kernel-panic/" rel="tag">kernel panic</a><i>, </i><a href="https://fileologist.com/tag/kill-init/" rel="tag">kill init</a><i>, </i><a href="https://fileologist.com/tag/raspberry-pi/" rel="tag">raspberry pi</a><i>, </i><a href="https://fileologist.com/tag/raspbian/" rel="tag">raspbian</a><i>, </i><a href="https://fileologist.com/tag/u-boot/" rel="tag">u boot</a><i>, </i><a href="https://fileologist.com/tag/uboot/" rel="tag">uboot</a><i>, </i><a href="https://fileologist.com/tag/virtual-machine/" rel="tag">virtual machine</a><i>, </i><a href="https://fileologist.com/tag/x86/" rel="tag">x86</a> </div> <div class="aux-single-post-share"> <div class="aux-tooltip-socials aux-tooltip-dark aux-socials aux-icon-left aux-medium aux-tooltip-social-no-text" > <span class="aux-icon auxicon-share" ></span> </div> </div> </footer> </div> <nav class="aux-next-prev-posts nav-skin-minimal"> <section class="np-prev-section " > <a href="https://fileologist.com/en/u-s-postal-service-package-weight-limits/"> <div class="np-arrow"> <div class="aux-arrow-nav aux-hover-slide aux-round aux-outline aux-medium"> <span class="aux-overlay"></span> <span class="aux-svg-arrow aux-medium-left"></span> <span class="aux-hover-arrow aux-svg-arrow aux-medium-left aux-white"></span> </div> </div> <p class="np-nav-text">Previous Post</p> <h4 class="np-title">Solutions For Us Parcel Weight Limits</h4> </a> </section> <section class="np-next-section " > <a href="https://fileologist.com/en/error-1509/"> <div class="np-arrow"> <div class="aux-arrow-nav aux-hover-slide aux-round aux-outline aux-medium"> <span class="aux-overlay"></span> <span class="aux-svg-arrow aux-medium-right"></span> <span class="aux-hover-arrow aux-svg-arrow aux-medium-right aux-white"></span> </div> </div> <p class="np-nav-text">Next Post</p> <h4 class="np-title">The Best Way To Fix Error 1509</h4> </a> </section> </nav> </article> </div><!-- end content --> </div><!-- end primary --> <aside class="aux-sidebar aux-sidebar-primary"> <div class="sidebar-inner"> <div class="sidebar-content"> <div class="aux-widget-area"><section id="search-2" class=" aux-open widget-container widget_search"> <form method="get" id="searchform" class="searchform" action="https://fileologist.com/"> <input type="text" class="field" name="s" id="s" placeholder="Search Here" value="" /> <input type="submit" class="submit" name="submit" id="searchsubmit" value="Search" /> </form> </section></div> </div><!-- end sidebar-content --> </div><!-- end sidebar-inner --> </aside><!-- end primary siderbar --> </div><!-- end container --> </div><!-- end wrapper --> </main><!-- end main --> <footer id="sitefooter" class="aux-site-footer" > <div class="aux-wrapper aux-float-layout"> <div class="aux-container aux-fold aux-float-wrapper"><div id="copyright" class="aux-copyright aux-start aux-middle "><small>© 2022 Fileologist. All rights reserved.</small></div><section class="widget-socials aux-socials-container aux-end aux-middle aux-tablet-off aux-phone-off aux-socials-footer aux-horizontal aux-small"> <ul class="aux-social-list"> </ul><!-- end socials --> </section><!-- end socials container --> </div> <!-- end navigation --> </div><!-- end wrapper --> </footer><!-- end sitefooter --> </div><!--! end of #inner-body --> <div class="aux-hidden-blocks"> <section id="offmenu" class="aux-offcanvas-menu aux-pin-left" > <div class="aux-panel-close"> <div class="aux-close aux-cross-symbol aux-thick-medium"></div> </div> <div class="offcanvas-header"> </div> <div class="offcanvas-content"> </div> <div class="offcanvas-footer"> </div> </section> <!-- offcanvas section --> <section id="offcart" class="aux-offcanvas-menu aux-offcanvas-cart aux-pin-left" > <div class="aux-panel-close"> <div class="aux-close aux-cross-symbol aux-thick-medium"></div> </div> <div class="offcanvas-header"> Shopping Basket </div> <div class="aux-cart-wrapper aux-elegant-cart aux-offcart-content"> </div> </section> <!-- cartcanvas section --> <section id="fs-menu-search" class="aux-fs-popup aux-fs-menu-layout-center aux-indicator"> <div class="aux-panel-close"> <div class="aux-close aux-cross-symbol aux-thick-medium"></div> </div> <div class="aux-fs-menu"> </div> <div class="aux-fs-search"> <div class="aux-search-section "> <div class="aux-search-form "> <form action="https://fileologist.com/" method="get" > <div class="aux-search-input-form"> <input type="text" class="aux-search-field" placeholder="Type here.." name="s" autocomplete="off" /> </div> <input type="submit" class="aux-black aux-search-submit aux-uppercase" value="Search" > </form> </div><!-- end searchform --> </div> </div> </section> <!-- fullscreen search and menu --> <section id="fs-search" class="aux-fs-popup aux-search-overlay has-ajax-form"> <div class="aux-panel-close"> <div class="aux-close aux-cross-symbol aux-thick-medium"></div> </div> <div class="aux-search-field"> <div class="aux-search-section aux-404-search"> <div class="aux-search-form aux-iconic-search"> <form action="https://fileologist.com/" method="get" > <div class="aux-search-input-form"> <input type="text" class="aux-search-field" placeholder="Search..." name="s" autocomplete="off" /> </div> <div class="aux-submit-icon-container auxicon-search-4 "> <input type="submit" class="aux-iconic-search-submit" value="Search" > </div> </form> </div><!-- end searchform --> </div> </div> </section> <!-- fullscreen search--> <div class="aux-scroll-top"></div> </div> <div class="aux-goto-top-btn aux-align-btn-right" data-animate-scroll="1"><div class="aux-hover-slide aux-arrow-nav aux-round aux-outline"> <span class="aux-overlay"></span> <span class="aux-svg-arrow aux-h-small-up"></span> <span class="aux-hover-arrow aux-svg-arrow aux-h-small-up aux-white"></span></div></div> <!-- outputs by wp_footer --> <link rel='stylesheet' id='yarppRelatedCss-css' href='https://fileologist.com/wp-content/plugins/yet-another-related-posts-plugin/style/related.css?ver=5.27.8' media='all' /> <script src='https://fileologist.com/wp-content/plugins/contact-form-7/includes/swv/js/index.js?ver=5.6.3' id='swv-js'></script> <script id='contact-form-7-js-extra'> var wpcf7 = {"api":{"root":"https:\/\/fileologist.com\/wp-json\/","namespace":"contact-form-7\/v1"}}; </script> <script src='https://fileologist.com/wp-content/plugins/contact-form-7/includes/js/index.js?ver=5.6.3' id='contact-form-7-js'></script> <script src='https://fileologist.com/wp-includes/js/imagesloaded.min.js?ver=4.1.4' id='imagesloaded-js'></script> <script src='https://fileologist.com/wp-includes/js/masonry.min.js?ver=4.2.2' id='masonry-js'></script> <script src='https://fileologist.com/wp-content/themes/phlox/js/plugins.min.js?ver=2.10.0' id='auxin-plugins-js'></script> <script src='https://fileologist.com/wp-content/themes/phlox/js/scripts.min.js?ver=2.10.0' id='auxin-scripts-js'></script> <!-- end wp_footer --> </body> </html>