<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_Wu.Country@侠缘</title><subtitle type="text">勤学似春起之苗，不见其增，日有所长；辍学如磨刀之石，不见其损，日所有亏!</subtitle><id>http://feed.cnblogs.com/blog/u/15485/rss</id><updated>2012-05-02T12:46:38Z</updated><author><name>Wu.Country@侠缘</name><uri>http://www.cnblogs.com/WuCountry/</uri></author><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/WuCountry/"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/15485/rss"/><entry><id>http://www.cnblogs.com/WuCountry/archive/2012/05/02/2479476.html</id><title type="text">An Introduction to the Linux-based Assignments</title><summary type="text">An Introduction to the Linux-based AssignmentsNote: Please use the class discussion board (you can find it on yourblackboard) as a communication and Q&amp;A tool. Should you still need to send an e-mail inquiry, address it to the TA (Li Lu: llu at cs ...) and cc the instructor.A few words about QEMU</summary><published>2012-05-02T11:37:00Z</published><updated>2012-05-02T11:37:00Z</updated><author><name>Wu.Country@侠缘</name><uri>http://www.cnblogs.com/WuCountry/</uri></author><link rel="alternate" href="http://www.cnblogs.com/WuCountry/archive/2012/05/02/2479476.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/WuCountry/archive/2012/05/02/2479476.html"/><content type="html">&lt;p&gt;&lt;strong&gt;An Introduction to the Linux-based Assignments&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Please use the class discussion board (you can find it on your&amp;nbsp;&lt;a href="http://my.rochester.edu/"&gt;blackboard&lt;/a&gt;) as a communication and Q&amp;amp;A tool.&amp;nbsp; Should you still need to send an e-mail inquiry, address it to the TA (Li Lu: llu at cs ...) and cc the instructor.&amp;nbsp;&lt;br /&gt;&lt;/p&gt;&lt;table celpadding="3" border="0" cellspacing="2" hspace="4" width="100%" style="font-family: Simsun; "&gt;&lt;tbody&gt;&lt;tr bgcolor="#e0e0e8"&gt;&lt;td width="100%"&gt;&lt;nobr&gt;&lt;strong&gt;A few words about QEMU and Linux&lt;/strong&gt;&lt;/nobr&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;Linux is a&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.fsf.org/" style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;Free&lt;/a&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&amp;nbsp;Operating System kernel originally spear-headed by Linus Torvalds. It has been adopted by many UNIX-like Operating Systems distributors. GNU/Linux is a variant that is built around the Linux kernel and software (compiler, libraries, shell, etc.) by the&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.gnu.org/" style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;GNU&lt;/a&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&amp;nbsp;Project.&lt;/span&gt;&lt;a href="http://www.debian.org/" style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;Debian&lt;/a&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&amp;nbsp;is a Free GNU/Linux distribution. We will be using Linux kernel 2.6.26.5 from the&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.kernel.org/" style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;kernel repository&lt;/a&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;. We will be using a stable Debian release (&lt;/span&gt;&lt;a href="http://www.debian.org/News/2008/20080726" style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;Etch&lt;/a&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;) as the distribution with which we test our Linux kernel modifications.&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;a href="http://bellard.org/qemu/" style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;QEMU&lt;/a&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&amp;nbsp;(Q Emulator) is a processor emulator that began as a project by Fabrice Bellard. It is&amp;nbsp;&lt;/span&gt;&lt;a href="http://bellard.org/qemu/license.html" style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;also Free&lt;/a&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&amp;nbsp;software, can emulate many different CPUs, and it is stable and fast (QEMU relies on dynamic binary translation to achieve reasonable performance, but can also use a virtualizer to boost it even more). QEMU is a full system emulator so it can give you access to the network and emulate your peripheral devices; we will be providing you with a file, which is the virtual disk image where Debian is installed. We will be using QEMU (v0.10.16 from the repository) to virtualize a whole Debian system with an i386 CPU.&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;The bundle of QEMU as the system emulator, Debian GNU/Linux as the system, and the latest Linux kernel will be our testbed for Linux kernel development. We will be referring to it as QDGL from now on (QEMU - Debian GNU/Linux). We will be referring to your desktop or whatever machine you run QDGL on, as the host OS, and the virtualized Debian GNU/Linux as the guest OS.&amp;nbsp;&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;table celpadding="3" border="0" cellspacing="2" hspace="4" width="100%" style="font-family: Simsun; "&gt;&lt;tbody&gt;&lt;tr bgcolor="#e0e0e8"&gt;&lt;td width="100%"&gt;&lt;nobr&gt;&lt;strong&gt;QDGL Disclaimer&lt;/strong&gt;&lt;/nobr&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; font-weight: bold; "&gt;The QDGL bundle is a bundle of Free software and is also available as such and without any guarantee.&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;You are not required to use QDGL; you can build your own configuration or use any other tool you want, but you will have to confirm your assignment works on QDGL. For the purpose of this class, QDGL has been pre-configured for your convinience, so it is suggested that, though you can build your own configuration, you stick to the one provided. Since this is the first time we will be using this platform, we might experience bugs occasionally; we will need your cooperation to fix them, so make sure you communicate the bugs and problems you might experience. More importantly,&lt;/span&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; font-weight: bold; "&gt;make sure you make backups of your work regularly&lt;/span&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;.&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;table celpadding="3" border="0" cellspacing="2" hspace="4" width="100%" style="font-family: Simsun; "&gt;&lt;tbody&gt;&lt;tr bgcolor="#e0e0e8"&gt;&lt;td width="100%"&gt;&lt;nobr&gt;&lt;strong&gt;QDGL: List of files you 'll need and how to acquire them&lt;br /&gt;&lt;/strong&gt;&lt;/nobr&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;In the QEMU/Linux assignments, you are required to use QDGL to modify and test a Linux kernel. You will be using your personal cs/csug accounts for development.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;First you need to copy QDGL to your directory. You will need ~562MB just to grab QDGL, and another ~400M as soon as you untar and compile the kernel, so&amp;nbsp;&lt;span style="font-weight: bold; "&gt;make sure you have at least 1GB of free disk space in your account&lt;/span&gt;&amp;nbsp;(the instructor and system administrators have made sure you have the appropriate allocation). We will be using a stock kernel from the kernel repository, version 2.6.26.5 (pre-configured).&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Below is the list of the contents of QDGL:&lt;/p&gt;&lt;ul style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;linux-2.6.26.5.tar.bz2&lt;/span&gt;&amp;nbsp;: The Linux kernel. You will have to untar it and compile it with any modifications suggested per assignment.&lt;br /&gt;&lt;/li&gt;&lt;li style="font-weight: bold; "&gt;hda.img&amp;nbsp;&lt;span style="font-weight: normal; "&gt;: Debian's virtual disk image. Your disk is&amp;nbsp; seen by the linux kernel as device /dev/hda - more about this below.&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Do not touch this file&lt;/strong&gt;&lt;span style="font-weight: normal; "&gt;.&lt;/span&gt;&lt;/li&gt;&lt;li style="font-weight: bold; "&gt;&lt;span style="font-weight: normal; "&gt;&lt;span style="font-weight: bold; "&gt;qemu&lt;/span&gt;&amp;nbsp;: This directory holds the binaries of your emulator, QEMU, plus other files QEMU needs to work properly (virtual PC bios, video device, etc.).&amp;nbsp;&lt;/span&gt;&lt;strong&gt;Do not touch anything in this directory&lt;/strong&gt;&lt;span style="font-weight: normal; "&gt;.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;To acquire QDGL&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;ul style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;Undergrads&lt;/span&gt;* : Copy QDGL to your home directory using the following instruction:&amp;nbsp;&lt;strong&gt;&lt;code&gt;cp -r ~cs256/QDGL ~&lt;/code&gt;&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;Grads&lt;/span&gt;** : Copy QDGL to your home directory using the following instruction:&lt;small&gt;&amp;nbsp;&lt;/small&gt;&lt;strong&gt;&lt;code&gt;cp -r ~cs456/QDGL ~&lt;/code&gt;&lt;/strong&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;small&gt;&lt;span style="font-style: italic; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/small&gt;&lt;/li&gt;&lt;/ul&gt;&lt;small style="font-family: Simsun; line-height: normal; "&gt;&lt;span style="font-style: italic; "&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp; Or anyone with access only to the undergrad network&lt;br /&gt;** Or&lt;/span&gt;&lt;/small&gt;&lt;small style="font-family: Simsun; line-height: normal; "&gt;&lt;span style="font-style: italic; "&gt;&amp;nbsp;anyone with access&amp;nbsp;&lt;/span&gt;&lt;/small&gt;&lt;small style="font-family: Simsun; line-height: normal; "&gt;&lt;span style="font-style: italic; "&gt;only to the grad network&lt;/span&gt;&lt;/small&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;small style="font-family: Simsun; line-height: normal; "&gt;&lt;span style="font-style: italic; "&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/small&gt;&lt;table celpadding="3" border="0" cellspacing="2" hspace="4" width="100%" style="font-family: Simsun; "&gt;&lt;tbody&gt;&lt;tr bgcolor="#e0e0e8"&gt;&lt;td width="100%"&gt;&lt;nobr&gt;&lt;strong&gt;QDGL: Test driving your system&lt;br /&gt;&lt;/strong&gt;&lt;/nobr&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;To take a look at the default Debian installation, move into your copy of the QDGL directory (&lt;/span&gt;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;cd QDGL&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;), and on your terminal run the following instruction:&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;./qemu/bin/qemu -m 64M -L ./qemu/share/qemu/ -hda hda.img -nographic&lt;br /&gt;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;Explanation:&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;ul style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;./qemu/bin/qemu&lt;/span&gt;&amp;nbsp;: execute the emulator binary&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;-m 64M&amp;nbsp;&lt;/span&gt;: tell the emulator that the emulated system will have a physical memory of 64 MB. Feel free to increase this number if your host can accept a larger value&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;-L ./qemu/share/qemu&lt;/span&gt;&amp;nbsp;: tell the emulator where to find the virtual pc bios and other necessary files for the system emulation&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;-hda hda.img&amp;nbsp;&lt;/span&gt;: tell the emulator which file will act as the virtual hard disk image - this file should appear as device /dev/hda in the guest GNU/Linux OS&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;-nographic&amp;nbsp;&lt;/span&gt;: tell the emulator to use the&amp;nbsp;&lt;a href="http://www.gnu.org/software/ncurses/"&gt;ncurses&lt;/a&gt;&amp;nbsp;library to draw its interface on your terminal&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;Alternatively, if you choose to use the SDL interface, you can simply neglect the last parameter (-nographic). If you have access to the X server of your Linux host, you should also be able to see a virtual monitor in a separate window (this option uses the SDL libraries, which you should already have installed) instead of the terminal.&amp;nbsp;&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;This should boot Debian from the virtual disk, with the distribution kernel. You will be prompted by the boot loader to choose the kernel to boot (&lt;/span&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; font-style: italic; "&gt;Press any key to continue&lt;/span&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;) - you can safely just wait 5sec, which will start the default kernel, or you can pick it yourself in the grub menu.&amp;nbsp; After the kernel log messages, you will be prompted with the login ; the system is called cs2456. Below are the two accounts which already exist in the system&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;USER: root&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PASS:***&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;USER: cs2456&amp;nbsp; PASS:***&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; font-weight: bold; "&gt;The passwords to those accounts will be handed over in class. You should change your personal virtual machine passwords as soon as possible. You should not enter as root unless you absolutely need to.&amp;nbsp;&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;Hitting the command&amp;nbsp;&lt;/span&gt;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;uname -a&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&amp;nbsp;you can check the system information -- you should see Debian's pre-installed kernel version (2.6.18-6).&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;You should always make sure you turn off your client properly ; the virtual disk is setup as a journaled ext3 filesystem, but properly shutting down is essential to keep it "clean". Another good habit would be to be taking backups of your virtual disk image at checkpoint events. To turn off your system safely, if logged in as root just type&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;poweroff&lt;br /&gt;&lt;br /&gt;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;otherwise, if logged in as cs2456, type&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;sudo poweroff&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;small style="font-family: Simsun; line-height: normal; "&gt;&lt;span style="font-style: italic; "&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/small&gt;&lt;table celpadding="3" border="0" cellspacing="2" hspace="4" width="100%" style="font-family: Simsun; "&gt;&lt;tbody&gt;&lt;tr bgcolor="#e0e0e8"&gt;&lt;td width="100%"&gt;&lt;nobr&gt;&lt;strong&gt;QDGL : Compiling and testing a new kernel&lt;br /&gt;&lt;/strong&gt;&lt;/nobr&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;For the following we are assuming that you are working on a GNU/Linux environment, such as&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; font-style: italic; "&gt;cycle1.cs/csug&lt;/span&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;. Back to the QDGL directory, and as soon as you have test-driven your default Debian box, you can untar your to-be-modified 2.6.26.5 kernel, by running&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;tar -jxvf linux-2.6.26.5.tar.bz2&lt;br /&gt;&lt;br /&gt;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;To compile your kernel run&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;make&lt;br /&gt;&lt;br /&gt;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;Your newly compiled kernel image is at&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; font-weight: bold; "&gt;arch/x86/boot/bzImage&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;inside your kernel directory (i.e., the&amp;nbsp; directory where you untarred the kernel sources: linux-2.6.26.5 by default and assumed from now on). To test drive your new kernel run&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;./qemu/bin/qemu -m 64M -L ./qemu/share/qemu/ -hda hda.img -nographic&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;&amp;nbsp;-append "root=/dev/hda1 console=ttyS0,115200n8 console=tty0" -kernel linux-2.6.26.5/arch/i386/boot/bzImage&lt;br /&gt;&lt;br /&gt;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;Explanation:&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;ul style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&lt;li&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;span style="font-weight: bold; "&gt;-append "root=/dev/hda1 console=ttyS0,115200n8 console=tty0"&lt;/span&gt;: passes the parameter in quotes to the kernel. The kernel needs to know where the root directory will be to mount it and boot properly. The kernel also needs to know it is displayed on a serial console along with the console parameters if you choose to use a serial display.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;-kernel linux-2.6.26.5/arch/i386/boot/bzImage&lt;/span&gt;: tells the emulator where the external (to the image) kernel to boot lies (full or relative path)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;Now if you login again and type&amp;nbsp;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;uname -a&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&amp;nbsp;you should see that the new kernel version is&amp;nbsp;&lt;/span&gt;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;2.6.26.5&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&amp;nbsp;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;Congratulations, at this point you have managed to boot a kernel you compiled yourself !&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;Every time you make modifications to your linux kernel, you should rebuild it (&lt;/span&gt;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;make&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;) and test it (&lt;/span&gt;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;./qemu/qemu ...&amp;nbsp;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;big style="font-family: Simsun; line-height: normal; "&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;-kernel ...&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;).&amp;nbsp;&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;small style="font-family: Simsun; line-height: normal; "&gt;&lt;/small&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;table celpadding="3" border="0" cellspacing="2" hspace="4" width="100%" style="font-family: Simsun; "&gt;&lt;tbody&gt;&lt;tr bgcolor="#e0e0e8"&gt;&lt;td width="100%"&gt;&lt;nobr&gt;&lt;strong&gt;QDG: Hidden options / tips / tricks&lt;br /&gt;&lt;/strong&gt;&lt;/nobr&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;QDGL is free software and as such comes with no guarantees (please read the&amp;nbsp;&lt;/span&gt;&lt;a href="http://www.cs.rochester.edu/~sandhya/csc256/assignments/qemu_linux.html#disclaimer" style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;Disclaimer&lt;/a&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;). Though the simple procedure suggested above should be enough to get you through your assignments, we list below a few options that might come in handy in case of bugs in the environment and in case you want to try some higher-functionality option, which hopefully will make your coding more productive.&amp;nbsp;&lt;/span&gt;&lt;ul style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;SDL&lt;/span&gt;&amp;nbsp;: To use the SDL interface, simply neglect the parameter -nographic and try running QEMU as&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;./qemu/bin/qemu -m 64M -L ./qemu/share/qemu/ -hda hda.img&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;&amp;nbsp;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;for the default case&lt;/li&gt;&lt;li&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;./qemu/bin/qemu -m 64M -L ./qemu/share/qemu/ -hda hda.img&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;&amp;nbsp;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;-append "root=/dev/hda1" -kernel linux-2.6.26.5/arch/i386/boot/bzImage&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;br /&gt;if you want to boot your own kernel&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;Networking&lt;/span&gt;&amp;nbsp;: QEMU will automatically try to bridge its virtual network device to the host's network device. Should that not work, explicitely adding&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;&amp;nbsp;-net nic,vlan=1 -net user,vlan=1&amp;nbsp;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;to QEMU should get it right (we define how this bridging should work). That should safely bring your guest OS to the outside world and give you access to the internet.&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Your Debian installation comes with an ssh server/client. If your host has an ssh-server also running on port 22, then there would be a port-clash. You could avoid this problem by passing the parameters&amp;nbsp;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;-redir tcp:2222::22&amp;nbsp;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;to QEMU. Then, connecting on port 2222 on the host OS (&lt;span style="font-style: italic; "&gt;localhost&lt;/span&gt;) would get you to the ssh server port of the guest OS (port 22, Debian in our case).&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Generalize the usage of the above instruction to accommodate other port clashes that might appear, for example&amp;nbsp;&lt;span style="font-weight: bold; "&gt;if you share your host OS with someone else, pick a random 4-5 digit port as the bridge port to your regular server port&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;Kernel config&lt;/span&gt;&amp;nbsp;: The procedure to build a kernel is actually first making the configuration ( for example&amp;nbsp;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;make menuconfig&amp;nbsp;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;) and then building it (&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;make&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;). To save disk space, the provided kernel has been stripped of unnecessary modules and is being compiled as a static binary (the Linux kernel, though monolithic, is also for the most part modular, with external loadable modules, but we are compiling it as a big binary). You can change the configuration to fit your needs if you have to. One interesting option that will increase the disk space you will need is the&amp;nbsp;&lt;span style="font-style: italic; "&gt;kernel hacking&amp;nbsp;&lt;/span&gt;options. By turning them on you should get useful runtime debugging information. Make sure you have enough disk space for this purpose (we estimated an extra 500M in our attempts).&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;Debugging&lt;/span&gt;: QEMU can be attached to GDB, the GNU debugger, to allow you to step through your kernel. Simple&amp;nbsp;&lt;span style="font-style: italic; "&gt;printk&lt;/span&gt;&amp;nbsp;(the analogue of printf inside the kernel) should also work. However, it's always nice to have extra functionality that can speed up your compile-test cycle. If you want to try using the debugger, here is one of the ways you can do it:&lt;br /&gt;&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Compile the kernel enabling the "&lt;span style="font-style: italic; "&gt;kernel hacking&lt;/span&gt;" options, more specifically, enabling the debugging information. To do so, go to the kernel directory, run&amp;nbsp;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;make menuconfig&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&amp;nbsp;navigate to the "&lt;span style="font-style: italic; "&gt;kernel hacking&lt;/span&gt;" option and enable at least the "&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;Compile the kernel with debug info&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;" option, plus all the options that you will find useful according to your target. Recompile as discussed, and then start your kernel adding the following two parameters, "&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;-s [port] -S&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;" (port will default to 1234 if not provided - it is optional), resulting in something like the example below:&lt;br /&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;&lt;br /&gt;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;./qemu/bin/qemu&amp;nbsp;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;-s -S&amp;nbsp;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;-m 64M -L ./qemu/share/qemu/ -hda hda.img&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;&amp;nbsp;-append "root=/dev/hda1" -kernel linux-2.6.26.5/arch/i386/boot/bzImage&lt;br /&gt;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;br /&gt;Those parameters tell QEMU to open a port (1234 by default) for gdb to connect to, and then freeze CPU until it gets the signal to continue.&lt;/li&gt;&lt;li&gt;Start gdb giving it as the executable to be debugged&amp;nbsp;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;vmlinux&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&amp;nbsp;which is the linux kernel binary (bzImage is the bz-compressed kernel image). vmlinux is in the topmost linux kernel source directory,&amp;nbsp;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;linux-2.6.26.5&amp;nbsp;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;as assumed here, so you can start as&lt;br /&gt;&lt;br /&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;gdb&amp;nbsp;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;linux-2.6.26.5/vmlinux&lt;br /&gt;&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Connect gdb to qemu by the following instruction&lt;big&gt;&lt;strong&gt;&lt;code&gt;&lt;small&gt;&lt;br /&gt;&lt;br /&gt;target remote localhost:1234&lt;/small&gt;&lt;/code&gt;&lt;/strong&gt;&lt;/big&gt;&lt;br /&gt;&lt;br /&gt;(or port instead of 1234 if you specified it - and you should uniquely if you share your host OS).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Start debugging by setting your breakpoints etc.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;Code browsing&lt;/span&gt;&amp;nbsp;: The Linux kernel is huge, so you might want to always use a code browser. You will find one at&amp;nbsp;&lt;a href="http://lxr.linux.no/"&gt;LXR&lt;/a&gt;. Another option is using&lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt;&amp;nbsp;with the C/C++ plugins (CDT) for code browsing and editing.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;Debian&lt;/span&gt;&amp;nbsp;: Find out how to use&amp;nbsp;&lt;span style="font-style: italic; "&gt;apt&lt;/span&gt;&amp;nbsp;utilities if you want to add extra software to your disk image. For starters, open-ssh is installed, so you can transfer files to and from your disk image.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold; "&gt;Host OS&amp;nbsp;&lt;/span&gt;: QEMU runs on Windows, GNU/Linux, and Mac OS X. We don't care if you use your desktop and what kind of software you have, but you should be able to compile your kernel there. There is no other limitiation: you can take QDGL home and work with it. There are many reasons why you would prefer a GNU/Linux host, however. For example, the virtual disk image is just a virtual disk you can mount using a loopback device and add/delete files from; all you need to know is which sector the first partition starts at and find the exact offset to mount (offset=32256 in our case).&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;table celpadding="3" border="0" cellspacing="2" hspace="4" width="100%" style="font-family: Simsun; "&gt;&lt;tbody&gt;&lt;tr bgcolor="#e0e0e8"&gt;&lt;td width="100%"&gt;&lt;nobr&gt;&lt;strong&gt;Need help?&lt;/strong&gt;&lt;/nobr&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;Of course, you can ask the TA and the instructor for help. At the same time, we would like to encourage you to help each other, especially by using the discussion board at the&amp;nbsp;&lt;/span&gt;&lt;a href="http://my.rochester.edu/" style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;blackboard&lt;/a&gt;&lt;a href="http://my.rochester.edu/" style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&lt;/a&gt;&lt;span style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;. Before asking any questions though, do yourself the favor and search for the answer; most probably, one of the innumerable resources we have at hand will have quite precise directions to get you moving.&lt;/span&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;ul style="font-family: Simsun; line-height: normal; font-size: medium; "&gt;&lt;li&gt;&lt;span style="font-style: italic; "&gt;QEMU&lt;/span&gt;&amp;nbsp;: You can visit their&amp;nbsp;&lt;a href="http://bellard.org/qemu/" target="_top"&gt;website&lt;/a&gt;. Read the manuals, read the options, explore them - you will make your development cycle a lot faster.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic; "&gt;Debian&lt;/span&gt;&amp;nbsp; : Again, you can visit their&amp;nbsp;&lt;a href="http://www.debian.org/"&gt;website&lt;/a&gt;. Use the man pages. Search the internet.&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic; "&gt;Eclipse&lt;/span&gt;&amp;nbsp; : Extra Information about Linux kernel debugging using Eclipse and QEMU can be found&amp;nbsp;&lt;a href="http://issaris.blogspot.com/2007/12/download-linux-kernel-sourcecode-from.html"&gt;here&lt;/a&gt;&amp;nbsp;(but please don't spend more time on setting up your environment rather than coding for your assignments).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-style: italic; "&gt;QDGL&amp;nbsp;&lt;/span&gt;&amp;nbsp;: As you can see from links like&amp;nbsp;&lt;a href="http://issaris.blogspot.com/2007/12/download-linux-kernel-sourcecode-from.html"&gt;that&lt;/a&gt;, we are not the only ones who are using this setup to teach/hack/develop OS. Dr. Tia Newhall 's&lt;a href="http://www.cs.swarthmore.edu/~newhall/unixhelp/qemu_guide.html"&gt;QEMU guide&lt;/a&gt;&amp;nbsp;is meant for her OS class. Try searching the internet for "QEMU and Linux kernel development" - you will see it is a very successful combination .&lt;/li&gt;&lt;/ul&gt;&lt;br style="font-family: Simsun; line-height: normal; font-size: medium; " /&gt;&lt;img src="http://www.cnblogs.com/WuCountry/aggbug/2479476.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/WuCountry/archive/2012/05/02/2479476.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477876.html</id><title type="text">Booting Linux with U-Boot on QEMU ARM</title><summary type="text">Booting Linux with U-Boot on QEMUARMPosted on 2010/04/1277In recent months I played with QEMU emulation of anARM Versatile Platform Board, making it runbare metal programs, theU-Bootboot-loader and aLinux kernelcomplete with aBusybox-based file system. I tried to put everything together to emulate a</summary><published>2012-05-01T06:42:00Z</published><updated>2012-05-01T06:42:00Z</updated><author><name>Wu.Country@侠缘</name><uri>http://www.cnblogs.com/WuCountry/</uri></author><link rel="alternate" href="http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477876.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477876.html"/><content type="html">【摘要】Booting Linux with U-Boot on QEMUARMPosted on 2010/04/1277In recent months I played with QEMU emulation of anARM Versatile Platform Board, making it runbare metal programs, theU-Bootboot-loader and aLinux kernelcomplete with aBusybox-based file system. I tried to put everything together to emulate a &lt;a href="Booting Linux with U-Boot on QEMUARMPosted on 2010/04/1277In recent months I played with QEMU emulation of anARM Versatile Platform Board, making it runbare metal programs, theU-Bootboot-loader and aLinux kernelcomplete with aBusybox-based file system. I tried to put everything together to emulate a" target="_blank"&gt;http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477876.html&lt;/a&gt;&lt;img src="http://www.cnblogs.com/WuCountry/aggbug/2477876.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477876.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477872.html</id><title type="text">Using The mkimage Tool To Create U-Boot Images</title><summary type="text">U-BootThe U-Boot utility is a multi-platform, open-source, universal boot-loader with comprehensive support for loading and managing boot images, such as the Linux kernel.This book explains how to use U-Boot in a STLinux context. Introduction To U-BootUsing U-BootInstalling U-Boot On The HostInstal.</summary><published>2012-05-01T06:38:00Z</published><updated>2012-05-01T06:38:00Z</updated><author><name>Wu.Country@侠缘</name><uri>http://www.cnblogs.com/WuCountry/</uri></author><link rel="alternate" href="http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477872.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477872.html"/><content type="html">&lt;p&gt;&lt;strong&gt;&lt;div clear-block"=""&gt;&lt;p&gt;&lt;strong&gt;U-Boot&lt;/strong&gt;&lt;/p&gt;The &lt;em&gt;U-Boot&lt;/em&gt; utility is a multi-platform, open-source, universal boot-loader with comprehensive support for loading and managing boot images, such as the Linux kernel.&lt;p&gt;This book explains how to use U-Boot in a STLinux context.  &lt;/p&gt;&lt;div id="book-navigation-35"&gt;&lt;ul&gt;&lt;li first"=""&gt;&lt;a href="http://www.stlinux.com/u-boot/introduction"&gt;Introduction To U-Boot&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.stlinux.com/u-boot/using"&gt;Using U-Boot&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.stlinux.com/u-boot/host-install"&gt;Installing U-Boot On The Host&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.stlinux.com/u-boot/target-install"&gt;Installing U-Boot &amp;amp; Linux Kernel On The Target&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.stlinux.com/u-boot/kernel-booting"&gt;Booting The Linux Kernel&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.stlinux.com/u-boot/flash"&gt;U-boot and Flash (NOR, NAND &amp;amp; SPI)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.stlinux.com/u-boot/mkimage"&gt;Using mkimage To Create U-Boot Images&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.stlinux.com/u-boot/compiling"&gt;Compiling U-Boot&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.stlinux.com/u-boot/modifying"&gt;Modifying U-Boot&lt;/a&gt;&lt;/li&gt;&lt;li last"=""&gt;&lt;a href="http://www.stlinux.com/u-boot/porting"&gt;Porting U-Boot To A New Board&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div clear-block"=""&gt;&lt;a title="Go to next page" href="http://www.stlinux.com/u-boot/introduction"&gt;Introduction To U-Boot &amp;#8250;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;ul inline"=""&gt;&lt;li first=""  last"=""&gt;&lt;a href="http://www.stlinux.com/user/login?destination=comment%2Freply%2F35%23comment-form"&gt;Login&lt;/a&gt; or &lt;a href="http://www.stlinux.com/user/register?destination=comment%2Freply%2F35%23comment-form"&gt;register&lt;/a&gt; to post comments&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div id="book-navigation-35"&gt;&lt;div clear-block"=""&gt;&lt;a title="Go to previous page" href="http://www.stlinux.com/u-boot/target-install"&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/WuCountry/aggbug/2477872.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477872.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477863.html</id><title type="text">SUSE安全大揭秘之“十诫”</title><summary type="text">【51CTO.com独家特稿】SUSE由于其出色的性能和对安全较好的控制，吸引了很多企业级用户，目前在国内开始有大量的关键应用。但这并不代表SUSE在使用中就是安全的，SUSE里还有很多安全细节要注意。本文就SUSE中的这些安全细节进行逐一介绍，为大家揭开每一个需要注意的地方。 一、补丁、SSH及其他 1、补丁 每个补丁的更新都意味着这是一个安全漏洞，或是有其他严重的功能问题，但如果更新补丁则又可能导致系统的一些异常，甚至引起一些服务的瘫痪。所以对于补丁的更新要慎重处理。从实际的角度来说，有4种做法： 1）是在刚装完系统之后立刻更新补丁，然后再上应用。 2）是通过外围防护手段来保...</summary><published>2012-05-01T06:31:00Z</published><updated>2012-05-01T06:31:00Z</updated><author><name>Wu.Country@侠缘</name><uri>http://www.cnblogs.com/WuCountry/</uri></author><link rel="alternate" href="http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477863.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477863.html"/><content type="html">&lt;p&gt;【51CTO.com独家特稿】SUSE由于其出色的性能和对安全较好的控制，吸引了很多企业级用户，目前在国内开始有大量的关键应用。但这并不代表SUSE在使用中就是安全的，SUSE里还有很多安全细节要注意。本文就SUSE中的这些安全细节进行逐一介绍，为大家揭开每一个需要注意的地方。&lt;/p&gt;&lt;p&gt;&lt;strong&gt;一、补丁、SSH及其他&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;1、补丁&lt;/p&gt;&lt;p&gt;每个补丁的更新都意味着这是一个安全漏洞，或是有其他严重的功能问题，但如果更新补丁则又可能导致系统的一些异常，甚至引起一些服务的瘫痪。所以对于补丁的更新要慎重处理。从实际的角度来说，有4种做法：&lt;/p&gt;&lt;p&gt;1）是在刚装完系统之后立刻更新补丁，然后再上应用。&lt;/p&gt;&lt;p&gt;2）是通过外围防护手段来保护服务器，可以用防火墙、IPS之类的手段。&lt;/p&gt;&lt;p&gt;3）是在测试机上更新补丁。不过值得注意的是，有些补丁带来的问题是隐性的，可能今天明天没问题，但后天出了问题，所以，观察的时间需要久一些。&lt;/p&gt;&lt;p&gt;4）、如果你的SUSE服务器比较多，也可以通过NFS共享或者内部的FTP、HTTP服务来完成。但FTP、HTTP又会带来另外的安全风险。&lt;br /&gt;SUSE的补丁升级，需要去下载Novell的新RPM。RPM包的安装会有先有后，不过多数情况下，RPM会根据其依赖关系来处理。另外，Novell也有一些在特殊情况下的提示，比如内核更新、C运行库等。Novell公司提供了一个强大的工具YaST，不过遗憾的是，YaST自身也不安全，有在线升级不安全临时文件建立漏洞。&lt;/p&gt;&lt;p&gt;加固方法：输入yast，在software中选择online update。&lt;/p&gt;&lt;p&gt;2、SSH&lt;/p&gt;&lt;p&gt;SUSE上默认安装了OpenSSH，OpenSSH是目前比较流行并且免费的加密连接工具，但OpenSSH的低版本也存在不少安全漏洞，所以最好还是去http://www.openssh.org下载最新版本的。在升级到最新版本之后，SSH仍有很多需要安全加固工作要做。比如限制那些账户的登录、更改默认端口、指定可访问的网络等等，限于篇幅本文对此不做更详细的介绍。但至少有一点，是你必须要做的：将协议版本修改为2。因为版本1的安全问题实在太严重了，甚至可以截获密码。&lt;/p&gt;&lt;p&gt;加固方法：&lt;/p&gt;&lt;p&gt;vi /etc/ssh/ssh_config&lt;/p&gt;&lt;p&gt;修改protocol的值为2。&lt;/p&gt;&lt;p&gt;3、系统性能审计&lt;/p&gt;&lt;p&gt;对于运维人员来说，需要经常监控系统的性能情况，SUSE提供的sysstat就是一个检测系统状态的工具，比如比如CPU利用率、磁盘I/O等。sysstat默认每10分钟收集一次系统数据，可以用sar命令查看。sysstat首先会建立一个正常的性能曲线，当这个基线建立完毕以后，任何超出基线的活动都会给出提示。例如密码猜测、或者在业务高峰期以外的事件会导致CPU利用率过高，从而偏离正常的基线。注意sysstat收集的数据默认是在系统上存放一周，一周之后会被cron任务自动移除，可在/var/log/sa/目录下来维护收集的数据。但是默认安装的服务器版本是不包括sysstat包的，除非安装的时候选择了完全安装。&lt;/p&gt;&lt;p&gt;加固方法：安装sysstat，并使用sar命令。&lt;/p&gt;&lt;p&gt;4、防火墙&lt;br /&gt;SuSEfirewall2是SUSE下面的包过滤防火墙，可以允许、拒绝数据的进出。默认是安装并且激活的，而且默认不允许任何服务，要开放服务就必须明确的启用（比如上面提到的SSH）。&lt;/p&gt;&lt;p&gt;加固方法：&lt;/p&gt;&lt;p&gt;在YAST里，Center--#Security and Users--#Firewall进行防火墙策略调整。&lt;br /&gt;更细粒度的策略配置，可以在YAST Center--#System#--/etc/sysconfig editor-Network/Firewall/SuSEfirewall2，也可直接编辑/etc/sysconfig/SuSEfirewall2文件。&lt;/p&gt;&lt;p&gt;5、系统安全定期检查脚本seccheck&lt;/p&gt;&lt;p&gt;seccheck是一个系统安全检查脚本，可以每天、每周、每月的定期生成报告，并且邮件发送。不过他在定期运行的时候比较占用资源，所以要选择在非业务高峰期来做。&lt;/p&gt;&lt;p&gt;加固方法：YAST Center-System-#/etc/sysconfig-System/Security/Seccheck selection&lt;/p&gt;&lt;p&gt;6、SUSE的安全应用框架AppArmor&lt;br /&gt;AppArmor和SuSEfirewall2相比，他的特点在于对应用级的保护，可以管理应用的文件和目录访问等更细颗粒的操作，是一个白名单的机制，即指定哪些行为才是允许的，其他的拒绝，这样可以更好的隐藏内部系统。比如你的系统存在一个漏洞，但由于对其的操作没有受到白名单允许，所以操作会被拒绝。&lt;/p&gt;&lt;p&gt;加固方法：YAST Center-Novell AppArmor可以调整细节策略、查看报告。如果不熟悉的话，AppArmor还内设了一个向导功能。&lt;/p&gt;&lt;p&gt;二、最小化xinetd&lt;/p&gt;&lt;p&gt;1、关闭标准服务&lt;/p&gt;&lt;p&gt;SUSE使用xinetd，他比inetd更优秀也更方便使用。SUSE默认情况下是关闭所有服务的，在启用SSH之后，就可以配置xinetd的服务了。安全的做法也应该如此，先关闭所有服务，然后只启用必须的服务。&lt;/p&gt;&lt;p&gt;加固方法：运行chkconfig查看所有服务的开启状态，对不需要的服务进行关闭。&lt;/p&gt;&lt;p&gt;2、可信网络接入&lt;/p&gt;&lt;p&gt;对服务器的访问应该受到控制，所以需要用SuSEfirewall2或者其他的措施来控制，只允许那些可信的网络接入。&lt;/p&gt;&lt;p&gt;加固方法：&lt;/p&gt;&lt;p&gt;vi /etc/sysconfig/SuSEfirewall2中的第10项配置。也可以在yast Center#System#/etc/sysconfig editor进行配置。&lt;/p&gt;&lt;p&gt;3、telnet&lt;/p&gt;&lt;p&gt;如果不是有特别的理由，不要使用telnet，telnet使用的是不加密的网络协议，这就意味着从你的账号到你传输的数据，都可以被人窃听，严重的可以通过会话劫持控制你的系统。所以这里还是强烈建议使用SSH，虽然SSH也不是那么的安全。&lt;/p&gt;&lt;p&gt;加固方法：&lt;/p&gt;&lt;p&gt;打开的命令是chkconfig telnet on。&lt;/p&gt;&lt;p&gt;关闭的命令是chkconfig telnet off。&lt;/p&gt;&lt;p&gt;4、FTP&lt;/p&gt;&lt;p&gt;同样，在没有充分理由的情况下，不要使用FTP，尤其是匿名FTP。和telnet一样，FTP也不加密，也可以被人窃听或者会话劫持。SSH则提供了SCP和SFTP，可以取代FTP。要注意的是，有时候FTP可能是因为某些应用绑定的，比如我多次见到的WEB上传通道，所以你必须要用这种匿名FTP。如果必须要用FTP，那还是要做一些控制，要注意的一点是，FTP的目录应该受到控制，最好能有自己的分区。在SUSE上，vsftpd默认是不安装的。&lt;/p&gt;&lt;p&gt;加固方法：&lt;/p&gt;&lt;p&gt;打开的命令是chkconfig vsftpd。 &lt;/p&gt;&lt;p&gt;关闭命令是chkconfig vsftpd off。&lt;/p&gt;&lt;p&gt;5、rlogin/rsh/rcp&lt;/p&gt;&lt;p&gt;所有r系列的命令都应该被关闭。他们除了可以被窃听之外，在验证机制上也存在问题，并且还有其他的安全漏洞，比如缓冲区溢出、任意命令执行等。建议还是用SSH来取代。&lt;/p&gt;&lt;p&gt;加固方法：&lt;/p&gt;&lt;p&gt;打开命令是&lt;/p&gt;&lt;p&gt;chkconfig rexec on&lt;/p&gt;&lt;p&gt;chkconfig rlogin on&lt;/p&gt;&lt;p&gt;chkconfig rsh on&lt;/p&gt;&lt;p&gt;关闭他们：&lt;/p&gt;&lt;p&gt;chkconfig rexec off&lt;/p&gt;&lt;p&gt;chkconfig rlogin off&lt;/p&gt;&lt;p&gt;chkconfig rsh off&lt;/p&gt;&lt;p&gt;6、TFTP&lt;/p&gt;&lt;p&gt;TFTP一般用在无盘工作站， X-terminals等情况下。路由器或者其他网络设备的配置数据可以利用它复制，实现备份功能。当然，在这里，没有特殊原因，我们仍然建议你禁用。TFTP在SUSE上也不是默认安装的。&lt;/p&gt;&lt;p&gt;关闭命令chkconfig tftp off&lt;/p&gt;&lt;p&gt;7、IMAP&lt;/p&gt;&lt;p&gt;只有邮件服务器才会用到IMAP，一些邮件客户端（比如Eudora、Netscape Mail和Kmail）需要使用IMAP来检索远程邮件。&lt;/p&gt;&lt;p&gt;加固方法：关闭服务的命令&lt;/p&gt;&lt;p&gt;chkconfig cyrus off或chkconfig imap off。&lt;/p&gt;&lt;p&gt;8、POP&lt;/p&gt;&lt;p&gt;这是一个收邮件的服务，作为服务器有收取邮件的需要吗？如果没有，同样也应关闭。&lt;/p&gt;&lt;p&gt;加固方法：chkconfig qpopper off或chkconfig cyrus off。&lt;/p&gt;&lt;p&gt;三、最小化启动服务&lt;/p&gt;&lt;p&gt;1、设置umask&lt;/p&gt;&lt;p&gt;系统默认的umask至少应设置成027，有些守护进程比如系统日志，会默认设置为任何人可以写文件。如果某个守护进程需要放开对权限的限制，可以考虑修改守护进程的启动脚本，给以其权限，同时又不会影响服务器的其他安全。&lt;/p&gt;&lt;p&gt;加固方法：&lt;/p&gt;&lt;p&gt;vi /etc/profile，改变umask的值为027。&lt;/p&gt;&lt;p&gt;对/home下的所有用户，根据其shell类型，定义umask的值。一般在/home/.profile中新增加一行umask 027。&lt;/p&gt;&lt;p&gt;2、SMTP&lt;/p&gt;&lt;p&gt;需要确认服务器是否需要处理邮件。SUSE中，默认安装的是Postfix，并且是激活状态。如果这台服务器是邮件服务器的话，需要注意的是，有权限在web界面上搜索附件是一个安全隐患。另外，如果你对邮件服务器管理有经验的话，你会知道为postfix规划一个chroot环境有多么重要。在chroot环境下，即使有人闯入了smtpd daemon，能够造成的损害也比较有限。&lt;/p&gt;&lt;p&gt;加固方法：&lt;/p&gt;&lt;p&gt;打开：vi /etc/sysconfig/mail,设置SMTPD_LISTEN_REMOTE="yes"。在防火墙上也必须启用。&lt;/p&gt;&lt;p&gt;关闭：vi /etc/sysconfig/mail,设置SMTPD_LISTEN_REMOTE="no"。&lt;/p&gt;&lt;p&gt;3、运行级别&lt;/p&gt;&lt;p&gt;SUSE里有两个主要的运行级别，级别5直接启动到X Windows,级别3则是字符界面。但注意的是，即使系统运行在级别3，用户仍然可以在shelle下执行startx来启动X Windows。&lt;/p&gt;&lt;p&gt;加固方法：&lt;/p&gt;&lt;p&gt;设置为级别3，vi /etc/inittab，将id:5:initdefault中的5修改为3。&lt;/p&gt;&lt;p&gt;4、X Font Server&lt;/p&gt;&lt;p&gt;对于服务器来说，一般不需要运行X Windows，如果不使用图形界面的话，X Font Server就可以关掉，他是为图形界面提供字体集用的，并且XFS还有一些缓冲区溢出的问题。&lt;/p&gt;&lt;p&gt;加固方法：&lt;/p&gt;&lt;p&gt;关闭X Font Server：chkconfig xfs off&lt;/p&gt;&lt;p&gt;5、标准启动服务&lt;/p&gt;&lt;p&gt;每个系统的守护进程，如果你不能明确知道必须开启的话，都应该关闭。服务器上运行的脆弱应用，将大大增加风险。SUSE使用chkconfig来管理所有的系统服务脚本。这里要注意的是，SUSE的补丁程序可能会恢复启动某些服务，在更新补丁之前，最好还是先记录一下你已经启动哪些服务。还有就是一些守护进程会拥有一些账户，对这些账户要进行删除、锁定，避免别人登录，或者对他的Shell设置成/bin/false。&lt;/p&gt;&lt;p&gt;加固方法：&lt;/p&gt;&lt;p&gt;添加、删除启动服务的方法是在在不同运行级别下的目录里，首先你需要知道你的系统运行界别，使用runlevel命令查看运行级别，如果运行级别是3的话，那就需要在/etc/rc.d/rc3.d修改。这里面以S开头的，都是启动时会运行的服务。例如mv /etc/rc3.d/S04rpcbind etc/rc3.d/K04rpcbind，是将rpcbind服务关闭。&lt;/p&gt;&lt;p&gt;另外还需要对守护进程的账户进行删除或锁定，删除用户命令是userdel，可以删除这些用户：adm lp sync shutdown halt news uucp operator gopher，如果不用x windows的话可以删除games，如果没有匿名ftp可以删除ftp。&lt;/p&gt;&lt;p&gt;6、SMB和NMB&lt;/p&gt;&lt;p&gt;SUSE提供了Samba，为windows用户提供文件和打印共享，这样unix系统可以在windows的网络上充当文件服务器、打印服务器，甚至为早期的windows系统充当域控验证服务器。Samba需要用到SMB和NMB协议，SMB是Windows的文件共享，NMB是NetBIOS消息块。如果不需要充当这些角色的话，就应该关闭这两个协议。关闭命令 chkconfig smb off&lt;/p&gt;&lt;p&gt;7、NFS&lt;/p&gt;&lt;p&gt;NFS经常被利用来越权存取文件，所以没有需要也应关闭。即使真的需要NFS服务，也应该采取控制措施，包括限制访问的IP范围、文件的只读等。NFS的客户端服务也应关闭。&lt;/p&gt;&lt;p&gt;关闭命令：&lt;/p&gt;&lt;p&gt;chkconfig nfsserver off&lt;/p&gt;&lt;p&gt;chkconfig autofs off&lt;/p&gt;&lt;p&gt;8、NIS&lt;/p&gt;&lt;p&gt;除非十分有必要，否则不要使用NIS。NIS是网络信息服务的缩写，类似与windows中的域控制器。NIS虽然使用维护简单，但有设计上的安全问题，而且也完全可以用LDAP来替代。&lt;/p&gt;&lt;p&gt;关闭命令：&lt;/p&gt;&lt;p&gt;chkconfig ypserv off&lt;/p&gt;&lt;p&gt;chkconfig yppasswdd off&lt;/p&gt;&lt;p&gt;9、RPC端口映射&lt;/p&gt;&lt;p&gt;要想NIS能够运行，须首先运行portmap守护进程。但是RPC的验证机制很薄弱，很容易被绕过，却可以利用RPC得到很多重要的信息。除非是需要NIS，最好禁用。&lt;/p&gt;&lt;p&gt;关闭命令：chkconfig portmap off&lt;/p&gt;&lt;p&gt;10、ncpfs脚本&lt;/p&gt;&lt;p&gt;ncpfs是NFS、windows网络里共享文件需要用到的，但并非默认安装，如果没有网络共享在使用，就把它停掉。这个脚本会挂载在客户机的网络驱动器上，好在它不是一个持续的守护进程，所以相对来说不是那么危险。&lt;/p&gt;&lt;p&gt;关闭命令：chkconfig ncpfs off&lt;/p&gt;&lt;p&gt;11、apache&lt;/p&gt;&lt;p&gt;只有WEB服务器才会用到，即使这台服务器是WEB服务器，也不要把数据库和其他环境支持都放在这台服务器上。&lt;/p&gt;&lt;p&gt;关闭命令：chkconfig apache2 off&lt;/p&gt;&lt;p&gt;12、SNMP&lt;/p&gt;&lt;p&gt;在规模比较大的网络里会经常用到的网络管理协议，要确定你是不是在使用依赖SNMP的远程监控工具，比如HP OpenView, MRTG, Cricket等。如果使用了SNMP，也建议更改默认的community string。在SUSE中，snmp的设置在/etc/snmpd.conf里。&lt;/p&gt;&lt;p&gt;关闭命令：chkconfig snmpd off&lt;/p&gt;&lt;p&gt;13、DNS server&lt;/p&gt;&lt;p&gt;确定你的网络是否需要域名解析的服务器，针对DNS的攻击这两年越来越多，如果必须要用，建议在/etc/named.conf里 使用访问控制。比如，内部的DNS服务器不应该对外部开放查询。在比较大的网络里，一般都会使用内部和外部的DNS服务器分别提供查询，但一些小的网络没有条件内外分开，就应考虑访问控制。&lt;/p&gt;&lt;p&gt;关闭命令：chkconfig named off&lt;/p&gt;&lt;p&gt;14、Squid Cache服务器&lt;/p&gt;&lt;p&gt;Squid是一个代理服务器软件，其实Squid是一个较好的安全架构，因为他在客户端和服务器之间设置了一道代理，在一定程度上减少了系统泄露信息的风险，防止内部漏洞被发现。但是，在使用Squid的时候要仔细进行配置，有很多关于Squid cache的漏洞。如果不加安全考虑的话，外部仍然可以探测到内部的主机，或者利用你的cache来隐藏攻击者的真实IP。所以应该配置成：不允许外部人员未经认证使用你的缓存。&lt;/p&gt;&lt;p&gt;关闭命令：chkconfig squid off&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;四、内核优化&lt;/p&gt;&lt;p&gt;1、网络参数修改&lt;/p&gt;&lt;p&gt;SUSE和其他Linux一样，把网络参数的修改都放在了/proc/sys/net/ipv4下，这里所有文件名中包含rate和max的变量都可以防止拒绝服务攻击。对于每个参数的具体解释可以参考相关文档，这里就不一一介绍。&lt;/p&gt;&lt;p&gt;建议修改：&lt;/p&gt;&lt;p&gt;net.ipv4.tcp_max_syn_backlog = 4096&lt;/p&gt;&lt;p&gt;net.ipv4.conf.all.accept_source_route = 0&lt;/p&gt;&lt;p&gt;net.ipv4.conf.all.accept_redirects = 0&lt;/p&gt;&lt;p&gt;net.ipv4.conf.all.secure_redirects = 0&lt;/p&gt;&lt;p&gt;net.ipv4.conf.default.rp_filter = 1&lt;/p&gt;&lt;p&gt;net.ipv4.conf.default.accept_source_route = 0&lt;/p&gt;&lt;p&gt;net.ipv4.conf.default.accept_redirects = 0&lt;/p&gt;&lt;p&gt;net.ipv4.conf.default.secure_redirects = 0&lt;/p&gt;&lt;p&gt;net.ipv4.icmp_echo_ignore_broadcasts = 1&lt;/p&gt;&lt;p&gt;2、其他参数&lt;/p&gt;&lt;p&gt;如果系统不是作为一个防火墙或网关的话，需要修改以下部分。&lt;/p&gt;&lt;p&gt;建议修改：&lt;/p&gt;&lt;p&gt;net.ipv4.ip_forward = 0&lt;/p&gt;&lt;p&gt;net.ipv4.conf.all.send_redirects = 0&lt;/p&gt;&lt;p&gt;net.ipv4.conf.default.send_redirects = 0&lt;/p&gt;&lt;p&gt;五、日志&lt;/p&gt;&lt;p&gt;1、syslog&lt;/p&gt;&lt;p&gt;SUSE使用了syslog-ng来记录日志。/var/log/messages包括了iptables, mail, news和messages，并把它们分别发送到(/var/log/firewall, /var/log/mail*, 和/var/log/news。文件权限默认是u=rw,g=r,o=。&lt;/p&gt;&lt;p&gt;2、NTP&lt;/p&gt;&lt;p&gt;NTP是网络时间协议，目的是保持计算机的时间与网络同步，默认安装，但是没有启用。系统时钟应该保持一个高准确度，这样日志的记录才能准确的反映时间。NTP启用后，在udp123端口监听。在配置上，应该忽略任何未明确允许的消息，只允许本地回环127.0.0.1和NTP服务器的消息，防止别人伪造时间服务器。对NTP的修改在/etc/ntp.conf下面。&lt;/p&gt;&lt;p&gt;3、日志文件权限&lt;/p&gt;&lt;p&gt;确保系统日志文件的所有权和权限是正确的，日志文件权限的配置在/etc/syslog-ng/syslog-ng.conf.in和/etc/logrotate.d&lt;/p&gt;&lt;p&gt;4、远程日志记录&lt;/p&gt;&lt;p&gt;配置系统日志记录发送到网络的其他主机上。注意的是，这个时候，就需要精确的系统时钟了，所以需要使用NTP。为什么要在远程记录日志呢？原因是，如果你的系统发生故障或者崩溃了，它是什么原因造成的？你就可以在这台远程记录日志的主机上找到原因。syslog-ng可以使用UDP或TCP。但是，除非这台远程主机能够保证一直可用、网络也很可靠，否则，建议使用TCP，防止数据丢失。&lt;/p&gt;&lt;p&gt;例如：在/etc/syslog-ng的syslog-ng.conf中添加&lt;/p&gt;&lt;p&gt;destination logserver { tcp("10.10.10.10" port(514)); };&lt;/p&gt;&lt;p&gt;六、文件权限许可&lt;/p&gt;&lt;p&gt;1、在 /etc/fstab使用nodev方式&lt;br /&gt;nodev选项的意思是禁止用户在任何分区上挂载未授权的设备，需要挂载设备时，应该在其他地方比如/dev。但也有例外，比如在chroot的环境中，经常需要在chroot目录中创建多个设备。如果在你的机器上使用了chroot，要注意这个nodev的选项。&lt;/p&gt;&lt;p&gt;2、在/etc/fstab中使用nosuid&lt;br /&gt;在移动介质上，经常会有一些病毒、恶意软件，通过nosuid选项，可以阻止用户在光驱、软驱或者U盘上运行set-UID权限的程序。如果机器上有多个移动设备，也可以在/etc/fstab中相关设备的第四列设置nosuid。&lt;/p&gt;&lt;p&gt;3、禁止用户挂载可移动介质&lt;br /&gt;SUSE默认只有root用户可以挂载移动介质，如果/etc/fstab被改成允许用户挂载，可能会让病毒进入服务器，或者数据被修改删除。把它改回nouser选项更有助于安全。&lt;/p&gt;&lt;p&gt;4、验证passwd, shadow,group文件权限&lt;br /&gt;这些文件都有着默认的所有者和访问权限，都要修改/etc/shadow权限为644，并且定期检查。AIDE是一个不错的工具，可以提醒你对这些文件权限的注意。不过AIDE是Tripwire的非商业版改进，目前还是BETA版，可能不适合用于关键的生产系统上。&lt;/p&gt;&lt;p&gt;5、没有权限限制的目录应该设置粘滞位&lt;br /&gt;你在任何一个目录上设置粘滞位以后，就只有文件所有者能够删除目录里的文件，而不是任何有写权限的人可以删除。设置粘滞位可以防止彼此覆盖文件，无论是意外、恶意行为。但也应在设置粘滞位之前，查看一下你的应用程序文档，避免破坏用用程序的依赖。&lt;/p&gt;&lt;p&gt;用这个脚本进行检查：&lt;br /&gt;for PART in `awk '($3 ~ "ext2|ext3|reiserfs") \&lt;br /&gt;{ print $2 }' /etc/fstab`; do&lt;br /&gt;find $PART -xdev -type d \&lt;br /&gt;\( -perm -0002 -a ! -perm -1000 \) -print&lt;br /&gt;done&lt;br /&gt;如果你的系统设置的足够安全的话，这里应该不会有任何的返回。&lt;/p&gt;&lt;p&gt;6、任何人都可写的文件&lt;br /&gt;在某个文件上，如果任何人都可以写，将可能导致对系统的修改，或者对系统上的用户造成影响。避免这种文件的出现，要在编写脚本或者程序时加以注意，因为这会导致系统的完整性受到影响。一般来说，可以消除写访问（chmod o-w &lt;filename&gt;），但对于关键服务器来说，还是要咨询一下相关厂商。&lt;/filename&gt;&lt;/p&gt;&lt;p&gt;用这个脚本进行检查&lt;br /&gt;for PART in `awk '($6 != "0") { print $2 }' /etc/fstab`; do&lt;br /&gt;find $PART -xdev -type f \&lt;br /&gt;\( -perm -0002 -a ! -perm -1000 \) -print&lt;br /&gt;done&lt;/p&gt;&lt;p&gt;如果你的系统设置的足够安全的话，这里应该不会有任何的返回。&lt;/p&gt;&lt;p&gt;7、未授权SUID/SGID的可执行文件&lt;/p&gt;&lt;p&gt;管理员要检查在系统里，有没有未授权的set-UID。另外如果可能的话，应做Set-UID的审计，或者减少这种Set-UID程序。&lt;br /&gt;检查方法：&lt;br /&gt;for PART in `awk '($6 != "0") { print $2 }' /etc/fstab`; do&lt;br /&gt;find $PART \( -perm -04000 -o -perm -02000 \) \&lt;br /&gt;-type f -xdev -print&lt;br /&gt;done&lt;/p&gt;&lt;p&gt;8、查找无主文件&lt;br /&gt;不要让你的系统上有任何无主文件，无主文件可能是一个入侵者已经访问了你的系统，或者是不当文件包的维护安装造成的。比如删除了用户或者组，但是相关文件没有删除。另一种常见情况是软件安装时，没有正确的设置所有者。NFS挂载文件，会忽视用户ID和系统之间的映射同步，也有可能造成无主文件的产生。如果你在使用NIS或者LDAP，那可能是其他原因造成的，什么原因就需要你去仔细检查了。&lt;/p&gt;&lt;p&gt;检查方法：&lt;br /&gt;for PART in `awk '($6 != "0") { print $2 }' /etc/fstab`; do&lt;br /&gt;find $PART -nouser -o -nogroup -print&lt;br /&gt;done&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;七、系统的管理、授权、认证&lt;/p&gt;&lt;p&gt;1、在PAM配置文件里移除.rhosts支持&lt;br /&gt;.rhosts定义了哪些计算机和用户可以不用提供口令就在本地计算机上执行远程命令，很容易被攻击者利用。使用.rhosts是对用户访问控制规则的破坏，尽量关闭。如果有特殊原因，必须要使用，那就需要一些预防措施。永远不要在.rhosts里使用+通配符。.rhosts必须指定特定的可信任用户名，比如trustedhost DB1，而不是trustedhost。这种在配置HA的时候常见。要避免信任关系之外的主机，而且防火墙或者其他安全设备应该阻止外部的rlogin/rsh/rcp访问。最后，还要确保.rhost文件只有所有者可读。例如文件权限600。&lt;/p&gt;&lt;p&gt;2、/etc/ftpusers&lt;br /&gt;/etc/ftpusers的列表里定义了哪些用户不允许使用系统的FTP，一般来说，应该只有普通用户可以使用FTP，而不是system这种类型的账户。当然，root用户永远都不应该使用FTP方式直接传输文件。&lt;br /&gt;SUSE提供了一个netcfg的包，预填充了不该使用FTP的账户。&lt;/p&gt;&lt;p&gt;3、 防止X Server在tcp6000上监听&lt;br /&gt;X Server在TCP6000上监听，接受来自其他客户端的请求。但是，X Server使用了一个相对不安全的身份验证协议，攻击者可以未授权访问到本地X Server上。使用"-nolisten tcp" 方式可以取消X Server在TCP6000上默认监听。&lt;/p&gt;&lt;p&gt;4、限制用户使用at/cron&lt;br /&gt;cron.allow、 at.allow定义了谁可以使用crontab、at命令在预定的时间运行作业。在很多系统上，只有系统管理员有这种能力。即使某个用户不在cron.allow里面，用户仍然可以运行cron作业。cron.allow控制的是：crontab命令调度的权限、修改cron作业的权限。注意：不要修改/etc/at.deny和/etc/cron.deny文件，除非你的确了解他们，这两个文件里都有合理的默认内容。如果对at和cron必须加以控制，创建/etc/at.allow和/etc/cron.allow文件，增加适当的用户。&lt;/p&gt;&lt;p&gt;5、限制crontab文件的权限&lt;br /&gt;系统的crontab文件只能由cron守护进程（运行超级用户权限）和crontab命令（set-UID为root）访问。允许未授权的用户读取修改crontab，可以让用户获得权限提升。&lt;/p&gt;&lt;p&gt;6、配置xinetd的访问控制&lt;br /&gt;可使用简单的基于IP的访问控制，限制对xinted的非法连接。现在比较流行的工具是PortSentry，可以用于监视那些试图访问未使用端口的行为。然后再使用系统防火墙SuSEfirewall2来控制。&lt;/p&gt;&lt;p&gt;7、限制root登录到系统控制台&lt;br /&gt;root直接登录到系统控制台是不允许的，除非特别情况。在其他时候，管理员应该通过无特权的账户并使用授权机制，比如su、sudo来获取额外的特权。这些机制至少提供了审计的线索。/etc/securtty让你可以规定root可从哪个tty登录。/etc/securtty列出来的都是可以登录的，注释、不存在的都是不允许root登录的。&lt;/p&gt;&lt;p&gt;8、设置LILO/GRUB密码&lt;br /&gt;大多数的Linux系统，默认在引导时，有装载提示，这让攻击者破坏正常的引导变得很容易。对他设置密码，这样在试图修改LILO或GRUB的时候，就需要验证，当然，密码要够强壮。&lt;/p&gt;&lt;p&gt;方法&lt;/p&gt;&lt;p&gt;A、如果你有/etc/lilo.conf 文件&lt;br /&gt;在/etc/lilo.conf前面添加：&lt;br /&gt;password=&lt;password&gt;&lt;/password&gt;&lt;/p&gt;&lt;p&gt;以root执行命令：&lt;br /&gt;chown root:root /etc/lilo.conf&lt;br /&gt;chmod 600 /etc/lilo.conf&lt;/p&gt;&lt;p&gt;B、如果是/etc/grub.conf文件&lt;br /&gt;在/etc/grub.conf取消password &lt;password&gt;的注释。&lt;br /&gt;以root执行命令：&lt;br /&gt;chown root:root /etc/grub.conf&lt;br /&gt;chmod 600 /etc/grub.conf&lt;/password&gt;&lt;/p&gt;&lt;p&gt;9、对单用户模式验证&lt;/p&gt;&lt;p&gt;在一些Linux上你可以在LILO模式下键入linux single进入单用户模式，或者在GRUB的引导编辑菜单。这就带来风险，进入系统的认证应该始终需要root级别的访问，防止攻击者物理访问系统。SUSE默认禁止这种进入方式，但是作为检查来说，还是需要检查一下。如果被改动的话，要搞清楚原因并恢复。8和9这两个项目都为了解决物理/启动的安全问题，也可以考虑设置只从主硬盘启动，或者设置BIOS密码。&lt;/p&gt;&lt;p&gt;10、限制NFS客户端请求特权端口&lt;/p&gt;&lt;p&gt;设置：NFS服务器忽略来自客户端的低于1024的源端口访问，这不会妨碍到正常的NFS操作，但可以阻止一些使用工具软件攻击的人。其配置文件在/etc/exports里。&lt;/p&gt;&lt;p&gt;11、syslog的消息接收&lt;/p&gt;&lt;p&gt;你的服务器是日志服务器吗？需要从网络上、其他主机上接收日志吗？如果是肯定的，启用日志系统的远程消息接受。默认情况下的系统日志的守护进程是syslogd，不在udp514上监听来自其他系统的日志消息（Solaris相反，默认是接受的。）成立一个独立的日志服务器来记录一个或多个日志，是比较推荐的安全做法。但是，如果你不是日志服务器的话，就不应该打开udp514的监听，因为这些信息的传递没有任何认证机制。攻击者也可以利用此端口发起DDOS攻击，或者不停的发送日志消息填满你的日志系统，这样以后的攻击就不会被记录到了。&lt;br /&gt;在syslog-ng.conf.in里，把下面这行加上#注释掉&lt;br /&gt;#udp(ip("0.0.0.0") port(514))&lt;/p&gt;&lt;p&gt;八、用户账户和环境&lt;/p&gt;&lt;p&gt;1、锁定系统账户&lt;br /&gt;有很多账户是系统账户，不会被人使用，锁定这些账户有助于减少攻击者的利用。这些账户不应该有shell。如果没有守护进程/服务使用的话，甚至可以将账户删除。比较简单的做法是直接停用，停用的做法是锁定password，设置一个无效的shell（比如/bin/false）。SUSE里使用/bin/false而不是/dev/null和/bin/nologin。&lt;/p&gt;&lt;p&gt;2、空密码账户&lt;br /&gt;使用awk -F: '($2 == "") { print $1 }' /etc/shadow查找空密码账户。空密码账户是指任何人都可以登录，而不用提供密码。所有的账户都应该有健壮的密码，或者使用锁定密码的字符串：NP、*LOCKED*。&lt;/p&gt;&lt;p&gt;3、设置账户过期和密码参数&lt;br /&gt;强制用户定期改变密码，设置所有活跃账户（除了系统账户）强制更改密码，例如：每90天(-M 90),下次允许更改密码之前最少的天数7天 (-m 7)，用户在密码过期前28天收到警告(-W 28)。一旦密码过期，账户将被锁定7天(-I 7)。最后，密码最小长度为6。这只是一些建议，你需要根据你的实际情况在/etc/login.defs进行调整。&lt;/p&gt;&lt;p&gt;4、确认在passwd, shadow,group里没有&amp;#8216;+&amp;#8217;&lt;br /&gt;使用命令grep ^+: /etc/passwd /etc/shadow /etc/group检查。+用于NIS的数据映射配置，在passwd, shadow,group文件里存在+号，将会为攻击者提供一个提权的途径，应该把它们都删掉。&lt;/p&gt;&lt;p&gt;5、确认除了root外，没有UID为0的账户&lt;br /&gt;检查方法：awk -F: '($3 == 0) { print $1 }' /etc/passwd &lt;br /&gt;任何UID为0的账户都拥有系统的超级用户权限，唯一的超级用户应该是root，而且还应该通过非特权账户su来获得权限。&lt;/p&gt;&lt;p&gt;6、用户主目录应为750权限或者更多的限制&lt;br /&gt;用户主目录如果有任何人可写的目录，可以导致别人窃取、修改数据，或者获得其他用户的权限。对其他组成员，取消读、执行权限。不过在全局对用户主目录的权限进行修改，可能会造成服务中断。&lt;/p&gt;&lt;p&gt;7、删除User.netrc文件&lt;br /&gt;find / -name .netrc&lt;br /&gt;.netrc是ftp命令的初始化文件，能够给Ftp带来一定的方便。但文件可能包含未加密的密码。在上出他们之前，要考虑.netrc文件的作用，因为可能会影响应用。但是一个良好设计的应用，不应该使用.netrc。&lt;/p&gt;&lt;p&gt;8、设置默认的用户umask值&lt;br /&gt;将umask设置为077，这样由用户创建的文件和目录不会被系统上任何其他人可读。如果需要改变权限可通过chmod命令。可将uamsk命令插入到shell配置文件中来实现，例如.profile, .cshrc, etc.等。027可让同组人员可读，而022的umask值可让系统上每个用户都可读。但是，过于严格的umask会导致软件的安装问题，比如umask设置为700，那么他的应用程序或者守护进程就无法读取文件。所以一般umask的设置不能过于严格，或者在文件安装之后再控制umask。&lt;/p&gt;&lt;p&gt;9、关闭核心转储&lt;br /&gt;这个问题需要问一下你的软件开发商们，他们是否需要调试程序，或者需要看到debug的信息？如果答案是否定的，则可以关闭。核心转储会大量消耗磁盘空间，并且核心转储会包含敏感数据。开发人员需要用这个功能来帮助调试。/etc/security下的limits.con文件是用来控制核心转储的开关。&lt;/p&gt;&lt;p&gt;10、限制root账户su&lt;br /&gt;su命令允许你成为系统上的其他用户，常常被用来作为root执行命令。如果不希望某些用户可以su到root，在/etc/pam.d/su下加入：&lt;/p&gt;&lt;p&gt;auth required pam_wheel.so&lt;/p&gt;&lt;p&gt;这行命令的意思是，只允许wheel组的用户，可以su为root。其他用户在su root的时候，会收到一条消息，说该密码是不正确的。通过限制使用root账户，即使用户知道root密码，也无法成为root用户，除非它能够物理上控制这个服务器，或者他被添加到wheel组。&lt;br /&gt;这样就增加了一个安全保护层，防止未经授权的访问。&lt;/p&gt;&lt;p&gt;九、杀毒&lt;/p&gt;&lt;p&gt;在有些系统上，比如邮件服务器、文件服务器，主要是给windows用户使用的，应该有杀毒软件来保护。linux平台下的杀毒软件有：&lt;br /&gt;Sophos http://www.sophos.com/ 商业软件&lt;br /&gt;NAI Virus Scan                商业软件&lt;br /&gt;McAfee http://www.mcafee.com/ 商业软件&lt;br /&gt;ClamAV http://www.clamav.net/ 开源软件&lt;br /&gt;f-prot Antivirus              商业软件&lt;br /&gt;f-prot Antivirus http://www.f-prot.com 商业软件&lt;br /&gt;Trend Micro                            商业软件&lt;br /&gt;Computer Associates InoculateIT http://www.cai.com/ 商业软件&lt;/p&gt;&lt;p&gt;十、其他&lt;/p&gt;&lt;p&gt;1、对于危险文件创建符号链接&lt;br /&gt;/root/.rhosts, /root/.shosts, /etc/hosts.equiv等文件的访问控制很薄弱，我们在第七章里已经讨论过了，攻击者会经常针对这些漏洞进行攻击，把他们链接到/dev/null，意味着任何数据都会被简单的抛弃。&lt;/p&gt;&lt;p&gt;可以使用这个脚本：&lt;br /&gt;for FILE in /root/.rhosts /root/.shosts /etc/hosts.equiv \&lt;br /&gt;/etc/shosts.equiv; do&lt;br /&gt;rm -f $FILE&lt;br /&gt;ln -s /dev/null $FILE&lt;br /&gt;done&lt;/p&gt;&lt;p&gt;2、打开TCP SYN Cookie的保护&lt;/p&gt;&lt;p&gt;SYN攻击是一种拒绝服务攻击，目的在于消耗系统资源。这个攻击是由于TCP连接握手协议的漏洞，对方发送SYN信息，然后不再回应。这样的攻击就使得系统与数百或者上千的连接保持半开状态。是一个非常简单的攻击方法。&lt;/p&gt;&lt;p&gt;3、LILO/GRUB安全&lt;/p&gt;&lt;p&gt;给LILO和GRUB加上一个i的属性，这样他既不能删除也不能修改，可以有效地防止配置文件发生任何变化（不管是意外或者其他原因）。如果想要修改，必须用chattr -i命令。&lt;br /&gt;chattr +i /etc/lilo.conf&lt;br /&gt;chattr +i /boot/grub/menu.lst&lt;/p&gt;&lt;p&gt;4、配置sudo&lt;/p&gt;&lt;p&gt;sudo的是一个文件包，它允许管理员授权给用户做一些特权，这些特权超出了用户的权限，比如重启web服务。我们举个例子，因为你的web服务有bug或者不断的出现故障，那你可能需要不断地修改web的配置文件来让找出问题原因。这时候如果你要用su - root的话就会非常繁琐，因为你只是在改完配置文件之后，重启一下web服务而已。这时候sudo就派上用场了，它允许管理员授权给该用户权利来重启web服务。sudo安装之后，使用visudo来配置而不是vi配置文件，因为visudo有错误检查功能。&lt;/p&gt;&lt;p&gt;5、删除所有的编译器和汇编程序&lt;/p&gt;&lt;p&gt;在安全上，C编译器会构成对系统可信的威胁。编译器应该安装在开发系统的机器上，而不是一个生产应用系统上。这里只是提醒注意检查。检查这些：gcc、gcc3、gcc3-c++、 gcc3-g77、gcc3-java、gcc3-objc、gcc-c++、gcc-chill、 gcc-g77、gcc-java、gcc-objc、bin86、dev86、nasm。&lt;/p&gt;&lt;img src="http://www.cnblogs.com/WuCountry/aggbug/2477863.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477863.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477767.html</id><title type="text">[Copy]如何使用qemu执行交叉环境下的内核镜像文件</title><summary type="text">http://balau82.wordpress.com/2010/03/22/compiling-linux-kernel-for-qemu-arm-emulator/Compiling Linux kernel for QEMU ARMemulatorPosted on 2010/03/22197[EDIT] I have written a new updated version of this posthere.Last time I experimented oncompiling bare-metal ARMprograms andU-Boot; now I want to com</summary><published>2012-05-01T03:52:00Z</published><updated>2012-05-01T03:52:00Z</updated><author><name>Wu.Country@侠缘</name><uri>http://www.cnblogs.com/WuCountry/</uri></author><link rel="alternate" href="http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477767.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477767.html"/><content type="html">&lt;p&gt;&lt;a href="http://balau82.wordpress.com/2010/03/22/compiling-linux-kernel-for-qemu-arm-emulator/"&gt;http://balau82.wordpress.com/2010/03/22/compiling-linux-kernel-for-qemu-arm-emulator/&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div id="header-about" style="font-family: Georgia, 'Times New Roman', Times, serif; font-size: 13px; line-height: normal; background-color: #ffffff; "&gt;&lt;p&gt;&lt;strong&gt;Compiling Linux kernel for QEMU ARM&amp;nbsp;emulator&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;&lt;div style="color: #777777; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 13px; line-height: normal; background-color: #ffffff; "&gt;&lt;p&gt;&lt;em&gt;Posted on 2010/03/22&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="margin-left: 5px; padding-left: 20px; background-image: url(http://s2.wp.com/wp-content/themes/pub/inuit-types/images/comments-trans.png); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: 0px 0px; background-repeat: no-repeat no-repeat; "&gt;&lt;a href="http://balau82.wordpress.com/2010/03/22/compiling-linux-kernel-for-qemu-arm-emulator/#comments" style="color: #777777; text-decoration: none; font-size: 22px; "&gt;197&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div style="clear: both; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 13px; line-height: normal; background-color: #ffffff; "&gt;&lt;/div&gt;&lt;br style="font-family: Georgia, 'Times New Roman', Times, serif; font-size: 13px; line-height: normal; background-color: #ffffff; " /&gt;&lt;div style="color: #333333; padding-top: 0px; padding-right: 0px; padding-bottom: 30px; padding-left: 0px; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 13px; line-height: normal; background-color: #ffffff; "&gt;&lt;p&gt;&lt;em&gt;[EDIT] I have written a new updated version of this post&amp;nbsp;&lt;a href="http://balau82.wordpress.com/2012/03/31/compile-linux-kernel-3-2-for-arm-and-emulate-with-qemu/" style="color: #222222; "&gt;here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Last time I experimented on&amp;nbsp;&lt;a href="http://balau82.wordpress.com/2010/02/28/hello-world-for-bare-metal-arm-using-qemu/" style="color: #222222; "&gt;compiling bare-metal ARM&lt;/a&gt;&amp;nbsp;programs and&amp;nbsp;&lt;a href="http://balau82.wordpress.com/2010/03/10/u-boot-for-arm-on-qemu/" style="color: #222222; "&gt;U-Boot&lt;/a&gt;; now I want to compile a Linux kernel for an ARM architecture from scratch. I don&amp;#8217;t have a physical ARM device handy, so I&amp;#8217;m using QEMU instead, as I&amp;#8217;ve already done before.&lt;/p&gt;&lt;p&gt;Both the mainline kernel and QEMU support the&amp;nbsp;&lt;a href="http://www.arm.com/products/tools/versatile.php" style="color: #222222; "&gt;VersatilePB&lt;/a&gt;&amp;nbsp;platform, so that&amp;#8217;s the target I chose for my tests. The toolchain I&amp;#8217;ll be using is the&amp;nbsp;&lt;a href="http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite" style="color: #222222; "&gt;CodeSourcery ARM EABI toolchain&lt;/a&gt;. [edit] From version 2010q1 of the toolchain, the manual explicitly says that the compiler is not intended for Linux kernel development; it is anyway possible to use the GNU/Linux toolchain for the same scope. [/edit]&lt;/p&gt;&lt;p&gt;The vanilla kernel can be downloaded from&amp;nbsp;&lt;a href="http://kernel.org/" style="color: #222222; "&gt;kernel.org&lt;/a&gt;; I took the latest at the moment (&lt;a href="http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.33.tar.bz2" style="color: #222222; "&gt;version 2.6.33&lt;/a&gt;) and extracted it in a folder. From that folder I ran:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div id="highlighter_450376"  "="" style="margin-top: 1em !important; margin-right: 0px !important; margin-bottom: 1em !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 1px !important; border-right-width: 1px !important; border-bottom-width: 1px !important; border-left-width: 1px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: relative !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 603px; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-top-color: #e0e0e0 !important; border-right-color: #e0e0e0 !important; border-bottom-color: #e0e0e0 !important; border-left-color: #e0e0e0 !important; "&gt;&lt;div style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;div alt1"="" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;table style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-collapse: collapse !important; "&gt;&lt;tbody style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;tr style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;td style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 3em !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; color: #afafaf !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0.3em !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; text-align: right !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 2.7em !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: block !important; "&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td style="left: auto !important; overflow-x: hidden; overflow-y: hidden; width: auto !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0.5em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 3px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-left-style: solid !important; border-left-color: #cccccc !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; "&gt;make ARCH=arm versatile_defconfig&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;This command sets a predefined configuration, used in compilation, that is capable of building a kernel targeted to run inside the VersatilePB board. I wanted to tweak it a little bit, so I ran:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div id="highlighter_742740"  "="" style="margin-top: 1em !important; margin-right: 0px !important; margin-bottom: 1em !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 1px !important; border-right-width: 1px !important; border-bottom-width: 1px !important; border-left-width: 1px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: relative !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 603px; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-top-color: #e0e0e0 !important; border-right-color: #e0e0e0 !important; border-bottom-color: #e0e0e0 !important; border-left-color: #e0e0e0 !important; "&gt;&lt;div style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;div alt1"="" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;table style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-collapse: collapse !important; "&gt;&lt;tbody style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;tr style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;td style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 3em !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; color: #afafaf !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0.3em !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; text-align: right !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 2.7em !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: block !important; "&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td style="left: auto !important; overflow-x: hidden; overflow-y: hidden; width: auto !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0.5em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 3px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-left-style: solid !important; border-left-color: #cccccc !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; "&gt;make ARCH=arm menuconfig&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;I removed module support (for simplicity) and enabled EABI support as a binary format (allowing also old ABI). This is necessary to run software compiled with the CodeSourcery toolchain. I exited the menu and saved the configuration, then I ran:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div id="highlighter_97781"  "="" style="margin-top: 1em !important; margin-right: 0px !important; margin-bottom: 1em !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 1px !important; border-right-width: 1px !important; border-bottom-width: 1px !important; border-left-width: 1px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: relative !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 603px; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-top-color: #e0e0e0 !important; border-right-color: #e0e0e0 !important; border-bottom-color: #e0e0e0 !important; border-left-color: #e0e0e0 !important; "&gt;&lt;div style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;div alt1"="" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;table style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-collapse: collapse !important; "&gt;&lt;tbody style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;tr style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;td style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 3em !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; color: #afafaf !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0.3em !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; text-align: right !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 2.7em !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: block !important; "&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td style="left: auto !important; overflow-x: hidden; overflow-y: hidden; width: auto !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0.5em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 3px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-left-style: solid !important; border-left-color: #cccccc !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; "&gt;make ARCH=arm CROSS_COMPILE=arm-none-eabi- all&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;[edit] If using the GNU/Linux toolchain, the command that must be used is, instead:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div id="highlighter_422414"  "="" style="margin-top: 1em !important; margin-right: 0px !important; margin-bottom: 1em !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 1px !important; border-right-width: 1px !important; border-bottom-width: 1px !important; border-left-width: 1px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: relative !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 603px; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-top-color: #e0e0e0 !important; border-right-color: #e0e0e0 !important; border-bottom-color: #e0e0e0 !important; border-left-color: #e0e0e0 !important; "&gt;&lt;div style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;div alt1"="" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;table style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-collapse: collapse !important; "&gt;&lt;tbody style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;tr style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;td style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 3em !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; color: #afafaf !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0.3em !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; text-align: right !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 2.7em !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: block !important; "&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td style="left: auto !important; overflow-x: hidden; overflow-y: hidden; width: auto !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0.5em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 3px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-left-style: solid !important; border-left-color: #cccccc !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; "&gt;make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- all&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;[/edit]&lt;/p&gt;&lt;p&gt;This will start the building of the kernel using the correct ARM compiler; the build will create, among other binaries, a compressed kernel in a file called&amp;nbsp;&lt;code style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffc1; background-position: initial initial; background-repeat: initial initial; "&gt;zImage&lt;/code&gt;&amp;nbsp;located in &amp;#8220;&lt;code style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffc1; background-position: initial initial; background-repeat: initial initial; "&gt;arch/arm/boot&lt;/code&gt;&amp;#8220;. This image can be run in QEMU using the following command (assuming that you are in the &amp;#8220;&lt;code style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffc1; background-position: initial initial; background-repeat: initial initial; "&gt;arch/arm/boot&lt;/code&gt;&amp;#8221; directory):&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div id="highlighter_109472"  "="" style="margin-top: 1em !important; margin-right: 0px !important; margin-bottom: 1em !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 1px !important; border-right-width: 1px !important; border-bottom-width: 1px !important; border-left-width: 1px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: relative !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 603px; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-top-color: #e0e0e0 !important; border-right-color: #e0e0e0 !important; border-bottom-color: #e0e0e0 !important; border-left-color: #e0e0e0 !important; "&gt;&lt;div style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;div alt1"="" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;table style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-collapse: collapse !important; "&gt;&lt;tbody style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;tr style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;td style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 3em !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; color: #afafaf !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0.3em !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; text-align: right !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 2.7em !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: block !important; "&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td style="left: auto !important; overflow-x: hidden; overflow-y: hidden; width: auto !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0.5em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 3px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-left-style: solid !important; border-left-color: #cccccc !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; "&gt;qemu-system-arm -M versatilepb -m 128M -kernel zImage&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;QEMU will execute the Linux image: the kernel will display many boot messages and then it will complain that it didn&amp;#8217;t find a root filesystem. Let&amp;#8217;s then create the simplest filesystem we can do: it consists of a single &amp;#8220;Hello World&amp;#8221; executable, that can be built using the&amp;nbsp;&lt;a href="http://www.codesourcery.com/sgpp/lite/arm/portal/subscription?@template=lite" style="color: #222222; "&gt;CodeSourcery GNU/Linux toolchain&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div id="highlighter_772769"  "="" style="margin-top: 1em !important; margin-right: 0px !important; margin-bottom: 1em !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 1px !important; border-right-width: 1px !important; border-bottom-width: 1px !important; border-left-width: 1px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: relative !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 603px; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-top-color: #e0e0e0 !important; border-right-color: #e0e0e0 !important; border-bottom-color: #e0e0e0 !important; border-left-color: #e0e0e0 !important; "&gt;&lt;div style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;div alt1"="" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;table style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-collapse: collapse !important; "&gt;&lt;tbody style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;tr style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;td style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 3em !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; color: #afafaf !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0.3em !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; text-align: right !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 2.7em !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: block !important; "&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td style="left: auto !important; overflow-x: hidden; overflow-y: hidden; width: auto !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0.5em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 3px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-left-style: solid !important; border-left-color: #cccccc !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; color: gray !important; "&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div alt2"="" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #f8f8f8 !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;table style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-collapse: collapse !important; "&gt;&lt;tbody style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;tr style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;td style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 3em !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; color: #afafaf !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0.3em !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; text-align: right !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 2.7em !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: block !important; "&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td style="left: auto !important; overflow-x: hidden; overflow-y: hidden; width: auto !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0.5em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 3px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-left-style: solid !important; border-left-color: #cccccc !important; "&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div alt1"="" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;table style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-collapse: collapse !important; "&gt;&lt;tbody style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;tr style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;td style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 3em !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; color: #afafaf !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0.3em !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; text-align: right !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 2.7em !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: block !important; "&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td style="left: auto !important; overflow-x: hidden; overflow-y: hidden; width: auto !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0.5em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 3px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-left-style: solid !important; border-left-color: #cccccc !important; "&gt;&lt;code bold"="" style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; color: #006699 !important; "&gt;void&lt;/code&gt;&amp;nbsp;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; "&gt;main() {&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div alt2"="" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #f8f8f8 !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;table style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-collapse: collapse !important; "&gt;&lt;tbody style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;tr style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;td style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 3em !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; color: #afafaf !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0.3em !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; text-align: right !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 2.7em !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: block !important; "&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td style="left: auto !important; overflow-x: hidden; overflow-y: hidden; width: auto !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0.5em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 3px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-left-style: solid !important; border-left-color: #cccccc !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; "&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code bold"="" style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; color: #ff1493 !important; "&gt;printf&lt;/code&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; "&gt;(&lt;/code&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; color: blue !important; "&gt;"Hello World!\n"&lt;/code&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; "&gt;);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div alt1"="" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;table style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-collapse: collapse !important; "&gt;&lt;tbody style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;tr style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;td style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 3em !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; color: #afafaf !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0.3em !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; text-align: right !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 2.7em !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: block !important; "&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td style="left: auto !important; overflow-x: hidden; overflow-y: hidden; width: auto !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0.5em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 3px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-left-style: solid !important; border-left-color: #cccccc !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; "&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code bold"="" style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: bold !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; color: #006699 !important; "&gt;while&lt;/code&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; "&gt;(1);&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div alt2"="" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: #f8f8f8 !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;table style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-collapse: collapse !important; "&gt;&lt;tbody style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;tr style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;td style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 3em !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; color: #afafaf !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0.3em !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; text-align: right !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 2.7em !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: block !important; "&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td style="left: auto !important; overflow-x: hidden; overflow-y: hidden; width: auto !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0.5em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 3px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-left-style: solid !important; border-left-color: #cccccc !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; "&gt;}&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Note: an infinite loop is introduced because when Linux executes the first program in the root filesystem, it expects that the program does not exit.&lt;/p&gt;&lt;p&gt;Having the GNU/Linux ARM toolchain installed (be aware that it is different from the bare EABI toolchain) I ran:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div id="highlighter_478088"  "="" style="margin-top: 1em !important; margin-right: 0px !important; margin-bottom: 1em !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 1px !important; border-right-width: 1px !important; border-bottom-width: 1px !important; border-left-width: 1px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: relative !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 603px; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-top-color: #e0e0e0 !important; border-right-color: #e0e0e0 !important; border-bottom-color: #e0e0e0 !important; border-left-color: #e0e0e0 !important; "&gt;&lt;div style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;div alt1"="" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;table style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-collapse: collapse !important; "&gt;&lt;tbody style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;tr style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;td style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 3em !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; color: #afafaf !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0.3em !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; text-align: right !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 2.7em !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: block !important; "&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td style="left: auto !important; overflow-x: hidden; overflow-y: hidden; width: auto !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0.5em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 3px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-left-style: solid !important; border-left-color: #cccccc !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; "&gt;arm-none-linux-gnueabi-gcc -static&amp;nbsp;&amp;nbsp;&amp;nbsp; test.c&amp;nbsp;&amp;nbsp; -o test&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;This creates an executable ELF program for ARM, statically linked (all the libraries that it needs are linked together in a single binary). We can now create a simple filesystem using the&amp;nbsp;&lt;code style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffc1; background-position: initial initial; background-repeat: initial initial; "&gt;cpio&lt;/code&gt;&amp;nbsp;tool as follows:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div id="highlighter_237957"  "="" style="margin-top: 1em !important; margin-right: 0px !important; margin-bottom: 1em !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 1px !important; border-right-width: 1px !important; border-bottom-width: 1px !important; border-left-width: 1px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: relative !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 603px; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-top-color: #e0e0e0 !important; border-right-color: #e0e0e0 !important; border-bottom-color: #e0e0e0 !important; border-left-color: #e0e0e0 !important; "&gt;&lt;div style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;div alt1"="" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;table style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-collapse: collapse !important; "&gt;&lt;tbody style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;tr style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;td style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 3em !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; color: #afafaf !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0.3em !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; text-align: right !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 2.7em !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: block !important; "&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td style="left: auto !important; overflow-x: hidden; overflow-y: hidden; width: auto !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0.5em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 3px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-left-style: solid !important; border-left-color: #cccccc !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; "&gt;echo test | cpio -o --format=newc &amp;gt; rootfs&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;The&amp;nbsp;&lt;code style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffc1; background-position: initial initial; background-repeat: initial initial; "&gt;cpio&lt;/code&gt;&amp;nbsp;tool takes a list of files and outputs an archive; the&amp;nbsp;&lt;code style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffc1; background-position: initial initial; background-repeat: initial initial; "&gt;newc&lt;/code&gt;&amp;nbsp;format is the format of the&lt;code style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffc1; background-position: initial initial; background-repeat: initial initial; "&gt;initramfs&lt;/code&gt;&amp;nbsp;filesystem, that the Linux kernel recognizes. The&amp;nbsp;&lt;code style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffc1; background-position: initial initial; background-repeat: initial initial; "&gt;rootfs&lt;/code&gt;&amp;nbsp;file in our case is a binary image of a filesystem containing a single file, that is the test ELF program. QEMU can pass the filesystem binary image to the kernel using the&amp;nbsp;&lt;code style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffc1; background-position: initial initial; background-repeat: initial initial; "&gt;initrd&lt;/code&gt;&amp;nbsp;parameter; the kernel must also know that the root filesystem will be located in RAM (because that&amp;#8217;s where QEMU writes the&amp;nbsp;&lt;code style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffc1; background-position: initial initial; background-repeat: initial initial; "&gt;initrd&lt;/code&gt;&amp;nbsp;binary) and that the program to launch is our&amp;nbsp;&lt;code style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffc1; background-position: initial initial; background-repeat: initial initial; "&gt;test&lt;/code&gt;&amp;nbsp;executable, so the command line becomes:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div id="highlighter_763941"  "="" style="margin-top: 1em !important; margin-right: 0px !important; margin-bottom: 1em !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 1px !important; border-right-width: 1px !important; border-bottom-width: 1px !important; border-left-width: 1px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: relative !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 603px; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid !important; border-right-style: solid !important; border-bottom-style: solid !important; border-left-style: solid !important; border-top-color: #e0e0e0 !important; border-right-color: #e0e0e0 !important; border-bottom-color: #e0e0e0 !important; border-left-color: #e0e0e0 !important; "&gt;&lt;div style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;div alt1"="" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #0099ff; border-right-color: #0099ff; border-bottom-color: #0099ff; border-left-color: #0099ff; "&gt;&lt;table style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; text-align: left !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-collapse: collapse !important; "&gt;&lt;tbody style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;tr style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; "&gt;&lt;td style="padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 3em !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; color: #afafaf !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0.3em !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; text-align: right !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: 2.7em !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: block !important; "&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td style="left: auto !important; overflow-x: hidden; overflow-y: hidden; width: auto !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0.5em !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 3px !important; border-style: initial !important; border-color: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; float: none !important; vertical-align: top !important; position: static !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; line-height: 1.3em !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; border-left-style: solid !important; border-left-color: #cccccc !important; "&gt;&lt;code style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial !important; border-color: initial !important; border-image: initial !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; line-height: 1.3em !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-size: 11px !important; min-height: inherit !important; direction: ltr !important; text-shadow: none !important; display: inline !important; "&gt;qemu-system-arm -M versatilepb -m 128M -kernel zImage -initrd rootfs -append "root=/dev/ram rdinit=/test"&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;span style="line-height: 20px; background-color: #ffffff; color: #333333; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 13px; "&gt;The QEMU window will show the boot messages we saw before, but at the end of the execution a &amp;#8220;Hello World!&amp;#8221; will be displayed. The next step would be to create a working filesystem with a command shell and at least basic functionality.&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/WuCountry/aggbug/2477767.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/WuCountry/archive/2012/05/01/2477767.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/WuCountry/archive/2012/04/30/2477135.html</id><title type="text">CT-NG编译错误以及解决办法</title><summary type="text">1、Suse12可以使用的最高版本为crosstool-ng-1.13.0，再高的版本会有编译错误信息2、编译时，选择arm-cotex-a8的模板，以及unknow-gnulinux-uclibc的uclibc配置选项，会报：[ERROR] Static linking impossible on the host system 'i686-build pc-linux-gnu'在配置菜单中，将c++的静态链接去掉下 3、编译时，报LD_LIBRARY_PATH环境变量已经被设置；unset一下就可以了；整体来， 比从suse10上一个一个的升级组件来编译要方便的多！</summary><published>2012-04-30T12:06:00Z</published><updated>2012-04-30T12:06:00Z</updated><author><name>Wu.Country@侠缘</name><uri>http://www.cnblogs.com/WuCountry/</uri></author><link rel="alternate" href="http://www.cnblogs.com/WuCountry/archive/2012/04/30/2477135.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/WuCountry/archive/2012/04/30/2477135.html"/><content type="html">&lt;div&gt;1、Suse12可以使用的最高版本为&amp;nbsp;crosstool-ng-1.13.0，再高的版本会有编译错误信息&amp;nbsp;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;2、编译时，选择arm-cotex-a8的模板，以及unknow-gnulinux-uclibc的uclibc配置选项，会报：&amp;nbsp;&lt;/p&gt;&lt;p&gt;[ERROR] Static linking impossible on the host system 'i686-build pc-linux-gnu'&lt;/p&gt;&lt;p&gt;在配置菜单中，将c++的静态链接去掉下 &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;3、编译时，报LD_LIBRARY_PATH环境变量已经被设置；unset一下就可以了；&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;整体来， 比从suse10上一个一个的升级组件来编译要方便的多！&lt;/p&gt;&lt;img src="http://www.cnblogs.com/WuCountry/aggbug/2477135.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/WuCountry/archive/2012/04/30/2477135.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/WuCountry/archive/2012/04/30/2477079.html</id><title type="text">无法忍受在SUSE10上安装开发环境了</title><summary type="text">前见买了台新电脑，计划按照公司的环境搭建一套ARM开发环境。于是找到了Suse10的安装ISO文件，下载了最新的VB，然后将SUSE10安装起来了。 准备开始编译Qemu的虚拟机，结果发现一堆的软件版本对不上，先是glib2的版本不对，于是下了对应的glib2来编译安装，结果发现python的版本不对，又下载了python2.5的版本；安装完成以后，又发现auconf的版本不对，狂昏呀； 当然我知道这个过程很复杂，需要花点时间把这些开源包玩转，但想想，值吗？在一个老的版本上一点一点的升级这些组件，还不如重新更新一个操作系统算了。 选择操作系统是个麻烦的问题，新机器安装的是win7，从来没有用.</summary><published>2012-04-30T10:10:00Z</published><updated>2012-04-30T10:10:00Z</updated><author><name>Wu.Country@侠缘</name><uri>http://www.cnblogs.com/WuCountry/</uri></author><link rel="alternate" href="http://www.cnblogs.com/WuCountry/archive/2012/04/30/2477079.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/WuCountry/archive/2012/04/30/2477079.html"/><content type="html">&lt;p&gt;&amp;nbsp; 前见买了台新电脑，计划按照公司的环境搭建一套ARM开发环境。于是找到了Suse10的安装ISO文件，下载了最新的VB，然后将SUSE10安装起来了。&lt;/p&gt;&lt;p&gt;&amp;nbsp; 准备开始编译Qemu的虚拟机，结果发现一堆的软件版本对不上，先是glib2的版本不对，于是下了对应的glib2来编译安装，结果发现python的版本不对，又下载了python2.5的版本；安装完成以后，又发现auconf的版本不对，狂昏呀； 当然我知道这个过程很复杂，需要花点时间把这些开源包玩转，但想想，值吗？在一个老的版本上一点一点的升级这些组件，还不如重新更新一个操作系统算了。&lt;/p&gt;&lt;p&gt;&amp;nbsp; 选择操作系统是个麻烦的问题，新机器安装的是win7，从来没有用过，还是先熟悉一下。玩了几天，没什么不好的，反正也就这样。而虚拟机里的LinuxServer选择什么呢？还是对Suse比较熟悉一点，就使用它吧，但没有企业版本了，只能下载一个开源的，于是从VeryCD上随便找了一下，最新版本是12.1的 于是花了一下午下载完，就准备安装了。&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; 比较郁闷的是，这个版本比suse10安装慢多了，而且我还给了它2G的内存，有些郁闷！看来硬件难得跟上软件的需求呀，现在的软件太消耗资源了，想起我新win7上安装的QQ，占用了38个线程，近100M的内存（N多服务加在一起），系统一启动就占用了1.3G的内存。唉！看来我们做的系统还算是不错的了，大家都这样玩呀！就希望用户的机器上只有自己的一个产品（百度，QQ，迅雷等国内的这几个都是如此）。&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; 好了，不说了，希望今天能把环境安装好。 &lt;br /&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/WuCountry/aggbug/2477079.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/WuCountry/archive/2012/04/30/2477079.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/WuCountry/archive/2012/03/28/2422126.html</id><title type="text">Windows的路由命令</title><summary type="text">笔记本同时使用本地网卡和wifi链接，本地网卡没有链接到internet，wifi是可以的，但发现无法访问网络。查了一下windows的路由，发现启动了本地网卡以后，默认路由发生了变化，使用windows的路由命令搞定了。</summary><published>2012-03-28T13:49:00Z</published><updated>2012-03-28T13:49:00Z</updated><author><name>Wu.Country@侠缘</name><uri>http://www.cnblogs.com/WuCountry/</uri></author><link rel="alternate" href="http://www.cnblogs.com/WuCountry/archive/2012/03/28/2422126.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/WuCountry/archive/2012/03/28/2422126.html"/><content type="html">&lt;div&gt;&lt;p&gt;&lt;strong&gt;Route&lt;/strong&gt;&lt;/p&gt;&lt;div style="font-family: Simsun; line-height: normal; background-color: #ffffff; font-size: medium; height: 18px; "&gt;&lt;/div&gt;&lt;p&gt;Displays and modifies the entries in the local IP routing table. Used without parameters,&amp;nbsp;&lt;strong&gt;route&lt;/strong&gt;&amp;nbsp;displays help.&lt;/p&gt;&lt;a name="E1" style="color: rgb(0, 51, 204); font-family: Simsun; line-height: normal; background-color: rgb(255, 255, 255); font-size: medium; "&gt;&lt;/a&gt;&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;route&lt;/strong&gt;&amp;nbsp;[&lt;strong&gt;-f&lt;/strong&gt;] [&lt;strong&gt;-p&lt;/strong&gt;] [&lt;em&gt;Command&lt;/em&gt;&amp;nbsp;[&lt;em&gt;Destination&lt;/em&gt;] [&lt;strong&gt;mask&lt;/strong&gt;&amp;nbsp;&lt;em&gt;Netmask&lt;/em&gt;] [&lt;em&gt;Gateway&lt;/em&gt;] [&lt;strong&gt;metric&lt;/strong&gt;&amp;nbsp;&lt;em&gt;Metric&lt;/em&gt;]] [&lt;strong&gt;if&lt;/strong&gt;&amp;nbsp;&lt;em&gt;Interface&lt;/em&gt;]]&lt;/p&gt;&lt;div style="font-family: Simsun; line-height: normal; background-color: #ffffff; font-size: medium; margin-top: 3px; margin-bottom: 10px; "&gt;&lt;a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/route.mspx#top" style="color: #800080; "&gt;&lt;img width="7" height="9" border="0" src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_up.gif" alt="Top of page" /&gt;&lt;/a&gt;&lt;a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/route.mspx#top" style="color: #0033cc; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; padding-left: 4px; padding-right: 4px; "&gt;Top of page&lt;/a&gt;&lt;/div&gt;&lt;a name="EBC" style="color: rgb(0, 51, 204); font-family: Simsun; line-height: normal; background-color: rgb(255, 255, 255); font-size: medium; "&gt;&lt;/a&gt;&lt;p&gt;&lt;strong&gt;Parameters&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;-f&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;:&amp;nbsp;&lt;/strong&gt;Clears the routing table of all entries that are not host routes (routes with a netmask of 255.255.255.255), the loopback network route (routes with a destination of 127.0.0.0 and a netmask of 255.0.0.0), or a multicast route (routes with a destination of 224.0.0.0 and a netmask of 240.0.0.0). If this is used in conjunction with one of the commands (such as&amp;nbsp;&lt;strong&gt;add&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;change&lt;/strong&gt;, or&amp;nbsp;&lt;strong&gt;delete&lt;/strong&gt;), the table is cleared prior to running the command.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;-p&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;:&amp;nbsp;&lt;/strong&gt;When used with the&amp;nbsp;&lt;strong&gt;add&lt;/strong&gt;&amp;nbsp;command, the specified route is added to the registry and is used to initialize the IP routing table whenever the TCP/IP protocol is started. By default, added routes are not preserved when the TCP/IP protocol is started. When used with the&amp;nbsp;&lt;strong&gt;print&lt;/strong&gt;&amp;nbsp;command, the list of persistent routes is displayed. This parameter is ignored for all other commands. Persistent routes are stored in the registry location&lt;strong&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services&lt;/strong&gt;&lt;strong&gt;\Tcpip\Parameters\PersistentRoutes&lt;/strong&gt;.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Command&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;:&amp;nbsp;&lt;/strong&gt;Specifies the command you want to run. The following table lists valid commands.&lt;/p&gt;&lt;table cellspacing="0" id="EQD" cellpadding="0" style="border-bottom-style: solid; border-bottom-color: #cccccc; font-family: Simsun; background-color: #ffffff; "&gt;&lt;thead&gt;&lt;tr valign="top" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #99ccff; "&gt;&lt;td id="colESD" style="padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; border-top-style: solid; border-top-color: #cccccc; border-left-style: solid; border-left-color: #cccccc; "&gt;Command&lt;/td&gt;&lt;td id="colEVD" style="padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; border-top-style: solid; border-top-color: #cccccc; border-left-style: solid; border-left-color: #cccccc; border-right-style: solid; border-right-color: #cccccc; "&gt;Purpose&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr valign="top"&gt;&lt;td style="padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-style: solid; border-top-color: #cccccc; border-left-style: solid; border-left-color: #cccccc; "&gt;&lt;p&gt;&lt;strong&gt;add&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-style: solid; border-top-color: #cccccc; border-left-style: solid; border-left-color: #cccccc; border-right-style: solid; border-right-color: #cccccc; "&gt;&lt;p&gt;Adds a route.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e9e9e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;td style="padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-style: solid; border-top-color: #cccccc; border-left-style: solid; border-left-color: #cccccc; "&gt;&lt;p&gt;&lt;strong&gt;change&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-style: solid; border-top-color: #cccccc; border-left-style: solid; border-left-color: #cccccc; border-right-style: solid; border-right-color: #cccccc; "&gt;&lt;p&gt;Modifies an existing route.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top"&gt;&lt;td style="padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-style: solid; border-top-color: #cccccc; border-left-style: solid; border-left-color: #cccccc; "&gt;&lt;p&gt;&lt;strong&gt;delete&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-style: solid; border-top-color: #cccccc; border-left-style: solid; border-left-color: #cccccc; border-right-style: solid; border-right-color: #cccccc; "&gt;&lt;p&gt;Deletes a route or routes.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign="top" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e9e9e6; background-position: initial initial; background-repeat: initial initial; "&gt;&lt;td style="padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-style: solid; border-top-color: #cccccc; border-left-style: solid; border-left-color: #cccccc; "&gt;&lt;p&gt;&lt;strong&gt;print&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; border-top-style: solid; border-top-color: #cccccc; border-left-style: solid; border-left-color: #cccccc; border-right-style: solid; border-right-color: #cccccc; "&gt;&lt;p&gt;Prints a route or routes.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="height: 1px; overflow-x: hidden; overflow-y: hidden; margin-bottom: 18px; font-family: Simsun; line-height: normal; background-color: #ffffff; font-size: medium; "&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Destination&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;:&amp;nbsp;&lt;/strong&gt;Specifies the network destination of the route. The destination can be an IP network address (where the host bits of the network address are set to 0), an IP address for a host route, or 0.0.0.0 for the default route.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;mask&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;Netmask&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;:&amp;nbsp;&lt;/strong&gt;Specifies the netmask (also known as a subnet mask) associated with the network destination. The subnet mask can be the appropriate subnet mask for an IP network address, 255.255.255.255 for a host route, or 0.0.0.0 for the default route. If omitted, the subnet mask 255.255.255.255 is used. Because of the relationship between the destination and the subnet mask in defining routes, the destination cannot be more specific than its corresponding subnet mask. In other words, there cannot be a bit set to 1 in the destination if the corresponding bit in the subnet mask is a 0.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Gateway&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;:&amp;nbsp;&lt;/strong&gt;Specifies the forwarding or next hop IP address over which the set of addresses defined by the network destination and subnet mask are reachable. For locally attached subnet routes, the gateway address is the IP address assigned to the interface that is attached to the subnet. For remote routes, available across one or more routers, the gateway address is a directly reachable IP address that is assigned to a neighboring router.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;metric&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;Metric&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;:&amp;nbsp;&lt;/strong&gt;Specifies an integer cost metric (ranging from 1 to 9999) for the route, which is used when choosing among multiple routes in the routing table that most closely match the destination address of a packet being forwarded. The route with the lowest metric is chosen. The metric can reflect the number of hops, the speed of the path, path reliability, path throughput, or administrative properties.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;if&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;Interface&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;:&amp;nbsp;&lt;/strong&gt;Specifies the interface index for the interface over which the destination is reachable. For a list of interfaces and their corresponding interface indexes, use the display of the&amp;nbsp;&lt;strong&gt;route print&lt;/strong&gt;&amp;nbsp;command. You can use either decimal or hexadecimal values for the interface index. For hexadecimal values, precede the hexadecimal number with&amp;nbsp;&lt;strong&gt;0x&lt;/strong&gt;. When the&amp;nbsp;&lt;strong&gt;if&lt;/strong&gt;&amp;nbsp;parameter is omitted, the interface is determined from the gateway address.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;/?&lt;/strong&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;strong&gt;:&amp;nbsp;&lt;/strong&gt;Displays help at the command prompt.&lt;/p&gt;&lt;div style="font-family: Simsun; line-height: normal; background-color: #ffffff; font-size: medium; margin-top: 3px; margin-bottom: 10px; "&gt;&lt;a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/route.mspx#top" style="color: #800080; "&gt;&lt;img width="7" height="9" border="0" src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_up.gif" alt="Top of page" /&gt;&lt;/a&gt;&lt;a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/route.mspx#top" style="color: #0033cc; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; padding-left: 4px; padding-right: 4px; "&gt;Top of page&lt;/a&gt;&lt;/div&gt;&lt;a name="E2G" style="color: rgb(0, 51, 204); font-family: Simsun; line-height: normal; background-color: rgb(255, 255, 255); font-size: medium; "&gt;&lt;/a&gt;&lt;p&gt;&lt;strong&gt;Remarks&lt;/strong&gt;&lt;/p&gt;&lt;table cellspacing="0" cellpadding="0" border="0" style="font-family: Simsun; background-color: #ffffff; "&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top" style="color: #a6a6a6; font-size: 19px; "&gt;&amp;#8226;&lt;/td&gt;&lt;td style="padding-top: 0em; padding-right: 0em; padding-bottom: 0em; padding-left: 0.5em; "&gt;&lt;p&gt;Large values in the&amp;nbsp;&lt;strong&gt;metric&lt;/strong&gt;&amp;nbsp;column of the routing table are the result of allowing TCP/IP to automatically determine the metric for routes in the routing table based on the configuration of IP address, subnet mask, and default gateway for each LAN interface. Automatic determination of the interface metric, enabled by default, determines the speed of each interface and adjusts the metrics of routes for each interface so that the fastest interface creates the routes with the lowest metric. To remove the large metrics, disable the automatic determination of the interface metric from the advanced properties of the TCP/IP protocol for each LAN connection.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top" style="color: #a6a6a6; font-size: 19px; "&gt;&amp;#8226;&lt;/td&gt;&lt;td style="padding-top: 0em; padding-right: 0em; padding-bottom: 0em; padding-left: 0.5em; "&gt;&lt;p&gt;Names can be used for&amp;nbsp;&lt;em&gt;Destination&lt;/em&gt;&amp;nbsp;if an appropriate entry exists in the local Networks file stored in the&amp;nbsp;&lt;em&gt;systemroot&lt;/em&gt;\System32\Drivers\Etc folder. Names can be used for the&amp;nbsp;&lt;em&gt;gateway&lt;/em&gt;&amp;nbsp;as long as they can be resolved to an IP address through standard host name resolution techniques such as Domain Name System (DNS) queries, use of the local Hosts file stored in the&amp;nbsp;&lt;em&gt;systemroot&lt;/em&gt;\system32\drivers\etc folder, and NetBIOS name resolution.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top" style="color: #a6a6a6; font-size: 19px; "&gt;&amp;#8226;&lt;/td&gt;&lt;td style="padding-top: 0em; padding-right: 0em; padding-bottom: 0em; padding-left: 0.5em; "&gt;&lt;p&gt;If the command is&amp;nbsp;&lt;strong&gt;print&lt;/strong&gt;&amp;nbsp;or&amp;nbsp;&lt;strong&gt;delete&lt;/strong&gt;, the&amp;nbsp;&lt;em&gt;Gateway&lt;/em&gt;&amp;nbsp;parameter can be omitted and wildcards can be used for the destination and gateway. The&amp;nbsp;&lt;em&gt;Destination&lt;/em&gt;&amp;nbsp;value can be a wildcard value specified by an asterisk (*). If the destination specified contains an asterisk (*) or a question mark (?), it is treated as a wildcard and only matching destination routes are printed or deleted. The asterisk matches any string, and the question mark matches any single character. For example, 10.*.1, 192.168.*, 127.*, and *224* are all valid uses of the asterisk wildcard.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top" style="color: #a6a6a6; font-size: 19px; "&gt;&amp;#8226;&lt;/td&gt;&lt;td style="padding-top: 0em; padding-right: 0em; padding-bottom: 0em; padding-left: 0.5em; "&gt;&lt;p&gt;Using an invalid combination of a destination and subnet mask (netmask) value displays a "Route: bad gateway address netmask" error message. This error message appears when the destination contains one or more bits set to 1 in bit locations where the corresponding subnet mask bit is set to 0. To test this condition, express the destination and subnet mask using binary notation. The subnet mask in binary notation consists of a series of 1 bits, representing the network address portion of the destination, and a series of 0 bits, representing the host address portion of the destination. Check to determine whether there are bits in the destination that are set to 1 for the portion of the destination that is the host address (as defined by the subnet mask).&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top" style="color: #a6a6a6; font-size: 19px; "&gt;&amp;#8226;&lt;/td&gt;&lt;td style="padding-top: 0em; padding-right: 0em; padding-bottom: 0em; padding-left: 0.5em; "&gt;&lt;p&gt;The&amp;nbsp;&lt;strong&gt;-p&lt;/strong&gt;&amp;nbsp;parameter is only supported on the route command for Windows&amp;nbsp;NT&amp;nbsp;4.0, Windows&amp;nbsp;2000, Windows&amp;nbsp;Millennium&amp;nbsp;Edition, and Windows&amp;nbsp;XP. This parameter is not supported by the&amp;nbsp;&lt;strong&gt;route&lt;/strong&gt;&amp;nbsp;command for Windows&amp;nbsp;95 or Windows&amp;nbsp;98.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top" style="color: #a6a6a6; font-size: 19px; "&gt;&amp;#8226;&lt;/td&gt;&lt;td style="padding-top: 0em; padding-right: 0em; padding-bottom: 0em; padding-left: 0.5em; "&gt;&lt;p&gt;This command is available only if the&amp;nbsp;&lt;strong&gt;Internet Protocol (TCP/IP)&lt;/strong&gt;&amp;nbsp;protocol is installed as a component in the properties of a network adapter in Network Connections&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div style="font-family: Simsun; line-height: normal; background-color: #ffffff; font-size: medium; margin-top: 3px; margin-bottom: 10px; "&gt;&lt;a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/route.mspx#top" style="color: #800080; "&gt;&lt;img width="7" height="9" border="0" src="http://www.microsoft.com/library/gallery/templates/MNP2.Common/images/arrow_px_up.gif" alt="Top of page" /&gt;&lt;/a&gt;&lt;a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/route.mspx#top" style="color: #0033cc; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; padding-left: 4px; padding-right: 4px; "&gt;Top of page&lt;/a&gt;&lt;/div&gt;&lt;a name="EVAAC" style="color: rgb(0, 51, 204); font-family: Simsun; line-height: normal; background-color: rgb(255, 255, 255); font-size: medium; "&gt;&lt;/a&gt;&lt;p&gt;&lt;strong&gt;Examples&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To display the entire contents of the IP routing table, type:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;route print&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To display the routes in the IP routing table that begin with&amp;nbsp;&lt;em&gt;10.&lt;/em&gt;, type:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;route print 10.*&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To add a default route with the default gateway address of 192.168.12.1, type:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;route add 0.0.0.0 mask 0.0.0.0 192.168.12.1&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To add a route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0 and the next hop address of 10.27.0.1, type:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;route add 10.41.0.0 mask 255.255.0.0 10.27.0.1&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To add a persistent route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0 and the next hop address of 10.27.0.1, type:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;route -p add 10.41.0.0 mask 255.255.0.0 10.27.0.1&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To add a route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0, the next hop address of 10.27.0.1, and the cost metric of 7, type:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 metric 7&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To add a route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0, the next hop address of 10.27.0.1, and using the interface index 0x3, type:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 if 0x3&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To delete the route to the destination 10.41.0.0 with the subnet mask of 255.255.0.0, type:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;route delete 10.41.0.0 mask 255.255.0.0&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To delete all routes in the IP routing table that begin with&amp;nbsp;&lt;em&gt;10.&lt;/em&gt;, type:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;route delete 10.*&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To change the next hop address of the route with the destination of 10.41.0.0 and the subnet mask of 255.255.0.0 from 10.27.0.1 to 10.27.0.25, type:&lt;/p&gt;&lt;p&gt;&lt;strong&gt;route change 10.41.0.0 mask 255.255.0.0 10.27.0.25&lt;/strong&gt;&lt;/p&gt;&lt;/div&gt;&lt;img src="http://www.cnblogs.com/WuCountry/aggbug/2422126.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/WuCountry/archive/2012/03/28/2422126.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/WuCountry/archive/2011/08/21/2147603.html</id><title type="text">【CLFS】记录：</title><summary type="text">CLFS在线文档：http://cross-lfs.org/view/clfs-embedded/arm/index.html1、环境变量准备:export CLFS_HOST=$(echo ${MACHTYPE} | sed "s/-[^-]*/-cross/")export CLFS=/home/wutiejun/host/clfsexport CLFS_HOST=i686-cross-linuxexport CLFS_TARGET=arm-wap-linux-uclibceabiexport CLFS_PREFIX=/home/wutiejun/host/clfs/c</summary><published>2011-08-20T16:28:00Z</published><updated>2011-08-20T16:28:00Z</updated><author><name>Wu.Country@侠缘</name><uri>http://www.cnblogs.com/WuCountry/</uri></author><link rel="alternate" href="http://www.cnblogs.com/WuCountry/archive/2011/08/21/2147603.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/WuCountry/archive/2011/08/21/2147603.html"/><content type="html">&lt;p&gt;CLFS在线文档：&lt;br /&gt;&lt;a href="http://cross-lfs.org/view/clfs-embedded/arm/index.html"&gt;http://cross-lfs.org/view/clfs-embedded/arm/index.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;1、环境变量准备:&lt;br /&gt;export CLFS_HOST=$(echo ${MACHTYPE} | sed "s/-[^-]*/-cross/")&lt;/p&gt;&lt;p&gt;export CLFS=/home/wutiejun/host/clfs&lt;br /&gt;export CLFS_HOST=i686-cross-linux&lt;br /&gt;export CLFS_TARGET=arm-wap-linux-uclibceabi&lt;br /&gt;export CLFS_PREFIX=/home/wutiejun/host/clfs/cross-tools&lt;br /&gt;export CLFS_ARCH="arm"&lt;br /&gt;export CLFS_ENDIAN="little"&lt;br /&gt;export CLFS_FLOAT="soft"&lt;br /&gt;export CLFS_ABI="aapcs-linux"&lt;br /&gt;export CLFS_ARM_ARCH="armv6"&lt;br /&gt;export CLFS_ARM_MODE="arm"&lt;br /&gt;export CLFS_FPU=""&lt;/p&gt;&lt;p&gt;/home/wutiejun/host/clfs/cross-tools/usr/include&lt;/p&gt;&lt;p&gt;arm-wap-linux-uclibceabi-&lt;/p&gt;&lt;p&gt;2、准备内核头文件：&lt;br /&gt;make mrproper&lt;br /&gt;make ARCH=${CLFS_ARCH} headers_check&lt;br /&gt;make ARCH=${CLFS_ARCH} INSTALL_HDR_PATH=${CLFS_PREFIX}/usr/include headers_install&lt;/p&gt;&lt;p&gt;cp -rv dest/include/* ${CLFS}/usr/include&lt;/p&gt;&lt;p&gt;&lt;br /&gt;3、GMP包编译：&lt;br /&gt;CPPFLAGS=-fexceptions ./configure \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --prefix=${CLFS}/cross-tools&lt;/p&gt;&lt;p&gt;make &lt;br /&gt;make check&lt;br /&gt;make install&lt;/p&gt;&lt;p&gt;3、编译MPFR包：&lt;br /&gt;LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \&lt;br /&gt;&amp;nbsp; ./configure --prefix=${CLFS}/cross-tools --enable-shared \&lt;br /&gt;&amp;nbsp; --with-gmp=${CLFS}/cross-tools&lt;/p&gt;&lt;p&gt;make &lt;br /&gt;make install&lt;/p&gt;&lt;p&gt;3、编译MPC包：&lt;br /&gt;LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \&lt;br /&gt;&amp;nbsp; ./configure --prefix=${CLFS}/cross-tools \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --with-gmp=${CLFS}/cross-tools \&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --with-mpfr=${CLFS}/cross-tools&lt;/p&gt;&lt;p&gt;make&lt;br /&gt;make install&lt;/p&gt;&lt;p&gt;&lt;br /&gt;3、编译binutils；&lt;br /&gt;config参数：&lt;/p&gt;&lt;p&gt;../binutils-2.21/configure --prefix=${CLFS}/cross-tools \&lt;br /&gt;&amp;nbsp;&amp;nbsp; --target=${CLFS_TARGET} --with-sysroot=${CLFS} --disable-nls \&lt;br /&gt;&amp;nbsp;&amp;nbsp; --enable-shared --disable-multilib&lt;/p&gt;&lt;p&gt;make configure-host&lt;br /&gt;make&lt;/p&gt;&lt;p&gt;make install&lt;/p&gt;&lt;p&gt;cp -v ../binutils-2.21/include/libiberty.h ${CLFS}/usr/include&lt;/p&gt;&lt;p&gt;&lt;br /&gt;4、编译静态gcc：&lt;/p&gt;&lt;p&gt;AR=ar LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \&lt;br /&gt;&amp;nbsp; ../gcc-4.6.0/configure --prefix=${CLFS}/cross-tools \&lt;br /&gt;&amp;nbsp; --build=${CLFS_HOST} --host=${CLFS_HOST} --target=${CLFS_TARGET} \&lt;br /&gt;&amp;nbsp; --with-sysroot=${CLFS} --disable-nls&amp;nbsp; --disable-shared \&lt;br /&gt;&amp;nbsp; --with-mpfr=${CLFS}/cross-tools --with-gmp=${CLFS}/cross-tools \&lt;br /&gt;&amp;nbsp; --with-mpc=${CLFS}/cross-tools --without-headers --with-newlib \&lt;br /&gt;&amp;nbsp; --disable-decimal-float --disable-libgomp --disable-libmudflap \&lt;br /&gt;&amp;nbsp; --disable-libssp --disable-threads --enable-languages=c \&lt;br /&gt;&amp;nbsp; --disable-multilib --with-abi=${CLFS_ABI} --with-arch=${CLFS_ARM_ARCH} \&lt;br /&gt;&amp;nbsp; --with-mode=${CLFS_ARM_MODE} --with-float=${CLFS_FLOAT} \&lt;br /&gt;&amp;nbsp; --with-fpu=${CLFS_FPU}&lt;/p&gt;&lt;p&gt;make all-gcc all-target-libgcc&lt;/p&gt;&lt;p&gt;make install-gcc install-target-libgcc&lt;/p&gt;&lt;p&gt;&lt;br /&gt;5、编译uclibc:&lt;br /&gt;declare -x &lt;/p&gt;&lt;p&gt;PATH="/home/wutiejun/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt&lt;/p&gt;&lt;p&gt;/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin"&lt;/p&gt;&lt;p&gt;export PATH=$PATH:${CLFS_PREFIX}/bin&lt;/p&gt;&lt;p&gt;patch -Np1 -i ../uClibc-0.9.31-configs-2.patch&lt;/p&gt;&lt;p&gt;修改eabi或者oabi&lt;br /&gt;cp -v clfs/config.${CLFS_ARCH}.${CLFS_ENDIAN} .config&lt;br /&gt;if [ "${CLFS_ABI}" == "aapcs" ] || [ "${CLFS_ABI}" == "aapcs-linux" ]; \&lt;br /&gt;&amp;nbsp; then sed -i s/CONFIG_ARM_OABI/CONFIG_ARM_EABI/g .config; fi&lt;/p&gt;&lt;p&gt;make oldconfig&lt;/p&gt;&lt;p&gt;make&lt;/p&gt;&lt;p&gt;make PREFIX=${CLFS} install&lt;/p&gt;&lt;p&gt;6、编译gcc第二次：&lt;/p&gt;&lt;p&gt;AR=ar LDFLAGS="-Wl,-rpath,${CLFS}/cross-tools/lib" \&lt;br /&gt;&amp;nbsp; ../gcc-4.6.0/configure --prefix=${CLFS}/cross-tools \&lt;br /&gt;&amp;nbsp; --build=${CLFS_HOST} --target=${CLFS_TARGET} --host=${CLFS_HOST} \&lt;br /&gt;&amp;nbsp; --with-sysroot=${CLFS} --disable-nls --enable-shared \&lt;br /&gt;&amp;nbsp; --enable-languages=c --enable-c99 --enable-long-long \&lt;br /&gt;&amp;nbsp; --with-mpfr=${CLFS}/cross-tools --with-gmp=${CLFS}/cross-tools \&lt;br /&gt;&amp;nbsp; --with-mpc=${CLFS}/cross-tools --disable-multilib \&lt;br /&gt;&amp;nbsp; --with-abi=${CLFS_ABI} --with-arch=${CLFS_ARM_ARCH} \&lt;br /&gt;&amp;nbsp; --with-mode=${CLFS_ARM_MODE} --with-float=${CLFS_FLOAT} \&lt;br /&gt;&amp;nbsp; --with-fpu=${CLFS_FPU}&lt;/p&gt;&lt;p&gt;make&lt;/p&gt;&lt;p&gt;make install&lt;/p&gt;&lt;p&gt;cp -v ${CLFS}/cross-tools/${CLFS_TARGET}/lib/libgcc_s.so.1 ${CLFS}/lib&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/WuCountry/aggbug/2147603.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/WuCountry/archive/2011/08/21/2147603.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/WuCountry/archive/2010/11/15/1878050.html</id><title type="text">Linux内核代码学习笔记(2.6.21.7 ARM) -- 内核启动函数start_kernel</title><summary type="text">其实对内核的代码已经分析很久了，早就想自己写些什么，从今天开始，从新继续我的博客！这几年都在与Linux打交道了，而且我觉得我也真正的爱上了Linux，所以就写些Linux的东西吧！Linux的东西很多，就内核而言，已经无法一个人去了解所有的机制和细节了。但好在源码是可以随时取到的，只要你熟悉和了解内核的一些基本特性，还是可以很容易上手的！下面，我就把我自己的一些学习经历写出来和大家分享一下！首选...</summary><published>2010-11-15T15:16:00Z</published><updated>2010-11-15T15:16:00Z</updated><author><name>Wu.Country@侠缘</name><uri>http://www.cnblogs.com/WuCountry/</uri></author><link rel="alternate" href="http://www.cnblogs.com/WuCountry/archive/2010/11/15/1878050.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/WuCountry/archive/2010/11/15/1878050.html"/><content type="html">&lt;p&gt;其实对内核的代码已经分析很久了，早就想自己写些什么，从今天开始，从新继续我的博客！&lt;/p&gt;&lt;p&gt;这几年都在与Linux打交道了，而且我觉得我也真正的爱上了Linux，所以就写些Linux的东西吧！&lt;/p&gt;&lt;p&gt;Linux的东西很多，就内核而言，已经无法一个人去了解所有的机制和细节了。但好在源码是可以随时取到的，只要你熟悉和了解内核的一些基本特性，还是可以很容易上手的！&lt;/p&gt;&lt;p&gt;下面，我就把我自己的一些学习经历写出来和大家分享一下！&lt;/p&gt;&lt;p&gt;首选，内核代码里有大小写重名的文件，所以，从网上下载了内核源码包以后，不能直接在Windows下解压，否则会有些文件被大小写重复的文件名复盖掉！主要是网络相关的。我暂时先不想了解网络相关的内容，所以，就先在Windows下，使用SourceInsight来看代码！如果要看到全部的代码，还是要在Linux系统下解压代码！&lt;/p&gt;&lt;p&gt;另外，我对X86体系结构的代码也暂时不感兴趣，先从ARM入手，不过不同的体系结构，关系并不太大，明白一些机制以后，大部份是一样的！&lt;/p&gt;&lt;p&gt;先从第一个函数入手：&lt;/p&gt;&lt;p&gt;&lt;span style="color: #000000"&gt;E:\Projects\kernel\linux-2.6.21.1.src\init\main.c (501/825)&lt;/span&gt;&lt;/p&gt;&lt;div style="background-color: #F5F5F5;border: 1px solid #CCCCCC;padding:10px;"&gt;&lt;div&gt;&lt;span style="color: #000000"&gt;asmlinkage&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;__init&amp;nbsp;start_kernel(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;这个函数是内核由引导程序引导以后，由自解压程序解压以后执行的第一个函数，可以认为是整个内核的入口函数，以后我分析的代码全部从这个函数开始！&lt;/p&gt;&lt;p&gt;这个函数做的事情相对比较简单，就是线性的初始化一些内核的基础机制，如中断，内存管理，进程管理，信号，文件系统，KO等！最后就启动一个init线程，init线程再读取文件系统里的init程序，做为系统的第一个进程而存在！&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;其实，start_kernel函数是0是做为0号进程存在的，它在最后就是空转CPU：&lt;/p&gt;&lt;div style="background-color: #F5F5F5;border: 1px solid #CCCCCC;padding:10px;" onclick="cnblogs_code_show('ff5db00d-fd9d-4cd7-9b2e-3c0325a93844')"&gt;&lt;img class="code_img_closed" id="code_img_closed_ff5db00d-fd9d-4cd7-9b2e-3c0325a93844" src="http://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif"  alt="" /&gt;&lt;img class="code_img_opened" id="code_img_opened_ff5db00d-fd9d-4cd7-9b2e-3c0325a93844" style="display: none" onclick="cnblogs_code_hide('ff5db00d-fd9d-4cd7-9b2e-3c0325a93844',event)" src="http://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif"&gt; &lt;div class="cnblogs_code_hide" id="cnblogs_code_open_ff5db00d-fd9d-4cd7-9b2e-3c0325a93844"&gt;&lt;div&gt;&lt;!--&lt;br/ /&gt;&lt;br/ /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br/ /&gt;http://www.CodeHighlighter.com/&lt;br/ /&gt;&lt;br/ /&gt;--&gt;&lt;span style="color: #008000"&gt;/*&lt;/span&gt;&lt;span style="color: #008000"&gt;&lt;br /&gt;&amp;nbsp;*&amp;nbsp;The&amp;nbsp;idle&amp;nbsp;thread.&amp;nbsp;&amp;nbsp;We&amp;nbsp;try&amp;nbsp;to&amp;nbsp;conserve&amp;nbsp;power,&amp;nbsp;while&amp;nbsp;trying&amp;nbsp;to&amp;nbsp;keep&lt;br /&gt;&amp;nbsp;*&amp;nbsp;overall&amp;nbsp;latency&amp;nbsp;low.&amp;nbsp;&amp;nbsp;The&amp;nbsp;architecture&amp;nbsp;specific&amp;nbsp;idle&amp;nbsp;is&amp;nbsp;passed&lt;br /&gt;&amp;nbsp;*&amp;nbsp;a&amp;nbsp;value&amp;nbsp;to&amp;nbsp;indicate&amp;nbsp;the&amp;nbsp;level&amp;nbsp;of&amp;nbsp;"idleness"&amp;nbsp;of&amp;nbsp;the&amp;nbsp;system.&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;*/&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;cpu_idle(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;local_fiq_enable();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;/*&lt;/span&gt;&lt;span style="color: #008000"&gt;&amp;nbsp;endless&amp;nbsp;idle&amp;nbsp;loop&amp;nbsp;with&amp;nbsp;no&amp;nbsp;priority&amp;nbsp;at&amp;nbsp;all&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;*/&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;while&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #800080"&gt;1&lt;/span&gt;&lt;span style="color: #000000"&gt;)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;idle)(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;pm_idle;&lt;br /&gt;&lt;br /&gt;#ifdef&amp;nbsp;CONFIG_HOTPLUG_CPU&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(cpu_is_offline(smp_processor_id()))&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;leds_event(led_idle_start);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;cpu_die();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;#endif&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #000000"&gt;!&lt;/span&gt;&lt;span style="color: #000000"&gt;idle)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;idle&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;default_idle;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;leds_event(led_idle_start);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;while&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #000000"&gt;!&lt;/span&gt;&lt;span style="color: #000000"&gt;need_resched())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;idle();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;leds_event(led_idle_end);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;preempt_enable_no_resched();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;schedule();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;preempt_disable();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;而在它之前，启动的init线程，则是运行文件系统里的init程序：&lt;/p&gt;&lt;div style="background-color: #F5F5F5;border: 1px solid #CCCCCC;padding:10px;" onclick="cnblogs_code_show('f4e536b0-0863-4a66-8b98-1406bd7c23a9')"&gt;&lt;img class="code_img_closed" id="code_img_closed_f4e536b0-0863-4a66-8b98-1406bd7c23a9" src="http://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif"  alt="" /&gt;&lt;img class="code_img_opened" id="code_img_opened_f4e536b0-0863-4a66-8b98-1406bd7c23a9" style="display: none" onclick="cnblogs_code_hide('f4e536b0-0863-4a66-8b98-1406bd7c23a9',event)" src="http://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif"&gt; &lt;div class="cnblogs_code_hide" id="cnblogs_code_open_f4e536b0-0863-4a66-8b98-1406bd7c23a9"&gt;&lt;!--&lt;br/ /&gt;&lt;br/ /&gt;Code highlighting produced by Actipro CodeHighlighter (freeware)&lt;br/ /&gt;http://www.CodeHighlighter.com/&lt;br/ /&gt;&lt;br/ /&gt;--&gt;&lt;span style="color: #000000"&gt;&lt;div&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #008000"&gt;/*&lt;/span&gt;&lt;span style="color: #008000"&gt;&amp;nbsp;This&amp;nbsp;is&amp;nbsp;a&amp;nbsp;non&amp;nbsp;__init&amp;nbsp;function.&amp;nbsp;Force&amp;nbsp;it&amp;nbsp;to&amp;nbsp;be&amp;nbsp;noinline&amp;nbsp;otherwise&amp;nbsp;gcc&lt;br /&gt;&amp;nbsp;*&amp;nbsp;makes&amp;nbsp;it&amp;nbsp;inline&amp;nbsp;to&amp;nbsp;init()&amp;nbsp;and&amp;nbsp;it&amp;nbsp;becomes&amp;nbsp;part&amp;nbsp;of&amp;nbsp;init.text&amp;nbsp;section&lt;br /&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;*/&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;static&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;noinline&amp;nbsp;init_post(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;free_initmem();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;unlock_kernel();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mark_rodata_ro();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;system_state&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;=&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;SYSTEM_RUNNING;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;numa_default_policy();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(sys_open((&lt;/span&gt;&lt;span style="color: #0000ff"&gt;const&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;char&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;__user&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;*&lt;/span&gt;&lt;span style="color: #000000"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;/dev/console&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;,&amp;nbsp;O_RDWR,&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;)&amp;nbsp;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800080"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printk(KERN_WARNING&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;Warning:&amp;nbsp;unable&amp;nbsp;to&amp;nbsp;open&amp;nbsp;an&amp;nbsp;initial&amp;nbsp;console.\n&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;)&amp;nbsp;sys_dup(&lt;/span&gt;&lt;span style="color: #800080"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(&lt;/span&gt;&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;&lt;span style="color: #000000"&gt;)&amp;nbsp;sys_dup(&lt;/span&gt;&lt;span style="color: #800080"&gt;0&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(ramdisk_execute_command)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;run_init_process(ramdisk_execute_command);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printk(KERN_WARNING&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;Failed&amp;nbsp;to&amp;nbsp;execute&amp;nbsp;%s\n&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ramdisk_execute_command);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;/*&lt;/span&gt;&lt;span style="color: #008000"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;We&amp;nbsp;try&amp;nbsp;each&amp;nbsp;of&amp;nbsp;these&amp;nbsp;until&amp;nbsp;one&amp;nbsp;succeeds.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;The&amp;nbsp;Bourne&amp;nbsp;shell&amp;nbsp;can&amp;nbsp;be&amp;nbsp;used&amp;nbsp;instead&amp;nbsp;of&amp;nbsp;init&amp;nbsp;if&amp;nbsp;we&amp;nbsp;are&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;trying&amp;nbsp;to&amp;nbsp;recover&amp;nbsp;a&amp;nbsp;really&amp;nbsp;broken&amp;nbsp;machine.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #008000"&gt;*/&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt;&lt;span style="color: #000000"&gt;&amp;nbsp;(execute_command)&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #000000"&gt;/*&amp;nbsp;如果有启动参数做为执行命令，就执行 */&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;run_init_process(execute_command);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printk(KERN_WARNING&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;Failed&amp;nbsp;to&amp;nbsp;execute&amp;nbsp;%s.&amp;nbsp;&amp;nbsp;Attempting&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;defaults...\n&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;,&amp;nbsp;execute_command);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #000000"&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;span style="color: #000000"&gt;/* 依次查询文件系统里的init程序，这里的run_init_process函数不能返回，否则启动失败&amp;nbsp;*/&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;run_init_process(&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;/sbin/init&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;run_init_process(&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;/etc/init&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;run_init_process(&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;/bin/init&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;run_init_process(&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;/bin/sh&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;panic(&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #800000"&gt;No&amp;nbsp;init&amp;nbsp;found.&amp;nbsp;&amp;nbsp;Try&amp;nbsp;passing&amp;nbsp;init=&amp;nbsp;option&amp;nbsp;to&amp;nbsp;kernel.&lt;/span&gt;&lt;span style="color: #800000"&gt;"&lt;/span&gt;&lt;span style="color: #000000"&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;因为内核为很多体系结构的CPU实现具体的函数，所以一个函数可能在很多目录里的同名文件所实现。在查询是具体的哪个函数时，要对应的具体的体系结构。如果对应的具体体系结构里没有相关函数，就可在使用通用的函数或者通用的体系结构里的函数!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;font style="background-color: #ffffff"&gt;&lt;/font&gt;&lt;font style="background-color: #ffffff"&gt;&lt;/font&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/WuCountry/aggbug/1878050.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/WuCountry/archive/2010/11/15/1878050.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry></feed>
