<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>coding &#187; kernel</title>
	<atom:link href="http://www.coding.com.br/tag/kernel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.coding.com.br</link>
	<description>have you coded today?</description>
	<lastBuildDate>Fri, 23 Jul 2010 02:37:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>kthreads (1)</title>
		<link>http://www.coding.com.br/kernel/kthreads-1/</link>
		<comments>http://www.coding.com.br/kernel/kthreads-1/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 04:18:15 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=958</guid>
		<description><![CDATA[Creating a thread at kernel-space
Now that I know that somebody at Academia reads my posts   I&#8217;ll put code with a _little_ documentation information together. Today we will do a quick review about kernel threads or to be more precisely, a way to perform some operations in the background. Kernel threads are standard process [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: right;"><em>Creating a thread at kernel-space</em></p>
<p style="text-align: justify;">Now that I know that <a href="http://kindman.org/blog/2009/12/12/academia-motivation/" target="_blank">somebody</a> at Academia reads my posts <img src='http://www.coding.com.br/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  I&#8217;ll put code with a _little_ <span style="text-decoration: line-through;">documentation</span> information together. Today we will do a quick review about <em>kernel threads </em>or to be more precisely, a way to perform some operations in the background. <em>Kernel threads</em> are standard process that:</p>
<ol>
<li>Exist solely in kernel-space.</li>
<li>Don&#8217;t have an address space.</li>
<li>Don&#8217;t context switch to user-space.</li>
<li>Are schedulable and preemptable as normal process.</li>
</ol>
<p>And let&#8217;s see an example:</p>
<pre><span style="color: #0000ff;"><strong>#include <span style="color: #008000;">&lt;linux/init.h&gt;</span></strong></span>
<span style="color: #0000ff;"><strong>#include <span style="color: #008000;">&lt;linux/module.h&gt;</span></strong></span>
<span style="color: #0000ff;"><strong>#include <span style="color: #008000;">&lt;linux/sched.h&gt;</span></strong></span>
<span style="color: #0000ff;"><strong>#include <span style="color: #008000;">&lt;linux/delay.h&gt;</span></strong></span>

<strong>static</strong> <strong>int</strong> <span style="color: #2040a0;">thread3</span><span style="color: #4444ff;">(</span><strong>void</strong> <span style="color: #4444ff;">*</span><span style="color: #2040a0;">unused</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><strong>{</strong></span>

	<strong>int</strong> <span style="color: #2040a0;">count3</span> <span style="color: #4444ff;">=</span> <span style="color: #ff0000;">0</span><span style="color: #4444ff;">;</span>
	<strong>while</strong> <span style="color: #4444ff;">(</span><span style="color: #2040a0;">count3</span> <span style="color: #4444ff;">&lt;</span> <span style="color: #ff0000;">1000</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><strong>{</strong></span>
		<span style="color: #2040a0;">msleep</span><span style="color: #4444ff;">(</span><span style="color: #ff0000;">100</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
		<span style="color: #2040a0;">printk</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"Thread 3: %d<span style="color: #77dd77;">\n</span>"</span>, <span style="color: #2040a0;">count3</span><span style="color: #4444ff;">+</span><span style="color: #4444ff;">+</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
	<span style="color: #4444ff;"><strong>}</strong></span>
	<strong>return</strong> <span style="color: #ff0000;">0</span><span style="color: #4444ff;">;</span>
<span style="color: #4444ff;"><strong>}</strong></span> 

<strong>static</strong> <strong>int</strong> <span style="color: #2040a0;">thread2</span><span style="color: #4444ff;">(</span><strong>void</strong> <span style="color: #4444ff;">*</span><span style="color: #2040a0;">unused</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><strong>{</strong></span>

	<strong>int</strong> <span style="color: #2040a0;">count2</span> <span style="color: #4444ff;">=</span> <span style="color: #ff0000;">0</span><span style="color: #4444ff;">;</span>
	<strong>while</strong> <span style="color: #4444ff;">(</span><span style="color: #2040a0;">count2</span> <span style="color: #4444ff;">&lt;</span> <span style="color: #ff0000;">1000</span><span style="color: #4444ff;">)</span> <span style="color: #4444ff;"><strong>{</strong></span>
		<span style="color: #2040a0;">msleep</span><span style="color: #4444ff;">(</span><span style="color: #ff0000;">10</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
		<span style="color: #2040a0;">printk</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"Thread 2: %d<span style="color: #77dd77;">\n</span>"</span>, <span style="color: #2040a0;">count2</span><span style="color: #4444ff;">+</span><span style="color: #4444ff;">+</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
	<span style="color: #4444ff;"><strong>}</strong></span>
	<strong>return</strong> <span style="color: #ff0000;">0</span><span style="color: #4444ff;">;</span>
<span style="color: #4444ff;"><strong>}</strong></span>

<strong>static</strong> <strong>int</strong> <span style="color: #2040a0;">__init</span> <span style="color: #2040a0;">threads_init</span><span style="color: #4444ff;">(</span><strong>void</strong><span style="color: #4444ff;">)</span>
<span style="color: #4444ff;"><strong>{</strong></span>
	<strong>int</strong> <span style="color: #2040a0;">count1</span><span style="color: #4444ff;">;</span>
	<strong>int</strong> <span style="color: #2040a0;">ret1</span>, <span style="color: #2040a0;">ret2</span><span style="color: #4444ff;">;</span>

	<span style="color: #2040a0;">count1</span> <span style="color: #4444ff;">=</span> <span style="color: #ff0000;">0</span><span style="color: #4444ff;">;</span>
	<span style="color: #2040a0;">ret1</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">kernel_thread</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">thread2</span>, <span style="color: #2040a0;">NULL</span>, <span style="color: #2040a0;">CLONE_FS</span> <span style="color: #4444ff;">|</span> <span style="color: #2040a0;">CLONE_FILES</span> <span style="color: #4444ff;">|</span> <span style="color: #2040a0;">CLONE_SIGHAND</span> <span style="color: #4444ff;">|</span> <span style="color: #2040a0;">SIGCHLD</span> <span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
	<span style="color: #2040a0;">ret2</span> <span style="color: #4444ff;">=</span> <span style="color: #2040a0;">kernel_thread</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">thread3</span>, <span style="color: #2040a0;">NULL</span>, <span style="color: #2040a0;">CLONE_FS</span> <span style="color: #4444ff;">|</span> <span style="color: #2040a0;">CLONE_FILES</span> <span style="color: #4444ff;">|</span> <span style="color: #2040a0;">CLONE_SIGHAND</span> <span style="color: #4444ff;">|</span> <span style="color: #2040a0;">SIGCHLD</span> <span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>

	<span style="color: #2040a0;">printk</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"-- kernel thread: module init<span style="color: #77dd77;">\n</span>"</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
	<span style="color: #2040a0;">printk</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"-- kernel thread: spawning thread 1 ret=%d<span style="color: #77dd77;">\n</span>"</span>, <span style="color: #2040a0;">ret1</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
	<span style="color: #2040a0;">printk</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"-- kernel thread: spawning thread 2 ret=%d<span style="color: #77dd77;">\n</span>"</span>, <span style="color: #2040a0;">ret2</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>	

	<span style="color: #444444;">/*
	   Don't use "long" loops on init().
	   If you uncomment the snippet below the insmod will lock until while finishes
	*/</span> 

	<span style="color: #444444;">/*
	while (count1 &lt; 1000) {
		msleep(10);
		printk("Thread 1: %d\n", count1++);
     	}
	*/</span>

    <strong>return</strong> <span style="color: #ff0000;">0</span><span style="color: #4444ff;">;</span>
<span style="color: #4444ff;"><strong>}</strong></span>

<strong>static</strong> <strong>void</strong> <span style="color: #2040a0;">__exit</span> <span style="color: #2040a0;">threads_exit</span><span style="color: #4444ff;">(</span><strong>void</strong><span style="color: #4444ff;">)</span>
<span style="color: #4444ff;"><strong>{</strong></span>
    <span style="color: #2040a0;">printk</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"-- kernel thread: module removed<span style="color: #77dd77;">\n</span>"</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<span style="color: #4444ff;"><strong>}</strong></span>

<span style="color: #2040a0;">module_init</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">threads_init</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<span style="color: #2040a0;">module_exit</span><span style="color: #4444ff;">(</span><span style="color: #2040a0;">threads_exit</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>

<span style="color: #2040a0;">MODULE_AUTHOR</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"Tiago Maluta &lt;maluta@unifei.edu.br"</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<span style="color: #2040a0;">MODULE_DESCRIPTION</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"kthreads examples"</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span>
<span style="color: #2040a0;">MODULE_LICENSE</span><span style="color: #4444ff;">(</span><span style="color: #008000;">"GPL"</span><span style="color: #4444ff;">)</span><span style="color: #4444ff;">;</span></pre>
<p>Things from code that are found in docs&#8230;</p>
<ul>
<li>CLONE_FS means that<em> parent</em> and <em>child</em> share filesystem information.</li>
<li><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">CLONE_FILES means that<em> parent </em>and <em>child</em> open files.</span></li>
<li><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">CLONE_SIGHAND means that <em>parent</em> and <em>child</em> share signal handlers.</span></li>
</ul>
<p>I use arbitrarily <em>msleep()</em> just to allow user &#8220;see&#8221; what is happening when dumping kernel ring buffer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/kernel/kthreads-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Kernel stats: horários dos commits</title>
		<link>http://www.coding.com.br/linux/kernel-stats-horarios-dos-commits/</link>
		<comments>http://www.coding.com.br/linux/kernel-stats-horarios-dos-commits/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 21:53:41 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=602</guid>
		<description><![CDATA[
Durante sua apresentação na Linux.conf.au 2010, o fundador do site LWN.net e contribuidor do kernel Jonathan Corbet demonstrou uma análise das contribuições no kernel Linux durante aproximadamente 1 ano (entre Dez 2008 e Jan 2010). Uma das conclusões é que 75% código é escrito por programadores pagos por empresas, lideram a lista: Red Hat (12%), [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">
Durante sua apresentação na Linux.conf.au 2010, o fundador do site LWN.net e contribuidor do kernel Jonathan Corbet <a href="http://www.lca2010.org.nz/programme/schedule/view_talk/50141?day=wednesday">demonstrou</a> uma análise das contribuições no kernel Linux durante aproximadamente 1 ano (entre Dez 2008 e Jan 2010). Uma das conclusões é que 75% código é escrito por programadores pagos por empresas, lideram a lista: Red Hat (12%), Intel (8%), IBM e Novell (6% cada), Oracle (3%). </p>
<p><p align="justify">
Um dos pontos que a estatística não mostra é que &#8211; mesmo sendo empregado de grandes empresas &#8211; boa parte do trabalho é feita fora do horário &#8220;comercial&#8221;, se alguém observar as datas de todos os <em>commits</em> e organizá-los pela frequência em horas, você tem o seguinte resultado para diferentes <em>releases</em>.
</p>
<pre>
<strong>v2.6.33-rc7	</strong>	<strong>v2.6.32</strong>			  <strong>v2.6.24</strong>	

Hora	Commits		Hora	Commits		Hora	Commits
<strong>0	8069		0	7808		0	4745
1	7052		1	6800		1	4155
2	4715		2	4556		2	2835
3	2717		3	2601		3	1395</strong>
4	2236		4	2096		4	898
5	1426		5	1193		5	559
6	1299		6	1134		6	381
7	1933		7	1723		7	580
8	4108		8	3798		8	1445
9	6429		9	6003		9	2261
10	8550		10	7969		10	3027
11	10284		11	9640		11	3946
12	9191		12	8403		12	3313
13	11728		13	11024		13	4522
<strong>14	13127		14	12340		14	5052
15	14281		15	13295		15	5813
16	13685		16	12721		16	5212
17	11486		17	10793		17	5050</strong>
18	7938		18	7334		18	3335
19	7354		19	6933		19	2850
20	7460		20	6953		20	3161
21	8561		21	8138		21	3436
22	8953		22	8498		22	3872
23	7741		23	7335		23	3843
</pre>
<p>Comando utilizado para gerar esses dados:</p>
<blockquote><p>
git log v2.6.33 | grep ^Date: | perl -pe &#8217;s/^(?:\S+\s+){4}(\d+).*/$1/&#8217; | sort -g | uniq -c
</p></blockquote>
<p>A conclusão é que muitos desenvolvedores fazem o código durante a noite e acordam tarde. <img src='http://www.coding.com.br/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/linux/kernel-stats-horarios-dos-commits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Acionando os mantenedores</title>
		<link>http://www.coding.com.br/kernel/acionando-os-mantenedores/</link>
		<comments>http://www.coding.com.br/kernel/acionando-os-mantenedores/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 23:41:26 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=420</guid>
		<description><![CDATA[Se você precisar entrar em contato com o mantendor de algum sub-sistema do kernel Linux mas não sabe onde procurar, utilize um script (get_maintainer.pl) incluído no próprio código. Um exemplo,  suponha que você utilize o sistema de arquivos ext4 e deseje sugerir alguma idéia. Se for um bug é recomendado utilizar a plataforma de submissão [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Se você precisar entrar em contato com o mantendor de algum sub-sistema do kernel <a href="http://www.kernel.org" target="_blank">Linux</a> mas não sabe onde procurar, utilize um <em>script</em> (get_maintainer.pl) incluído no próprio código. Um exemplo,  suponha que você utilize o sistema de arquivos <a href="http://ext4.wiki.kernel.org/index.php/Main_Page" target="_blank">ext4</a> e deseje sugerir alguma idéia. Se for um <em>bug</em> é recomendado utilizar a <a href="http://bugzilla.kernel.org/" target="_blank">plataforma</a> de submissão de bugs (bugzilla) que além de seguir uma metodologia para descrever o erro é uma forma de catalogar o problema. Estou considerando neste <em>post</em> que você ainda não é um desenvolvedor e quer achar o mantenedor pois gostaria de fazer uma sugestão ou comentário acerca da área do código-fonte que ele mantém. Este tipo de busca talvez seja mais intessante nos <em>devices drivers&#8230;</em></p>
<p style="text-align: justify;"><em><span style="font-style: normal;">Um exemplo com o ext4:</span></em></p>
<p style="text-align: justify;"><em> </em></p>
<p style="padding-left: 30px; "><strong>./scripts/get_maintainer.pl -f  fs/ext4/</strong></p>
<p style="padding-left: 60px; "><em><em>&#8220;Theodore Ts&#8217;o&#8221; &lt;tytso@&#8230;&gt;</em></em></p>
<p style="padding-left: 60px; "><em><span style="background-color: #ffffff; font-style: normal;"><em> </em></span>Aneesh Kumar K.V &lt;aneesh.kumar@&#8230;&gt; </em></p>
<p style="padding-left: 60px; "><em><span style="background-color: #ffffff; font-style: normal;"><em>Eric Sandeen &lt;sandeen@&#8230;&gt; </em></span></em></p>
<p style="padding-left: 60px; "><em><span style="background-color: #ffffff; font-style: normal;"><em> </em></span><span style="background-color: #ffffff; font-style: normal;"><em><span style="background-color: #ffffff; font-style: normal;"><em>linux-kernel@vger.kernel.org <span style="color: #ff0000;">(lembre-se de se cadastrar e sempre de copiar a lista de email junto)</span></em></span></em></span></em></p>
<p>Um exemplo com o <em>driver</em> de video da Intel:</p>
<p><span style="color: #ff0000;"><em> </em></span></p>
<p><span style="color: #ff0000;"><em> </em></span></p>
<p style="padding-left: 30px;"><em><strong>./scripts/get_maintainer.pl -f drivers/video/intelfb/</strong></em></p>
<p><em> </em></p>
<p><em> </em></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Sylvain Meyer &lt;sylvain.meyer@worldonline.fr&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Andrew Morton &lt;akpm@linux-foundation.org&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Thomas Hilber &lt;sparkie@lowbyte.de&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Stefan Husemann &lt;shusemann@googlemail.com&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Hannes Eder &lt;hannes@hanneseder.net&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Paul Menzel &lt;paulepanter@users.sourceforge.net&gt;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux-fbdev-devel@lists.sourceforge.net</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux-kernel@vger.kernel.org</div>
<p style="padding-left: 30px; "><span style="color: #ff0000;"><em><span style="color: #000000;"><span style="font-style: normal;"> </span></span></em></span></p>
<p style="padding-left: 60px; ">Sylvain Meyer &lt;sylvain.meyer@&#8230;&gt;</p>
<p style="padding-left: 60px; ">Andrew Morton &lt;akpm@&#8230;&gt;</p>
<p style="padding-left: 60px; ">Thomas Hilber &lt;sparkie@&#8230;&gt;</p>
<p style="padding-left: 60px; ">Stefan Husemann &lt;shusemann@&#8230;&gt;</p>
<p style="padding-left: 60px; ">Hannes Eder &lt;hannes@&#8230;&gt;</p>
<p style="padding-left: 60px; ">Paul Menzel &lt;paulepanter@&#8230;&gt;</p>
<p style="padding-left: 60px; ">linux-fbdev-devel@lists.sourceforge.net</p>
<p style="padding-left: 60px; ">linux-kernel@vger.kernel.org</p>
<p style="padding-left: 30px; ">
<p><span style="background-color: #ffffff;">Dar o retorno do uso de algum programa é ótimo para o desenvolvedor e garante a qualidade do sotfware. </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/kernel/acionando-os-mantenedores/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changes on kernel cross compiling</title>
		<link>http://www.coding.com.br/embarcado/changes-on-kernel-cross-compiling/</link>
		<comments>http://www.coding.com.br/embarcado/changes-on-kernel-cross-compiling/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 22:32:01 +0000</pubDate>
		<dc:creator>Tiago Maluta</dc:creator>
				<category><![CDATA[embarcado]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.coding.com.br/?p=360</guid>
		<description><![CDATA[Probably if you compile &#8211; many times &#8211; Linux for embedded hardware you change Makefile to your specific architecture and compiler. An example:
# Set the ARCH and CROSS_COMPILE default values
ARCH            ?= arm
CROSS_COMPILE   ?= arm-unknown-linux-gnu-
Latest Linux (~2.6.31) turns it deprecated (commit 575543347b5baed0ca927cb90ba8807396fe9cc9). Now [...]]]></description>
			<content:encoded><![CDATA[<p>Probably if you compile &#8211; many times &#8211; <a href="http://www.kernel.org">Linux</a> for embedded hardware you change <a href="file:/usr/src/linux/Makefile">Makefile</a> to your specific architecture and compiler. An example:</p>
<pre># Set the ARCH and CROSS_COMPILE default values
ARCH            ?= arm
CROSS_COMPILE   ?= arm-unknown-linux-gnu-</pre>
<p>Latest Linux (~2.6.31) turns it deprecated (commit <a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2331d1a6cd3d6e580bc88b9a160066d9e1177fe1">575543347b5baed0ca927cb90ba8807396fe9cc9</a>). Now the settings are saved in two files named:</p>
<p style="padding-left: 30px;">include/generated/kernel.arch<br />
include/generated/kernel.cross</p>
<p><strong>What changes?</strong></p>
<p>Using the new way you don&#8217;t edit Makefile anymore, just need set once your definitions for cross compiling:</p>
<pre>$ make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnu-</pre>
<p>And for next builds just run <em>make</em></p>
<pre>$ make</pre>
<p>This works both for plain builds and for O=&#8230; builds.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coding.com.br/embarcado/changes-on-kernel-cross-compiling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
