<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>linux-kernel &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/linux-kernel/</link>
	<description>Feed of posts on WordPress.com tagged "linux-kernel"</description>
	<pubDate>Mon, 13 Oct 2008 02:01:15 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[New Linux kernel available!]]></title>
<link>http://wonderingpondering.wordpress.com/?p=697</link>
<pubDate>Sun, 12 Oct 2008 00:59:32 +0000</pubDate>
<dc:creator>wonderingpondering</dc:creator>
<guid>http://wonderingpondering.pt-br.wordpress.com/2008/10/12/new-linux-kernel-available/</guid>
<description><![CDATA[Woot! Linux kernel 2.6.27 is now officially available for download and installation.
]]></description>
<content:encoded><![CDATA[<p>Woot! <a title="Linux kernel 2.6.27 officially released" href="http://arstechnica.com/journals/linux.ars/2008/10/10/linux-kernel-2-6-27-officially-released" target="_blank">Linux kernel 2.6.27 is now officially available for download</a> and installation.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Lançado o Linux 2.6.27]]></title>
<link>http://planetalivre.wordpress.com/?p=475</link>
<pubDate>Sat, 11 Oct 2008 16:45:27 +0000</pubDate>
<dc:creator>eltonslacker</dc:creator>
<guid>http://planetalivre.pt-br.wordpress.com/2008/10/11/lancado-o-linux-2627/</guid>
<description><![CDATA[
]]></description>
<content:encoded><![CDATA[<br />
]]></content:encoded>
</item>
<item>
<title><![CDATA[Double linked lists]]></title>
<link>http://briefbox.wordpress.com/?p=82</link>
<pubDate>Fri, 03 Oct 2008 14:29:42 +0000</pubDate>
<dc:creator>briefbox</dc:creator>
<guid>http://briefbox.pt-br.wordpress.com/2008/10/03/double-linked-lists/</guid>
<description><![CDATA[Kernel has a good implementation of double linked lists and objectives in this post are to emphasize]]></description>
<content:encoded><![CDATA[<p>Kernel has a good implementation of double linked lists and objectives in this post are to emphasize how can you do the following list operations:</p>
<ul>
<li>Defining and Initializing</li>
<li>Passing through</li>
<li>Addition and deletion of elements</li>
</ul>
<p>The linked list API is located in <span style="text-decoration:underline;"><tt>include/linux/list.h </tt></span><tt>and the basic MACROs and functions that you need to know about are:</tt></p>
<ul>
<li>
<pre>INIT_LIST_HEAD()</pre>
</li>
<li>
<pre>list_add(), list_entry(), and list_del()</pre>
</li>
<li>list_for_each() and list_for_each_safe()</li>
</ul>
<p>The first thing you should do when you want to use a linked list, is to declare and define your list node data type. In this case the node is different than any linked list node that you may know outside the kernel.</p>
<p>Therefore a double linked list node would seem like:</p>
<pre><span style="color:#990000;">struct</span> person<strong><span style="color:#663300;"> {</span></strong><span style="color:#ff6633;">
	char</span> name<strong><span style="color:#663300;">[</span></strong><span style="color:#999900;">64</span><strong><span style="color:#663300;">];</span></strong><em></em>
<em><span style="color:#999999;">	// ..
</span></em><span style="color:#990000;">
	struct</span> person<strong><span style="color:#663300;"> *</span></strong>next<strong><span style="color:#663300;">;</span></strong><span style="color:#990000;">
        struct</span> person<strong><span style="color:#663300;"> *</span></strong>prev<strong><span style="color:#663300;">;
};</span></strong></pre>
<p>but in <span style="text-decoration:underline;">the kernel way</span> would be as:</p>
<pre><span style="color:#990000;">struct</span> person<strong><span style="color:#663300;"> {</span></strong><span style="color:#ff6633;">
	char</span> *name<strong><span style="color:#663300;">;</span></strong>
<em><span style="color:#999999;">	// ..
</span></em><span style="color:#990000;">
	struct</span> list_head engineers<strong><span style="color:#663300;">;</span></strong><span style="color:#990000;">
        struct</span> list_head managers<strong><span style="color:#663300;">;</span></strong><em><span style="color:#999999;">
        // we can have multiple lists!
</span></em><strong><span style="color:#663300;">};</span></strong><strong>
</strong></pre>
<p><strong>How do we declare a linked list?</strong></p>
<p><span style="text-decoration:underline;">Simple:</span></p>
<pre style="padding-left:60px;"><span style="color:#990000;">struct</span> person employees<strong><span style="color:#663300;">;

</span></strong></pre>
<p>Pushing forward towards our objectives, examples of code are:</p>
<p><strong> </strong><span style="text-decoration:underline;">Initializing:</span></p>
<pre style="padding-left:60px;">INIT_LIST_HEAD<strong><span style="color:#663300;">(&#38;</span></strong>employees<strong><span style="color:#663300;">.</span></strong><strong><span style="color:#663300;">engineers);

</span></strong></pre>
<p><span style="text-decoration:underline;">Element addition:</span></p>
<pre style="padding-left:60px;"><span style="color:#990000;">struct</span> person *node<strong><span style="color:#663300;"> = NULL;</span></strong>
node<strong><span style="color:#663300;">=(</span></strong><span style="color:#990000;">struct</span> person<strong><span style="color:#663300;"> *)</span></strong>vmalloc<strong><span style="color:#663300;">(</span></strong><span style="color:#990000;">sizeof</span><strong><span style="color:#663300;">(</span></strong>person<strong><span style="color:#663300;">));</span></strong>
<span style="color:#ff0000;">if</span><strong><span style="color:#663300;"> (!</span></strong>node<strong><span style="color:#663300;">){</span></strong>
   printk<strong><span style="color:#663300;">(</span></strong>KERN_INFO<span style="color:#009900;"> "mymodule:vmalloc: could not alocate memory"</span><strong><span style="color:#663300;">);</span></strong><span style="color:#ff0000;">
   return</span><strong><span style="color:#663300;"> -</span></strong>ENOMEM<strong><span style="color:#663300;">;
}</span></strong>
memset<strong><span style="color:#663300;">(</span></strong>node<strong><span style="color:#663300;">,</span></strong><span style="color:#999900;"> 0</span><strong><span style="color:#663300;">,</span></strong><span style="color:#990000;"> sizeof</span><strong><span style="color:#663300;">(</span></strong>person<strong><span style="color:#663300;">));</span></strong>
strcpy<strong><span style="color:#663300;">(</span></strong>node<strong><span style="color:#663300;">-&#62;</span></strong>name<strong><span style="color:#663300;">,</span></strong> person_name<strong><span style="color:#663300;">);</span></strong>

list_add<strong><span style="color:#663300;">(&#38;(</span></strong>node<strong><span style="color:#663300;">-&#62;</span></strong>engineers<strong><span style="color:#663300;">),&#38;(</span></strong>employees<strong><span style="color:#663300;">.</span></strong>engineers<strong><span style="color:#663300;">));

</span></strong></pre>
<p><span style="text-decoration:underline;">Passing through list and deleting an element:</span></p>
<pre style="padding-left:30px;"><span style="color:#990000;">    struct</span> list_head<strong><span style="color:#663300;"> *</span></strong>pos<strong><span style="color:#663300;"> =</span></strong> NULL<strong><span style="color:#663300;">;</span></strong>
<span style="color:#990000;">    struct</span> list_head<strong><span style="color:#663300;"> *</span></strong>q<strong><span style="color:#663300;"> =</span></strong> NULL<strong><span style="color:#663300;">;</span></strong><span style="color:#990000;">
    struct</span> person<strong><span style="color:#663300;"> *</span></strong>node<strong><span style="color:#663300;"> = </span></strong>NULL<strong><span style="color:#663300;">;</span></strong><span style="color:#990000;">
</span>    list_for_each_safe<strong><span style="color:#663300;">(</span></strong>pos<strong><span style="color:#663300;">,</span></strong> q<strong><span style="color:#663300;">, &#38;</span></strong>employees<strong><span style="color:#663300;">.</span></strong>engineers<strong><span style="color:#663300;">) {</span></strong>
            node<strong><span style="color:#663300;">=</span></strong>list_entry<strong><span style="color:#663300;">(</span></strong>pos<strong><span style="color:#663300;">,</span></strong><span style="color:#990000;"> struct</span> person<strong><span style="color:#663300;">,</span></strong> engineers<strong><span style="color:#663300;">);</span></strong>
<span style="color:#ff0000;">            if</span><strong><span style="color:#663300;"> (!</span></strong>strcmp<strong><span style="color:#663300;">(</span></strong>node<strong><span style="color:#663300;">-&#62;</span></strong>name<strong><span style="color:#663300;">,</span></strong> person_name<strong><span style="color:#663300;">)) {</span></strong>
                 list_del<strong><span style="color:#663300;">(</span></strong>pos<strong><span style="color:#663300;">);</span></strong>
                 vfree<strong><span style="color:#663300;">(</span></strong>node<strong><span style="color:#663300;">);
            }
    }

</span></strong></pre>
<p>I hope I haven't forgotten, or misplaced anything during code translation.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Basic proc file system module]]></title>
<link>http://briefbox.wordpress.com/?p=43</link>
<pubDate>Thu, 02 Oct 2008 11:07:38 +0000</pubDate>
<dc:creator>briefbox</dc:creator>
<guid>http://briefbox.pt-br.wordpress.com/2008/10/02/proc-fs-demo-1/</guid>
<description><![CDATA[This is an example of proc file system basic usage regarding:

adding and removing a directory, or f]]></description>
<content:encoded><![CDATA[<p>This is an example of proc file system basic usage regarding:</p>
<ul>
<li>adding and removing a directory, or file under proc</li>
<li>handling I/O  of proc files</li>
</ul>
<p>Having the <span style="text-decoration:underline;">proc_demo.ko</span> module inserted into kernel, it will create /proc/{demo, demo/file} under you are able to perform simple I/O like:</p>
<ul>
<li><em><strong>echo "what ever you want" &#62; /proc/demo/file</strong></em></li>
<li><em><strong>cat /proc/demo/file</strong></em></li>
</ul>
<p>Its purpose is to demonstrate the minimal usage of kernel proc API.</p>
<p>You should read <a href="http://briefbox.wordpress.com/2008/10/02/basic-proc-fs-api">Basic proc file system kernel API</a> page first.</p>
<p><strong>proc_demo.c</strong></p>
<pre><span style="color:#000099;">#include &#60;linux/init.h&#62;
#include &#60;linux/kernel.h&#62;
#include &#60;linux/module.h&#62;
#include&#60;linux/vmalloc.h&#62;
#include &#60;linux/string.h&#62;
#include&#60;linux/proc_fs.h&#62;
#include &#60;asm/uaccess.h&#62;
</span>

MODULE_LICENSE<strong><span style="color:#663300;">(</span></strong><span style="color:#009900;">"GPL"</span><strong><span style="color:#663300;">);</span></strong>

<span style="color:#990000;">static</span><span style="color:#ff6633;"> char</span><strong><span style="color:#663300;"> *</span></strong>file_content<strong><span style="color:#663300;">=</span></strong>NULL<strong><span style="color:#663300;">;</span></strong>
<span style="color:#990000;">static struct</span>   proc_dir_entry<strong><span style="color:#663300;"> *</span></strong>proc_dir<strong><span style="color:#663300;">=</span></strong>NULL<strong><span style="color:#663300;">;</span></strong>
<span style="color:#990000;">static struct</span>   proc_dir_entry<strong><span style="color:#663300;"> *</span></strong>proc_file<strong><span style="color:#663300;">=</span></strong>NULL<strong><span style="color:#663300;">;</span></strong>

ssize_t file_write<strong><span style="color:#663300;">(</span></strong><span style="color:#990000;">struct</span> file<strong><span style="color:#663300;"> *</span></strong>filp<strong><span style="color:#663300;">,</span></strong><span style="color:#990000;"> const</span><span style="color:#ff6633;"> char</span> __user<strong><span style="color:#663300;"> *</span></strong>buff<strong><span style="color:#663300;">,</span></strong>
<span style="color:#ff6633;">		   unsigned long</span> len<strong><span style="color:#663300;">,</span></strong><span style="color:#ff6633;"> void</span><strong><span style="color:#663300;"> *</span></strong>data<strong><span style="color:#663300;">);</span></strong>

<span style="color:#ff6633;">int</span> file_read<strong><span style="color:#663300;">(</span></strong><span style="color:#ff6633;">char</span><strong><span style="color:#663300;"> *</span></strong>page<strong><span style="color:#663300;">,</span></strong><span style="color:#ff6633;"> char</span><strong><span style="color:#663300;"> **</span></strong>start<strong><span style="color:#663300;">,</span></strong> off_t off<strong><span style="color:#663300;">,</span></strong>
<span style="color:#ff6633;">		int</span> count<strong><span style="color:#663300;">,</span></strong><span style="color:#ff6633;"> int</span><strong><span style="color:#663300;"> *</span></strong>eof<strong><span style="color:#663300;">,</span></strong><span style="color:#ff6633;"> void</span><strong><span style="color:#663300;"> *</span></strong>data<strong><span style="color:#663300;">);</span></strong>

ssize_t file_write<strong><span style="color:#663300;">(</span></strong><span style="color:#990000;"> struct</span> file<strong><span style="color:#663300;"> *</span></strong>filp<strong><span style="color:#663300;">,</span></strong><span style="color:#990000;"> const</span><span style="color:#ff6633;"> char</span> __user<strong><span style="color:#663300;"> *</span></strong>buff<strong><span style="color:#663300;">,</span></strong><span style="color:#ff6633;">unsigned long</span> len<strong><span style="color:#663300;">,</span></strong><span style="color:#ff6633;"> void</span><strong><span style="color:#663300;"> *</span></strong>data<strong><span style="color:#663300;">)
{</span></strong>
<span style="color:#ff0000;">    if</span><strong><span style="color:#663300;"> (</span></strong>len<strong><span style="color:#663300;">&#62;</span></strong>PAGE_SIZE<strong><span style="color:#663300;">) {</span></strong>
	printk<strong><span style="color:#663300;">(</span></strong>KERN_INFO<span style="color:#009900;"> "proc_demo module: file_write function len &#62; PAGE_SIZE\n"</span><strong><span style="color:#663300;">);</span></strong><span style="color:#ff0000;">
	return</span><strong><span style="color:#663300;"> -</span></strong>ENOSPC<strong><span style="color:#663300;">;
    }</span></strong>

<span style="color:#ff0000;">    if</span><strong><span style="color:#663300;"> (</span></strong>copy_from_user<strong><span style="color:#663300;">(&#38;</span></strong>file_content<strong><span style="color:#663300;">[</span></strong><span style="color:#999900;">0</span><strong><span style="color:#663300;">],</span></strong> buff<strong><span style="color:#663300;">,</span></strong> len<strong><span style="color:#663300;">))</span></strong>
<span style="color:#ff0000;">	return</span><strong><span style="color:#663300;"> -</span></strong>EFAULT<strong><span style="color:#663300;">;</span></strong>

    file_content<strong><span style="color:#663300;">[</span></strong>len<strong><span style="color:#663300;">]=</span></strong><span style="color:#009900;">'\x0'</span><strong><span style="color:#663300;">;</span></strong>
    printk<strong><span style="color:#663300;">(</span></strong>KERN_INFO<span style="color:#009900;"> "proc_demo module: you've written: %s\n"</span><strong><span style="color:#663300;">,</span></strong>file_content<strong><span style="color:#663300;">);</span></strong>
<span style="color:#ff0000;">    return</span> len<strong><span style="color:#663300;">;
}</span></strong>

<span style="color:#ff6633;">int</span>  file_read<strong><span style="color:#663300;">(</span></strong><span style="color:#ff6633;"> char</span><strong><span style="color:#663300;"> *</span></strong>page<strong><span style="color:#663300;">,</span></strong><span style="color:#ff6633;"> char</span><strong><span style="color:#663300;"> **</span></strong>start<strong><span style="color:#663300;">,</span></strong> off_t off<strong><span style="color:#663300;">,</span></strong><span style="color:#ff6633;">int</span> count<strong><span style="color:#663300;">,</span></strong><span style="color:#ff6633;"> int</span><strong><span style="color:#663300;"> *</span></strong>eof<strong><span style="color:#663300;">,</span></strong><span style="color:#ff6633;"> void</span><strong><span style="color:#663300;"> *</span></strong>data<strong><span style="color:#663300;">)
{</span></strong>
<span style="color:#ff0000;">    return</span> sprintf<strong><span style="color:#663300;">(</span></strong>page<strong><span style="color:#663300;">,</span></strong><span style="color:#009900;">"The user entered:\n%s\n"</span><strong><span style="color:#663300;">,</span></strong>file_content<strong><span style="color:#663300;">),</span></strong>
	    strlen<strong><span style="color:#663300;">(</span></strong>page<strong><span style="color:#663300;">);
}</span></strong>

<span style="color:#990000;">static</span><span style="color:#ff6633;"> int</span> proc_demo_init<strong><span style="color:#663300;">(</span></strong><span style="color:#ff6633;">void</span><strong><span style="color:#663300;">) {</span></strong>

<span style="color:#ff6633;">	int</span>  ret<strong><span style="color:#663300;">=</span></strong><span style="color:#999900;">0</span><strong><span style="color:#663300;">;</span></strong>
<em><span style="color:#999999;">	// We're alloc'ing memory for the file content buffer
</span></em>	file_content<strong><span style="color:#663300;">=(</span></strong><span style="color:#ff6633;">char</span><strong><span style="color:#663300;"> *)</span></strong>vmalloc<strong><span style="color:#663300;">(</span></strong>PAGE_SIZE<strong><span style="color:#663300;">);</span></strong><span style="color:#ff0000;">
	if</span><strong><span style="color:#663300;"> (!</span></strong>file_content<strong><span style="color:#663300;">){</span></strong>
	    printk<strong><span style="color:#663300;">(</span></strong>KERN_INFO<span style="color:#009900;"> "proc_demo module: vmalloc: could not alocate memory\n"</span><strong><span style="color:#663300;">);</span></strong><span style="color:#ff0000;">
	    goto</span> demo_out<strong><span style="color:#663300;">;
	}</span></strong>

	memset<strong><span style="color:#663300;">(</span></strong>file_content<strong><span style="color:#663300;">,</span></strong><span style="color:#999900;"> 0</span><strong><span style="color:#663300;">,</span></strong> PAGE_SIZE<strong><span style="color:#663300;">);</span></strong>

<em><span style="color:#999999;">        // Creating the proc 'demo' directory
</span></em>	proc_dir<strong><span style="color:#663300;">=</span></strong>proc_mkdir<strong><span style="color:#663300;">(</span></strong><span style="color:#009900;">"demo"</span><strong><span style="color:#663300;">,</span></strong> NULL<strong><span style="color:#663300;">);</span></strong><span style="color:#ff0000;">
        if</span><strong><span style="color:#663300;"> (!</span></strong>proc_dir<strong><span style="color:#663300;">) {</span></strong>
	    printk<strong><span style="color:#663300;">(</span></strong>KERN_INFO<span style="color:#009900;"> "proc_demo module: demo directory creation failed\n"</span><strong><span style="color:#663300;">);</span></strong>
            ret<strong><span style="color:#663300;">=-</span></strong>EAGAIN<strong><span style="color:#663300;">;</span></strong><span style="color:#ff0000;">
            goto</span> proc_mkdir_failure<strong><span style="color:#663300;">;
	}</span></strong>

<em><span style="color:#999999;">	/* creating 'file' and setting the read&#38;&#38;write function
	   handlers */</span></em>
	proc_file<strong><span style="color:#663300;">=</span></strong>create_proc_entry<strong><span style="color:#663300;">(</span></strong><span style="color:#009900;">"file"</span><strong><span style="color:#663300;">,</span></strong><span style="color:#999900;">0600</span><strong><span style="color:#663300;">,</span></strong> proc_dir<strong><span style="color:#663300;">);</span></strong><span style="color:#ff0000;">
        if</span><strong><span style="color:#663300;"> (</span></strong>proc_file<strong><span style="color:#663300;">) {</span></strong>
	    proc_file<strong><span style="color:#663300;">-&#62;</span></strong>read_proc<strong><span style="color:#663300;">  =</span></strong> file_read<strong><span style="color:#663300;">;</span></strong>
	    proc_file<strong><span style="color:#663300;">-&#62;</span></strong>write_proc<strong><span style="color:#663300;"> =</span></strong> file_write<strong><span style="color:#663300;">;</span></strong>
	    proc_file<strong><span style="color:#663300;">-&#62;</span></strong>owner<strong><span style="color:#663300;">      =</span></strong> THIS_MODULE<strong><span style="color:#663300;">;
	}</span></strong><span style="color:#ff0000;">
	else</span><strong><span style="color:#663300;"> {</span></strong>
    	    printk<strong><span style="color:#663300;">(</span></strong>KERN_INFO<span style="color:#009900;"> "proc_demo module: create_proc_entry: file\n"</span><strong><span style="color:#663300;">);</span></strong>
	    ret<strong><span style="color:#663300;">= -</span></strong>EAGAIN<strong><span style="color:#663300;">;</span></strong><span style="color:#ff0000;">
	    goto</span> proc_file_failure<strong><span style="color:#663300;">;
	}</span></strong>

	printk<strong><span style="color:#663300;">(</span></strong>KERN_INFO<span style="color:#009900;"> "proc_demo module: succesfully loaded\n"</span><strong><span style="color:#663300;">);</span></strong>
<span style="color:#ff0000;">        return</span> ret<strong><span style="color:#663300;">;</span></strong>
proc_file_failure<strong><span style="color:#663300;">:</span></strong>
	remove_proc_entry<strong><span style="color:#663300;">(</span></strong><span style="color:#009900;">"demo"</span><strong><span style="color:#663300;">,</span></strong> NULL<strong><span style="color:#663300;">);</span></strong>
proc_mkdir_failure<strong><span style="color:#663300;">:</span></strong>
	vfree<strong><span style="color:#663300;">(</span></strong>file_content<strong><span style="color:#663300;">);</span></strong>
demo_out<strong><span style="color:#663300;">:</span></strong>
	printk<strong><span style="color:#663300;">(</span></strong>KERN_INFO<span style="color:#009900;"> "proc_demo module: not loaded loaded\n"</span><strong><span style="color:#663300;">);</span></strong>
<span style="color:#ff0000;">	return</span> ret<strong><span style="color:#663300;">;
}</span></strong>

<span style="color:#990000;">static</span><span style="color:#ff6633;"> void</span> proc_demo_exit<strong><span style="color:#663300;">(</span></strong><span style="color:#ff6633;">void</span><strong><span style="color:#663300;">) {</span></strong>

        remove_proc_entry<strong><span style="color:#663300;">(</span></strong><span style="color:#009900;">"file"</span><strong><span style="color:#663300;">,</span></strong>proc_dir<strong><span style="color:#663300;">);</span></strong>
	remove_proc_entry<strong><span style="color:#663300;">(</span></strong><span style="color:#009900;">"demo"</span><strong><span style="color:#663300;">,</span></strong> NULL<strong><span style="color:#663300;">);</span></strong>

<span style="color:#ff0000;">	if</span><strong><span style="color:#663300;"> (</span></strong>file_content<strong><span style="color:#663300;">)</span></strong>
	    vfree<strong><span style="color:#663300;">(</span></strong>file_content<strong><span style="color:#663300;">);</span></strong>

	printk<strong><span style="color:#663300;">(</span></strong>KERN_INFO<span style="color:#009900;"> "proc_demo module: unloaded.\n"</span><strong><span style="color:#663300;">);
}</span></strong>

module_init<strong><span style="color:#663300;">(</span></strong>proc_demo_init<strong><span style="color:#663300;">);</span></strong>
module_exit<strong><span style="color:#663300;">(</span></strong>proc_demo_exit<strong><span style="color:#663300;">);
</span></strong></pre>
<p>Regarding a <strong>Makefile</strong> you can find a good example <a href="http://briefbox.wordpress.com/2008/09/29/first-linux-loadable-kernel-module">here</a>.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Basic proc file system kernel API]]></title>
<link>http://briefbox.wordpress.com/?p=23</link>
<pubDate>Thu, 02 Oct 2008 11:02:58 +0000</pubDate>
<dc:creator>briefbox</dc:creator>
<guid>http://briefbox.pt-br.wordpress.com/2008/10/02/basic-proc-fs-api/</guid>
<description><![CDATA[Proc fs is a virtual file system mounted in /proc directory which has at least two functions:

Expor]]></description>
<content:encoded><![CDATA[<p>Proc fs is a virtual file system mounted in <strong>/proc directory</strong> which has <span style="text-decoration:underline;">at least two functions</span>:</p>
<ul>
<li><span style="text-decoration:underline;">Exporting kernel state</span> to user-space. It's like a kernel's point of view about the system.</li>
<li><span style="text-decoration:underline;">Communicating particular configuration to the kernel</span> on the fly.  It's an interface to kernel components through which a system operator can interactive modify system behavior.</li>
</ul>
<p><strong>Shell commands</strong> that are common used with proc are: <strong>cat, echo </strong>and<strong> less</strong>. Examples of its usage could be:</p>
<ul>
<li> See system devices:
<pre style="padding-left:90px;">cat /proc/devices</pre>
</li>
<li>Enable IPv4 forwarding:
<pre style="padding-left:90px;">echo<span class="int"> 1</span><span class="operator"> &#62;/</span>proc<span class="operator">/</span>sys<span class="operator">/</span>net<span class="operator">/</span>ipv4<span class="operator">/</span>ip_forward</pre>
</li>
</ul>
<p>Now having enough about what we should know about operating proc from user space it is the moment to see how things are really done into kernel space.</p>
<p><span style="text-decoration:underline;">Two main files</span> from kernel source tree that you should inspect to see some <span style="text-decoration:underline;">proc API functions</span> are:</p>
<ul>
<li>fs/proc/generic.c</li>
<li>include/linux/proc_fs.h</li>
</ul>
<p>Doing some Linux Cross Reference code search about <strong>proc_mkdir</strong> , <strong>create_proc_entry, </strong>and<strong> remove_proc_entry </strong>you will find that the kernel API is simple and <span style="text-decoration:underline;">their function signatures</span> are like this:</p>
<pre style="padding-left:60px;"><strong><span class="keyword">struct</span> proc_dir_entry<span class="operator"> *</span>proc_mkdir
                      <span class="operator">(</span><span class="keyword">const</span><span class="type"> char</span><span class="operator"> *</span>name<span class="operator">,
                       </span><span class="keyword">struct</span> proc_dir_entry<span class="operator"> *</span>parent)

struct proc_dir_entry *create_proc_entry
                      (const char *name, mode_t mode,
                        struct proc_dir_entry *parent)</strong>

<strong>void remove_proc_entry</strong>(<strong>const char *name,struct proc_dir_entry *parent)

</strong></pre>
<p>At this point is intuitive how we can create, or destroy directories and files under proc file system, but how do we <span style="text-decoration:underline;">process their I/O</span>? The answer is like this: "Using a <span style="text-decoration:underline;">proc read and a proc write function</span> setup using the resulting <strong>struct proc_dir_entry*</strong> after we link in the desired file."</p>
<p><span style="text-decoration:underline;">By a proc read function</span> you should understand a function used by kernel to process data when a /proc file is read from user space; usually performed in the reader user process context; and <span style="text-decoration:underline;">by a proc write function</span> a function that is used by the kernel to process data when someone writes in a proc file.</p>
<p><span style="text-decoration:underline;">proc read and write function</span>s have <strong>the prototype</strong> as follows:</p>
<pre><strong>    int func_read(char *buffer, char **start, off_t offset,
             *int count, int *peof, void *dat)</strong></pre>
<pre style="padding-left:30px;"><strong>ssize_t func_write(struct file *filp, const char __user *buff,
                   unsigned long len, void *data)

</strong></pre>
<p>Furthermore, you can find a good example at <a href="http://briefbox.wordpress.com/2008/10/02/proc-fs-demo-1">Basic proc file system module </a> page.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Cross-referencing the linux kernel sources]]></title>
<link>http://briefbox.wordpress.com/?p=19</link>
<pubDate>Tue, 30 Sep 2008 13:13:12 +0000</pubDate>
<dc:creator>briefbox</dc:creator>
<guid>http://briefbox.pt-br.wordpress.com/2008/09/30/corss-referencing-linux-source/</guid>
<description><![CDATA[In process of  exploring whatever corner of Linux kernel source tree it is cute to consult the sour]]></description>
<content:encoded><![CDATA[<p>In process of  exploring whatever corner of Linux kernel source tree it is cute to consult the sources using some automated search system. <strong>Cross reference Linux Project</strong> provides a good solution of what you need.  It's a versatile cross-referencing tool for relatively large code repositories.</p>
<p>So, <strong>LXR</strong> (formerly "<strong><em>the Linux Cross Referencer</em></strong>") and some of its forks may be your good friend.  One instance can be found here <a href="http://lxr.linux.no"> http://lxr.linux.no</a></p>
<p>Google'ing after <strong><em>Linux Cross Reference Source</em></strong> phrase you will find some good sites where the kernel sources are indexed.</p>
<p>Good examples could be:</p>
<ul>
<li><a href="http://www.linux-m32r.org/lxr/http/source/">http://www.linux-m32r.org/lxr/http/source</a></li>
<li><a href="http://users.sosdg.org/~qiyong/lxr/source/">http://users.sosdg.org/~qiyong/lxr/source/</a></li>
<li><a href="http://fxr.watson.org/">http://fxr.watson.org</a></li>
</ul>
<p>Ups, that last link is devilish!</p>
<p><span style="text-decoration:underline;">Basic things</span> that you could do with a cross reference repository:</p>
<ul>
<li>search for a variable, macro, function name etc and find the places in kernel where it's defined and used (<strong>Identifier search</strong>)</li>
<li>search for a particular file name (<strong>file search</strong>)</li>
</ul>
<p>and many more, depending of your current repository.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[First Linux loadable kernel module ]]></title>
<link>http://briefbox.wordpress.com/?p=5</link>
<pubDate>Mon, 29 Sep 2008 08:32:47 +0000</pubDate>
<dc:creator>briefbox</dc:creator>
<guid>http://briefbox.pt-br.wordpress.com/2008/09/29/first-linux-loadable-kernel-module/</guid>
<description><![CDATA[All long voyages have a first step.
Some first loadable kernel module may seen trivial but it&#8217;]]></description>
<content:encoded><![CDATA[<p>All long voyages have a first step.</p>
<p>Some first loadable kernel module may seen trivial but it's worth seeing.</p>
<p>Furthermore it's considered obvious that you've already:</p>
<ul>
<li>Explored  the <a href="http://www.kernel.org/pub/linux/kernel/v2.6">Linux 2.6 kernel source repository</a> , unpacked the latest kernel source into <span style="text-decoration:underline;">/usr/src</span> and linked its directory to <span style="text-decoration:underline;">/usr/src/linux</span></li>
<li>Copied the <strong>/boot/config-`uname -r` </strong>into <span style="text-decoration:underline;">/usr/src/linux</span> and the did a <em><strong>make oldconfig </strong></em>there</li>
</ul>
<p>If you are using GNU Debian/Linux or maybe Ubuntu:</p>
<ul>
<li>Installed the <strong>kernel-package</strong> and maybe some other software packages.</li>
<li>Changed directory into <span style="text-decoration:underline;">/usr/src/linux</span>, compiled the kernel and packed it into a deb file with <strong><em>make-kpkg --initrd &#60;whatever&#62;</em></strong> command.</li>
<li>Installed the compiled kernel with <em>dpkg -i &#60;its deb file&#62;</em> and already rebooted the machine.  (VMware virtual machine?)</li>
</ul>
<p>Now you have the newest Linux kernel running into your testing environment and you're ready to attack your first lkm.</p>
<p>Following source code is quite trivial and could be considered a skeleton. Code is self explanatory.</p>
<p><strong>first.c </strong></p>
<pre><span class="pre">#include &#60;linux/init.h&#62;
#include &#60;linux/kernel.h&#62;
#include &#60;linux/module.h&#62;
</span>
MODULE_LICENSE<span class="operator">(</span><span class="string">"GPL"</span><span class="operator">);</span>
MODULE_AUTHOR<span class="operator">(</span><span class="string">"Copyright Whoever (C) Whenever 2008"</span><span class="operator">);</span><span class="keyword">

static</span><span class="type"> int</span> first_init<span class="operator">(</span><span class="type">void</span><span class="operator">) {</span><span class="type">

        int</span> ret<span class="operator">;</span><span class="comment">

        /*      Do whatever initializings here. If some fails
         * </span><span class="comment">you should uninitialize </span><span class="comment">everyting initialized till
</span><span class="comment">         * </span><span class="comment">failure in </span>reverse order.
         *
<span class="comment">         * You could achieve this with goto statements.
         */</span>

        printk<span class="operator">(</span>KERN_INFO<span class="string"> "first module: loaded\n"</span><span class="operator">);</span><span class="flow">
        return</span><span class="int"> 0</span><span class="operator">;</span>

first_module_err<span class="operator">:</span>
        printk<span class="operator">(</span>KERN_INFO<span class="string"> "first module: not loaded\n"</span><span class="operator">);</span><span class="flow">
        return</span> ret<span class="operator">;
}</span><span class="keyword">
static</span><span class="type"> void</span> first_exit<span class="operator">(</span><span class="type">void</span><span class="operator">) {</span>
        printk<span class="operator">(</span>KERN_INFO<span class="string"> "first module unloaded\n"</span><span class="operator">);
}</span>

module_init<span class="operator">(</span>first_init<span class="operator">);</span>
module_exit<span class="operator">(</span>first_exit<span class="operator">);</span></pre>
<p>OK, now you have <strong>a valid source code</strong> of your first lkm and you wish to <strong>compile and load</strong> it! That's made simple if you like to automate you task using shell. Keep in mind that <strong>GNU make</strong> is your friend.</p>
<p>Following code is a valid makefile that could be used:</p>
<p><strong>Makefile<br />
</strong></p>
<pre>obj<span class="operator">-</span>m<span class="operator"> =</span> first<span class="operator">.</span>o

KERNELDIR<span class="operator">=/</span>usr<span class="operator">/</span>src<span class="operator">/</span>linux
CWD<span class="operator">=</span>$<span class="operator">(</span>shell pwd<span class="operator">)

.</span>PHONY<span class="operator">:</span>clean<span class="flow">

default</span><span class="operator">:</span> clean
        make<span class="operator"> -</span>C $<span class="operator">(</span>KERNELDIR<span class="operator">)</span> I<span class="operator">=</span>$<span class="operator">(</span>CWD<span class="operator">)</span> M<span class="operator">=</span>$<span class="operator">(</span>CWD<span class="operator">);   \</span>
        insmod first<span class="operator">.</span>ko

clean<span class="operator">:</span>
        @INSERTED<span class="operator">=</span>`lsmod<span class="operator"> &#124;</span> grep first`<span class="operator">;            \</span><span class="flow">
         if</span><span class="operator"> [ ! -</span>z<span class="string"> "$$INSERTED"</span><span class="operator"> ];</span> then<span class="operator">            \</span>
            rmmod first<span class="operator">;                           \</span>
         fi<span class="operator">;                                       \</span>
         find<span class="operator"> . -</span>name<span class="char"> '.[a-z A-Z]*'</span><span class="operator"> -</span>o<span class="operator"> -</span>name<span class="char"> '*.o'</span><span class="operator"> \
             -</span>o<span class="operator"> -</span>name<span class="char"> '*.ko'</span><span class="operator"> -</span>o<span class="operator"> -</span>name<span class="char"> '*.mod.c'</span><span class="operator">    \
             -</span>o<span class="operator"> -</span>name<span class="char"> 'Module.*'</span><span class="operator"> -</span>o<span class="operator"> -</span>name<span class="char"> 'modul*'</span><span class="operator"> \
             &#124;</span> xargs rm<span class="operator"> -</span>rf</pre>
<p>Having those two files: <strong>first.c</strong> and <strong>Makefile</strong> into a testing directory you can compile and load the module performing one single command: <em><strong>make</strong></em>. Makefile has an auxiliary target you can follow: <strong>clean</strong>, that will erase every temporary file and directories resulting from compilation process and will unload the module.</p>
<p>If you want to see module's messages you can perform a <strong><em>dmesg &#124; tail</em> </strong>on your shell.</p>
<p>Enjoy!</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Suspending and hibernating]]></title>
<link>http://chrisolio.wordpress.com/?p=6</link>
<pubDate>Thu, 25 Sep 2008 22:50:47 +0000</pubDate>
<dc:creator>Chris</dc:creator>
<guid>http://chrisolio.pt-br.wordpress.com/2008/09/25/suspending-and-hibernating/</guid>
<description><![CDATA[PROTIP: Read my first post.
I think it&#8217;s well-established that I&#8217;m good with computers. ]]></description>
<content:encoded><![CDATA[<p>PROTIP: Read my <a href="http://chrisolio.wordpress.com/2008/9/24/the-beginning/" target="_blank">first</a> post.</p>
<p>I think it's well-established that I'm good with computers. What I haven't mentioned is that I run Linux on my laptop (and my desktop if it was working).</p>
<p>For those of you that are what I like to call computer stupid, Linux is an operating system. Like Windows XP or OS X. The difference between Linux and the mentioned operating systems is that Linux is free and it's source code is freely available on the internet. Which is amazing. <a href="http://groups.google.com/group/comp.os.minix/msg/b813d52cbc5a044b?pli=1" target="_blank">Here's</a> the exact newsgroup post that gave birth to Linux.</p>
<p>Anyway, enough of my gooing over Linux. I've spent most of yesterday evening, night, and basically almost every waking hour today trying to compile a new <a href="http://en.wikipedia.org/wiki/Kernel_(computer_science)" target="_blank">kernel</a> for my laptop, patched with advanced APCI support. But why would I do this?</p>
<p>Right now, I'm unable to suspend or hibernate my laptop. It's buggy at best and more than usual craps out on me.</p>
<p>For those of you that don't know what suspend or hibernate is (or the difference between the two) it's one of those cool things that <a href="http://en.wikipedia.org/wiki/ACPI" target="_blank">ACPI</a> does. A quick crash course in computer engineering and hardware. RAM (or also called memory) is volatile. Data is only kept in the RAM as long as there is an electrical current going through it. This is why people back in the day lost Word documents if their computer shuts down in the middle of typing something up. Now most word processing programs will auto-save documents to the hard drive every 10 - 15 minutes by default, but this number can be changed, but I digress.</p>
<p>Suspend puts your computer in a sort of a low-level power mode, where there's just a small electrical current going through your computer. Just small enough so data stays in the RAM.</p>
<p>Now hibernate is completely different. Instead of keeping everything in the RAM, a snapshot of everything running in the RAM is taken and stored to a file (or in my case, a single partition called a swap partition). When you turn your computer back on, the data stored on the hard drive is loaded back into the RAM.</p>
<p>All of this usually works out of the box on Windows and Mac's. On Linux, it depends on the hardware and several other variables. In my case, I drew the short stick and it doesn't work out of the box. So I get to tinker.</p>
<p>Now, I'm a hardware guy. I'm not that much of a software guy. I can't code. So unfortunately for me, something like compiling a new kernel rarely works right the first time (man, I remember back in the day when I ran Gentoo before there was a GUI installer and everything had to be done via command line). So far, I've managed to completely crap out my video driver (fglrx), and my wireless NIC driver (new madwifi hal). After spending about an hour trying different things and screaming at my laptop, I finally fixed everything and started compiling again from scratch, a bit more familar with what to do now.</p>
<p>That's pretty much my rant for today. I'm waiting for this new kernel to compile (yet again), which takes about an hour or three, so I'm trying to keep myself entertained until it's done.</p>
<p>UPDATE (9/26): It's working. I have to shut down my X server and unload my video card driver to hibernate, otherwise it won't work and I have to force a shutdown.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Linux Foundation contrata mantenedor para o kernel.org]]></title>
<link>http://planetalivre.wordpress.com/?p=310</link>
<pubDate>Wed, 17 Sep 2008 03:04:13 +0000</pubDate>
<dc:creator>eltonslacker</dc:creator>
<guid>http://planetalivre.pt-br.wordpress.com/2008/09/17/linux-foundation-contrata-mantenedor-para-o-kernelorg/</guid>
<description><![CDATA[
]]></description>
<content:encoded><![CDATA[<br />
]]></content:encoded>
</item>
<item>
<title><![CDATA[Linux memory management]]></title>
<link>http://debayan.wordpress.com/?p=77</link>
<pubDate>Mon, 15 Sep 2008 21:59:38 +0000</pubDate>
<dc:creator>debayan</dc:creator>
<guid>http://debayan.pt-br.wordpress.com/2008/09/15/linux-memory-management/</guid>
<description><![CDATA[Linux uses segmentation + pagination, which simplifies notation.
Segments
Linux uses only 4 segments]]></description>
<content:encoded><![CDATA[<p>Linux uses segmentation + pagination, which simplifies notation.</p>
<h3>Segments</h3>
<p>Linux uses only 4 segments:</p>
<ul>
<li>2 segments (code and data/stack) for KERNEL SPACE from [0xC000 0000] (3 GB) to [0xFFFF FFFF] (4 GB)</li>
<li>2 segments (code and data/stack) for USER SPACE from [0] (0 GB) to [0xBFFF FFFF] (3 GB)</li>
</ul>
<pre>                               __
   4 GB---&#62;&#124;                &#124;    &#124;
           &#124;     Kernel     &#124;    &#124;  Kernel Space (Code + Data/Stack)
           &#124;                &#124;  __&#124;
   3 GB---&#62;&#124;----------------&#124;  __
           &#124;                &#124;    &#124;
           &#124;                &#124;    &#124;
   2 GB---&#62;&#124;                &#124;    &#124;
           &#124;     Tasks      &#124;    &#124;  User Space (Code + Data/Stack)
           &#124;                &#124;    &#124;
   1 GB---&#62;&#124;                &#124;    &#124;
           &#124;                &#124;    &#124;
           &#124;________________&#124;  __&#124;
 0x00000000
          Kernel/User Linear addresses</pre>
<h2><a name="ss7.2">7.2 Specific i386 implementation</a></h2>
<p>Again, Linux implements Pagination using 3 Levels of Paging, but in i386 architecture only 2 of them are really used:</p>
<pre>   ------------------------------------------------------------------
   L    I    N    E    A    R         A    D    D    R    E    S    S
   ------------------------------------------------------------------
        \___/                 \___/                     \_____/ 

     PD offset              PF offset                 Frame offset
     [10 bits]              [10 bits]                 [12 bits]
          &#124;                     &#124;                          &#124;
          &#124;                     &#124;     -----------          &#124;
          &#124;                     &#124;     &#124;  Value  &#124;----------&#124;---------
          &#124;     &#124;         &#124;     &#124;     &#124;---------&#124;   /&#124;\    &#124;        &#124;
          &#124;     &#124;         &#124;     &#124;     &#124;         &#124;    &#124;     &#124;        &#124;
          &#124;     &#124;         &#124;     &#124;     &#124;         &#124;    &#124; Frame offset &#124;
          &#124;     &#124;         &#124;     &#124;     &#124;         &#124;   \&#124;/             &#124;
          &#124;     &#124;         &#124;     &#124;     &#124;---------&#124;&#60;------            &#124;
          &#124;     &#124;         &#124;     &#124;     &#124;         &#124;      &#124;            &#124;
          &#124;     &#124;         &#124;     &#124;     &#124;         &#124;      &#124; x 4096     &#124;
          &#124;     &#124;         &#124;  PF offset&#124;_________&#124;-------            &#124;
          &#124;     &#124;         &#124;       /&#124;\ &#124;         &#124;                   &#124;
      PD offset &#124;_________&#124;-----   &#124;  &#124;         &#124;          _________&#124;
            /&#124;\ &#124;         &#124;    &#124;   &#124;  &#124;         &#124;          &#124;
             &#124;  &#124;         &#124;    &#124;  \&#124;/ &#124;         &#124;         \&#124;/
 _____       &#124;  &#124;         &#124;    ------&#62;&#124;_________&#124;   PHYSICAL ADDRESS
&#124;     &#124;     \&#124;/ &#124;         &#124;    x 4096 &#124;         &#124;
&#124; CR3 &#124;--------&#62;&#124;         &#124;           &#124;         &#124;
&#124;_____&#124;         &#124; ....... &#124;           &#124; ....... &#124;
                &#124;         &#124;           &#124;         &#124;    

               Page Directory          Page File

                       Linux i386 Paging</pre>
<h2><a name="ss7.3">7.3 Memory Mapping</a></h2>
<p>Linux manages Access Control with Pagination only, so different Tasks will have the same segment addresses, but different CR3 (register used to store Directory Page Address), pointing to different Page Entries.</p>
<p>In User mode a task cannot overcome 3 GB limit (0 x C0 00 00 00), so only the  first 768 page directory entries are meaningful (768*4MB = 3GB).</p>
<p>When a Task goes in Kernel Mode (by System call or by IRQ) the other 256 pages directory entries become important, and they point to the same page files as all other Tasks (which are the same as the Kernel).</p>
<p>Note that Kernel (and only kernel) Linear Space is equal to Kernel Physical Space, so:</p>
<pre>            ________________ _____
           &#124;Other KernelData&#124;___  &#124;  &#124;                &#124;
           &#124;----------------&#124;   &#124; &#124;__&#124;                &#124;
           &#124;     Kernel     &#124;\  &#124;____&#124;   Real Other   &#124;
  3 GB ---&#62;&#124;----------------&#124; \      &#124;   Kernel Data  &#124;
           &#124;                &#124;\ \     &#124;                &#124;
           &#124;              __&#124;_\_\____&#124;__   Real       &#124;
           &#124;      Tasks     &#124;  \ \   &#124;     Tasks      &#124;
           &#124;              __&#124;___\_\__&#124;__   Space      &#124;
           &#124;                &#124;    \ \ &#124;                &#124;
           &#124;                &#124;     \ \&#124;----------------&#124;
           &#124;                &#124;      \ &#124;Real KernelSpace&#124;
           &#124;________________&#124;       \&#124;________________&#124;

           Logical Addresses          Physical Addresses</pre>
<p>Linear Kernel Space corresponds to Physical Kernel Space  translated 3 GB down (in fact page tables are something like { "00000000", "00000001" }, so they operate no virtualization, they only report physical addresses  they take from linear ones).</p>
<p>Notice that you'll not have an "addresses conflict" between Kernel and User spaces because we can manage physical addresses with Page Tables.</p>
<p><em>Taken from http://tldp.org/HOWTO/KernelAnalysis-HOWTO-7.html</em></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[7 - They got messier: modify the kernel]]></title>
<link>http://migueljimeno.wordpress.com/?p=35</link>
<pubDate>Wed, 10 Sep 2008 22:31:23 +0000</pubDate>
<dc:creator>migueljimeno</dc:creator>
<guid>http://migueljimeno.pt-br.wordpress.com/2008/09/10/7-they-got-messier-modify-the-kernel/</guid>
<description><![CDATA[First, let&#8217;s download the sources of a distribution, compile it as it comes and install it in ]]></description>
<content:encoded><![CDATA[<p>First, let's download the sources of a distribution, compile it as it comes and install it in the router. The next step would be to modify a part of it as you need. Download the source code from WhiteRussian distribution from this page:</p>
<p><a href="http://downloads.openwrt.org/whiterussian/0.9/" target="_blank">http://downloads.openwrt.org/whiterussian/0.9/</a></p>
<p>Use this URL:</p>
<p><a href="http://downloads.openwrt.org/whiterussian/0.9/whiterussian-0.9.tar.bz2" target="_blank">http://downloads.openwrt.org/whiterussian/0.9/whiterussian-0.9.tar.bz2</a></p>
<p>unzip and move to the whiterussian-0.9/ folder. You should start by reading the README file or follow these instructions.</p>
<p>type the following command if you want to change setup options before compiling the distribution:</p>
<p>&#62; make menuconfig</p>
<p>In my case, I didn't need to mess with that configuration. Probably you won't need.</p>
<p>&#62; make</p>
<p>The way OpenWrt is created is as follows: All you download are configuration files. When you run the compilation scripts, they will download the source files from the Linux kernel and other programs needed, like the sources of the gcc compiler, the libraries for STD, and others. In the case of WhiteRussian, it downloads the sources for kernel version 2.4. Be aware that it will download the zip of the sources only if it's not found under the /dl folder of the root folder. So, the first time you compile it, it will download all the libraries and the kernel. The next time this won't happen, unless files are deleted from /dl folder.</p>
<p>-----</p>
<p>If you want to modify the sources, what I've done so far is modifying the Linux kernel. Because WhiteRussian downloads the kernel from a well known Linux kernel download website, it's necessary to tell the compilation scripts that I want it to download my modified version of the source files. In my case, I downloaded the source files for the kernel, applied a patch, zipped again, and uploaded it to my website. Then I found the configuration file I needed to modify, which is found here:</p>
<p>/whiterussian-0.9/toolchain/kernel-headers/</p>
<p>And opened the Makefile. There I found the variable LINUX_HEADERS_SITE, which was set to the Linux kernel download website, and changed it to the following:</p>
<p>LINUX_HEADERS_SITE=www.csee.usf.edu/~mjimeno \<br />
http://www.fr.kernel.org/pub/linux/kernel/v2.4 \<br />
http://www.kernel.org/pub/linux/kernel/v2.4 \<br />
http://www.de.kernel.org/pub/linux/kernel/v2.4</p>
<p>I also modified the LINUX_KERNEL_MD5SUM, which of course changed when I compiled the sources again. (The md5sum the file comes with should be the one for the kernel files located in the Linux website, which of course doesn't change)</p>
<p>Then I ran "make clean" and "make" to see the changes.</p>
<p>...</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[LINUS TORVALDS - One of my favourite person]]></title>
<link>http://mahmudahsan.wordpress.com/?p=177</link>
<pubDate>Thu, 04 Sep 2008 15:11:42 +0000</pubDate>
<dc:creator>mahmudahsan</dc:creator>
<guid>http://mahmudahsan.pt-br.wordpress.com/2008/09/04/linus-torvalds-one-of-my-favourite-person/</guid>
<description><![CDATA[Currently I&#8217;m studying a book named &#8220;Beginning Ubuntu Linux&#8221;. Where I found some w]]></description>
<content:encoded><![CDATA[<p>Currently I'm studying a book named "Beginning Ubuntu Linux". Where I found some words of Linux Torvalds (the creator of Linux Kernel). So, I think to share that words to my blog readers:</p>
<p><strong>Linus Benedict Torvalds</strong> was born in Helsinki, Finland, in 1969. A member of the minority Swedish-speaking population, he attended the University of Helsinki from 1988 to 1996, graduating with a Masters degree in Computer Science.</p>
<p>He started Linux not through a desire to give the world a first-class operating system but with other goals in mind. Its inspiration is in part due to Helsinki winters being so cold. Rather than leave his warm flat and trudge through the snow to the university’s campus in order to use its powerful minicomputer, he wanted to be able to connect to it from home! He also wanted to have a platform to use to experiment with the properties of the Intel 386, but that’s another story. Torvalds needed an operating system capable of such tasks.Linux was born.</p>
<p>It took Torvalds the better part of a year to come up with the very first version of Linux, during which he worked alone in a darkened room. In 1991, he announced his creation to the world, describing Linux as “just a hobby,” and saying it would never be big. It wouldn’t be until 1994 that it reached version 1.0. In the early days, Torvalds’s creation was fairly primitive. He was passionate that it should be free for everyone to use, and so he released it under a software license that said that no one could ever sell it.</p>
<p>However, he quickly changed his mind, adopting the GNU Public License. Torvalds was made wealthy by his creation, courtesy of the dot.com boom of the late 1990s, even though this was never his intention; he was driven by altruism. Nowadays, he lives in Portland, Oregon, with his wife and children, having moved to the United States from Finland in the late 1990s.<br />
Initially, Torvalds worked for Transmeta, developing CPU architectures as well as overseeing kernel development, although this wasn’t part of his official work. He still programs the kernel, but currently he over-sees the Open Source Development Lab, an organization created to encourage open source adoption in industry and which is also referred to as the home of Linux.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Chrome is not an Operating System]]></title>
<link>http://abmw.wordpress.com/?p=163</link>
<pubDate>Wed, 03 Sep 2008 14:20:05 +0000</pubDate>
<dc:creator>Alan Wilensky</dc:creator>
<guid>http://abmw.pt-br.wordpress.com/2008/09/03/chrome-is-not-an-operating-system/</guid>
<description><![CDATA[A number of dilettante tech journalists and bloggers are proclaiming Google&#8217;s Chrome browser ]]></description>
<content:encoded><![CDATA[<p>A number of dilettante tech journalists and bloggers are proclaiming Google's Chrome browser "a new OS!!!!"; by doing this they are displaying an incredible ignorance of what an OS is and does.I realize that we are increasingly a society that has no idea of how things actually work, and that SillyClone Valley is a place where even EE's can't fix their own appliances.</p>
<p>I'm not sure I want to spew out a tutorial here; I am semi-retired from RTOS <a class="zem_slink" title="Linux kernel" rel="homepage" href="http://www.kernel.org/">kernel</a> writing for data acquisition, I know what an OS is.</p>
<p>The Google Chrome browser needs an OS. It needs the hardware initialized and it needs native file system services to place its <a class="zem_slink" title="Persistence (computer science)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Persistence_%28computer_science%29">persistent storage</a>, whether as files or as objects in the Gears Database.</p>
<p>Chrome needs a graphics system to draw, and frame buffer primitives for it's rendering engine. It needs all the drivers to attach AV devices so you can VOIP. All browsers need this.</p>
<p>The newfangled and impressive WebTop, instant booting, ROM-based mini OS provides these minimal services, extracted from a full Linux, to allow web surfing and Skype without a boot from a full, disk-based OS. WebTop is an OS.</p>
<p>Now then, could a browser be an OS? Yes. As we see with the BEA Applications Server side of things, one may write a set of minimal services to take over after the <a class="zem_slink" title="BIOS" rel="wikipedia" href="http://en.wikipedia.org/wiki/BIOS">BIOS</a>, hand over to the Hypervisor, and provide a <a class="zem_slink" title="Java Virtual Machine" rel="wikipedia" href="http://en.wikipedia.org/wiki/Java_Virtual_Machine">JVM</a> with extended OS services. They are doing this now, you can buy a BEA <a class="zem_slink" title="Java (software platform)" rel="homepage" href="http://java.sun.com">Java Application</a> <a class="zem_slink" title="Application server" rel="wikipedia" href="http://en.wikipedia.org/wiki/Application_server">server</a> that does not require a server OS.</p>
<p>If the browser companies want to support the devices, to license drivers, or to use <a class="zem_slink" title="Open source" rel="wikipedia" href="http://en.wikipedia.org/wiki/Open_source">open source</a> distros for the support of post BIOS housekeeping, then by all means, the browser could replace what we now know  as the <a class="zem_slink" title="Operating system" rel="wikipedia" href="http://en.wikipedia.org/wiki/Operating_system">Operating System</a>.</p>
<p>One caveat - even the best <a class="zem_slink" title="Linux distribution" rel="wikipedia" href="http://en.wikipedia.org/wiki/Linux_distribution">Linux distributions</a>, after all these years, and after great and astounding progress, still struggle with device support. Chew on that.</p>
<h6 class="zemanta-related-title" style="font-size:1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.canonware.com/%7Ettt/2008/08/stand-alone-jemalloc-for-linux.html">Stand-alone jemalloc for Linux</a></li>
<li class="zemanta-article-ul-li"><a href="http://www.engadget.com/2008/05/15/asus-bringing-splashtop-instant-on-os-to-all-its-motherboards/">ASUS bringing Splashtop instant-on OS to all its motherboards</a></li>
<li class="zemanta-article-ul-li"><a href="http://news.cnet.com/Red-Hat-unveils-fully-open-source-hypervisor/2100-7344_3-6242043.html?part=rss&#38;subj=news">Red Hat unveils fully open-source hypervisor</a></li>
</ul>
<div class="zemanta-pixie" style="margin-top:10px;height:15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/b04591ea-9f50-4c6a-b566-5ea74fd1309b/"><img class="zemanta-pixie-img" style="border:medium none;float:right;" src="http://img.zemanta.com/reblog_e.png?x-id=b04591ea-9f50-4c6a-b566-5ea74fd1309b" alt="Reblog this post [with Zemanta]" /></a></div>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Sistemas de arquivos: quem entra e quem fica de fora?]]></title>
<link>http://planetalivre.wordpress.com/?p=129</link>
<pubDate>Sat, 30 Aug 2008 17:03:11 +0000</pubDate>
<dc:creator>eltonslacker</dc:creator>
<guid>http://planetalivre.pt-br.wordpress.com/2008/08/30/20000-funcionarios-da-ibm-testam-migracao-interna-do-ms-office-para-o-lotus-symphony-2/</guid>
<description><![CDATA[
]]></description>
<content:encoded><![CDATA[<br />
]]></content:encoded>
</item>
<item>
<title><![CDATA[Mistakes to Avoid while installing softwares in your Linux distros]]></title>
<link>http://aurolive.wordpress.com/?p=585</link>
<pubDate>Tue, 26 Aug 2008 10:18:54 +0000</pubDate>
<dc:creator>aurolive</dc:creator>
<guid>http://aurolive.pt-br.wordpress.com/2008/08/26/mistakes-to-avoid-while-installing-softwares-in-your-linux-distros/</guid>
<description><![CDATA[Installing software in Linux is nothing like it used to be, but there are still some pitfalls to wat]]></description>
<content:encoded><![CDATA[<p>Installing software in Linux is nothing like it used to be, but there are still some pitfalls to watch out for. If you follow this little guide, your Linux life will be made simpler and safer.</p>
<p style="text-align:left;">#1: Installing from source when your system is primarily an .rpm or .deb system</p>
<p>Many new Linux users don’t understand that both rpm and apt (or dkpg) keep track of everything installed on the system. However, those systems (rpm, apt, and dkpg) can keep track only of packages they install. So when you find that obscure package that comes only in source and you compile it yourself, your package management system will not know what to do with it. Instead, create either an .rpm or .deb file from the source and install the package with the package management system so that system will be aware of everything you have installed.</p>
<p>#2: Neglecting the many graphical front-end package management applications</p>
<p>Most people don’t even realize that there are graphical front ends that take a lot of the guesswork out of installing packages in Linux. For yum (the command-line package management system for rpm), you can use Yumex for yum (installed with <em>yum install yumex</em>); you can use Synaptic or Adept for apt (installed with <em>apt-get install synaptic</em> or <em>apt-get install adept</em>).</p>
<p>#3: Forgetting to update the list of available packages</p>
<p>When using apt-get or yum, make sure you’re updating the list of available packages. Otherwise, your system will not remain updated with the latest releases of installed packages. To update with apt-get, you issue the command <em>apt-get update.</em> To update with yum, issue <em>yum check-update.</em></p>
<p>#4: Not adding repositories for yum or apt-get</p>
<p>Both yum and apt-get use a listing of repositories that tell them where to locate available packages. But the default repositories (often called “repos”) do not include every Linux package known to Linuxkind. So if you run the command to install an application, and yum (or apt-get) can’t find the package, most likely you’ll have to add a repo to your sources listing. For yum, the sources are in <em>/etc/yum.conf.</em> For apt-get, they are placed in <em>/etc/apt/sources.list</em>. Once you have added a new repo, make sure you run the update so either apt or rpm is made aware of the new source.</p>
<p>5#: Not taking advantage of installing from a browser</p>
<p>Just as with Windows, when your system sees you are attempting to download an installable application, you’ll be asked whether you would like the package management system to attempt to install the file or just save it to disk. In both instances, you will be asked for the root password (so you must have access to said password for this to even work). One thing I’ve always like about this method (be it in a yum-based or dpkg-based system) is that it has almost always been good about locating and adding dependencies.</p>
<p>Naturally, this method works only when you are downloading a file that’s applicable to your system. If you attempt to download an rpm file on a Debian-based system, you won’t have the option of installing the file.</p>
<p>You can take this one step further and select the Always Do This… check box in the Firefox popup so that every time you download a file associated with your package management system, it will automatically prompt you for your root password and continue to install the package. This streamlines the process quite a bit.</p>
<p>#6: Forgetting the command line</p>
<p>Let’s say you’ve installed a headless server using Ubuntu or Debian (a common setup for Linux servers) and haven’t installed any of the graphical interfaces or desktops. To do any maintenance, you have to log in via ssh (because no admin would log in via telnet) and are limited to the command line only. Even so, your ability to keep your system updated or install new applications is not limited. You can still use yum or apt-get to manage your packages.</p>
<p>With a Debian-based system, you have another option: Aptitude. From the command line, issue the command <em>aptitude</em> and you will be greeted with a nice curses-based interface for apt. This system is easy to use and gives you an outstanding option for maintaining a gui-less server without losing functionality. Aptitude lists Security Updates, Upgradeable Packages, New Packages, Not Installed Packages, Obsolete Packages, Virtual Packages, and Tasks. As you scroll through the list, you will not only get the installed vs. the new package release numbers but also a description of the package. After using Aptitude, you will quickly see how simple updating Linux packages can be, even from the command line.</p>
<p>#7: Blindly unpacking tar files</p>
<p>I can’t tell you how many times I have downloaded a source package and without thinking, untarred the package not knowing its contents. Most times this works out fine. But there are a few times when the package creator/maintainer has failed to mention that the entire contents of the package are not housed in a parent directory. So instead of having a newly created directory housing the contents of the tar file (which can contain hundreds of files/directories), those files are blown up into the directory you unpacked them into.</p>
<p>To avoid this, I always create a temporary directory and move the tar file into it. Then, when I unpack the tar file, it doesn’t matter if the contents are contained within their own directory or not. Using this method will save you a LOT of cleanup in those cases where the creator didn’t pack everything in its own neat directory.</p>
<p>#8: Deleting those make files</p>
<p>When you’re installing from source, you’ll probably run <em>make clean</em> to get rid of all of those unneeded source files. But if you get rid of the Makefile, uninstalling will be a hassle. If you keep it, you can usually uninstall the program simply by issuing <em>make uninstall </em>from the directory housing the Makefile. A word of warning: Don’t dump all your Makefiles into one directory. First rename them so you know which application they belong to. When you want to uninstall the application, move the Makefile to another directory, rename it to its original name, and then run the <em>uninstall</em> command. Once you’ve uninstalled the application, you can delete the Makefile.</p>
<p>#9: Installing for the wrong architecture</p>
<p>You might notice that many rpm files will have an i386, i586, i686, PPC, 64, etc. There is a reason for this. Unless the rpm file has <em>noarch</em> included in the filename, that rpm file was created for a specific architecture. And when those files were created for that architecture, they were optimized for it, so they’ll will run better. Does that mean you can’t install an i586 on a standard 386 machine? Of course not. But it will not run as efficiently as it will on the indicated architecture. Now, you can’t install a PPC rpm on an x86 architecture. The PPC architecture is for the Motorola chipset. Nor can you install the 64 bit on a 32 bit. You can, however, install the 32 bit on a 64 bit (as in the case when you want to get Firefox running with Flash on a 64-bit machine).</p>
<p>#10: Failing to address problems with kernel updates</p>
<p>It used to be that updating kernels was a task left to the silverback geeks. No more. With the new package management systems, anyone can update a kernel. But there are some gotchas you should know about. One issue is that of space. With every update of a kernel, your old kernel is retained. If you continually update kernels, your system storage can quickly fill up. It’s always a good idea to check to see what older kernels you can get rid of. If you’re using rpm, issue the command <em>rpm -qa &#124; grep kernel</em> to see what you have installed. You can remove all but the last two installed. It’s always best to keep two in case the one you are running gets fubar’d.</p>
<p>So guys who are using Ubuntu or any other distros please keep this things in mind while installing anything in your distros and you will never be in any problem.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[انواع ویروس در لینوکس]]></title>
<link>http://kptools.wordpress.com/?p=151</link>
<pubDate>Sun, 24 Aug 2008 11:16:17 +0000</pubDate>
<dc:creator>Kia Taheri</dc:creator>
<guid>http://kptools.pt-br.wordpress.com/2008/08/24/linux-viruses/</guid>
<description><![CDATA[همه‌ی ما با ویروس‌های کامپیوتری آشنا هستیم و تا به حال]]></description>
<content:encoded><![CDATA[<p>همه‌ی ما با ویروس‌های کامپیوتری آشنا هستیم و تا به حال به تعدادی از آن‌ها مبتلا شده‌ایم. یکی از راه‌های خلاص شدن از شرّ این ویروس‌ها استفاده از آنتی‌ویروس هست. اما تنها راه دائمی ِ خلاص شدن، استفاده از سیستم‌عامل <a href="http://www.gnu.org" target="_blank">گنو/لینوکس</a> است. بسیاری از ما برای آزاد شدن از دست ویروس‌ها به گنو/لینوکس پناه آورده‌ایم. این را هم می‌دانیم که لینوکس به ' نداشتن ویروس ' مشهور است. اما به تازگی تعدادی از انواع مختلف ویروس در لینوکس کشف شده‌است. البته کمتر کسی به ویروس در لینوکس مبتلا می‌شود اما بهتر است برای داشتن اطلاعات بیشتر ویروس‌های لینوکس را بشناسیم. در این نوشته به بررسی ویروس‌های لینوکسی (<strong>که تعداد آن‌ها بسیار کم است</strong>) می‌پردازیم.</p>
<p>Rootkit ها:</p>
<p>خیلی‌ها عقیده دارند که Rootkit ها مخصوص سیستم‌عامل لینوکس است. البته تا حدودی این حرف صحت <strong>ندارد</strong>. چون ویندوز هم Rootkit دارد اما صدایش را در نمی‌آورند! در یک بیان کلی بگویم که Rootkit ها دزد اطلاعات کاربران هستند، یعنی با ورود یک Rootkit به لینوکس شما، ممکن است اطلاعات مهم موجود در هارددیسک شما به سرقت برود. البته در 60 درصد مواقع Rootkit ها خود به خود ناپدید می‌شوند، زیرا <strong>لینوکس به این سادگی ها تسلیم نمی‌شود</strong>! این سیستم‌عامل به صورت موقت Port های باز را می‌بندد و Rootkit ، کامپیوتر شما را از دست می‌دهد. در این حالت (یعنی همان 60 درصد) هیچ اطلاعاتی از کامپیوتر شما به سرقت نمی‌رود.</p>
<p>Rooter ها:</p>
<p>روتر ها دسته‌ای از خطرناک‌ترین ویروس‌های لینوکس هستند که احتمال مبتلا شدن به آن‌ها بسیار کم است، اما با این وجود هرساله ده‌ها کامپیوتر که بیشتر آن‌ها " کارگزار " هستند به روتر ها مبتلا می‌شوند. کاری که روتر انجام می‌دهد این‌است که هسته‌ی لینوکس (که قابل ویرایش است) را به دل‌خواه خود تغییر می‌دهد و از طرف قربانی هرکاری که بخواهد در شبکه و اینترنت انجام می‌دهد که همه به پای قربانی نوشته می‌شود. این روتر ها معمولا در شبکه‌هایی که هکر ها با هم جلسه می‌گذارند در کمین می‌نشینند. مثلا یک روتر در جلسه‌ی مهمی که در irc.freenode برگذار شده پنهان می‌شود و به سیستم یکی از اعضا نفوذ می‌کند. البته در صورت تسلط کاربر به مفاهیم امنیتی، این روتر دست و پا بسته از سیستم قربانی خارج می‌شود. با این حال بیشتر سیستم‌های SERVER به این دسته از روتر ها مبتلا می‌شوند. البته بعضی از این‌ها در source های صفحات‌وب پنهان می‌شوند که این بیشتر در ویندوز رخ می‌دهد. زیرا فایرفاکس تسلیم این‌ها نمی‌شود!</p>
<p>squidanti ها:</p>
<p>squid نام نرم‌افزاری است که سیستم لینوکس شما را به proxy تغییر می‌دهد. در بیان ساده‌تر، لینوکس شما را به proxy متصل می‌کند. به تازگی برنامه‌های مخربی نوشته شده‌اند که به squidanti معروف‌اند. اگر شما از squid استفاده کنید و به برنامه‌ی مخرب ِ squidanti مبتلا شوید، هر بار که به اینترنت متصل می‌شوید (تقریبا همیشه) تعداد زیادی پیام تبلیغاتی در پنجره‌ی مرورگرتان مشاهده خواهید کرد. البته این پیام ها در فایرفاکس دیده نمی‌شوند اما در سایر مرورگرهای لینوکسی نمایان خواهند شد.</p>
<p>راه مبارزه=</p>
<p>به جز 3 ویروسی که در بالا ذکر شد، لینوکس دیگر ویروسی ندارد! البته آن 3 ویروس هم بسیار کم‌پیدا هستند! یعنی اگر شما مسلط باشید و راه‌کارهای مبارزه با آن‌ها را بدانید، به هیچ وجه آلوده نخواهید شد. یکی از این راه‌کارها استفاده از آنتی‌ویروس برای لینوکس است. البته بیشتر آنتی‌ویروس های لینوکس برای شناسایی ویروس های ویندوز ساخته شده‌اند، اما ضدویروس مخصوص لینوکس هم وجود دارد. (مثل:<a href="http://en.wikipedia.org/wiki/LinuxShield" target="_blank">Linux Shield</a>) یک راه‌ بهتر و اساسی‌تر استفاده از فایروال است. مثل برنامه <a href="http://www.fs-security.com" target="_blank">Firestarter</a>.</p>
<p>--</p>
<p>- ویروس کامپیوتری (<a href="http://fa.wikipedia.org/wiki/%D9%88%DB%8C%D8%B1%D9%88%D8%B3%E2%80%8C%D9%87%D8%A7%DB%8C_%D8%B1%D8%A7%DB%8C%D8%A7%D9%86%D9%87%E2%80%8C%D8%A7%DB%8C" target="_blank">فارسی</a> - <a href="http://en.wikipedia.org/wiki/Computer_virus" target="_blank">انگلیسی</a>)</p>
<p>- <a href="http://www.kernel.org" target="_blank">هسته لینوکس</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[layer7]]></title>
<link>http://crozzzlinx.wordpress.com/?p=11</link>
<pubDate>Thu, 07 Aug 2008 08:59:53 +0000</pubDate>
<dc:creator>crozzzlinx</dc:creator>
<guid>http://crozzzlinx.pt-br.wordpress.com/2008/08/07/layer7/</guid>
<description><![CDATA[layer7-filter nyaeta pemisahan paket linux nu umumna digunakeun jang misahkeun atawa ngablok paket t]]></description>
<content:encoded><![CDATA[<p>layer7-filter nyaeta pemisahan paket linux nu umumna digunakeun jang misahkeun atawa ngablok paket tertentu jiga paket p2p, nu lengkapna tiasa dibaca ka websitena langsung di <a href="http://l7-filter.sourceforge.net">http://l7-filter.sourceforge.net</a>.</p>
<p>kernel nu didukung nyaeta versi 2.4 jeung 2.6, abdi mah ngango layer7 di kernel 2.6<br />
<!--more --></p>
<p>Nu dibutuhkeun jang instalasina nyaeta:</p>
<p>1. Kernel linux tiasa download di <a href="http://www.kernel.org">www.kernel.org</a></p>
<p>2. Iptables download di <a href="http://www.nelfilter.org">www.nelfilter.org</a></p>
<p>3. layer7-filter download di <a href="http://sourceforge.net/project/showfiles.php?group_id=80085">http://sourceforge.net/project/showfiles.php?group_id=80085</a></p>
<p>4. Protokol nu dikenal ku layer7 download di <a href="http://sourceforge.net/project/showfiles.php?group_id=80085">http://sourceforge.net/project/showfiles.php?group_id=80085</a></p>
<p>keur nu ahli mah ceuk websitena teh : "Apply our kernel patch. Enable the new match option in Netfilter."</p>
<p>singkatna mah nambah modules anyar di kernel nyaeta layer7-filter.</p>
<p>1. download layer7-filter</p>
<p>2. buka kompresian file na</p>
<p>3. patch kernel source ku layer7-filter</p>
<blockquote><p>#cd /usr/src/linux</p>
<p>#patch -p1 &#60; ../tempat/patchkernel/file.patch &#60;&#60;&#60; sesuaikeun jeung versi kernel</p></blockquote>
<p>4. Pilih paket kernel supaya ngadukung layer7 nyaeta di bagian :</p>
<blockquote><p>"Prompt for development and/or incomplete code/drivers" (under "Code maturity level options")<br />
"Network packet filtering framework" (Networking → Networking support → Networking Options)<br />
"Netfilter Xtables support" (on the same screen)<br />
"Netfilter connection tracking support" (... → Network packet filtering framework → Core Netfilter Configuration), select "Layer 3 Independent Connection tracking"<br />
"Connection tracking flow accounting" (on the same screen)<br />
And finally, "Layer 7 match support"<br />
Optional but highly recommended: Lots of other Netfilter options, notably "FTP support" and other matches. If you don't know what you're doing, go ahead and enable all of them.<br />
5. Kompilasi jeung install kernel siga biasana, restart linux</p></blockquote>
<p>6. Download, Install jeung patch iptables, piceun iptables bawaan na ngarah teu liuer, soalna abi can tiasa mun langsung pake iptables bawaan da teu aya source iptables bawaanna.</p>
<blockquote><p>#cd /usr/src</p>
<p>#wget <a href="http://............iptables..tar.bz2">http://............iptables..tar.bz2</a></p>
<p>#tar jxf iptables..tar.bz2</p>
<p>#cd iptables</p>
<p>#patch -p1 &#60; ../tempat/patchiptables/file.patch</p>
<p>#chmod +x extensions/.layer7-test</p>
<p>#make</p>
<p>#make install</p></blockquote>
<p>7. Download protokol-protokol nu didukung ku layer7, install/copykeun</p>
<blockquote><p># wget <a href="http://l7-protocols-YYYY-MM-DD.tar.gz">http://l7-protocols-YYYY-MM-DD.tar.gz</a></p>
<p>#tar xzf l7-protocols-YYYY-MM-DD.tar.gz</p>
<p>#cd l7-protocols-YYYY-MM-DD</p>
<p>#make install</p></blockquote>
<p>tah ayeuna linux na tos support layer7, mangga di cobian... heheheh...</p>
<p>salam</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Linked lists in the linux kernel]]></title>
<link>http://scaryreasoner.wordpress.com/?p=125</link>
<pubDate>Fri, 25 Jul 2008 03:22:27 +0000</pubDate>
<dc:creator>scaryreasoner</dc:creator>
<guid>http://scaryreasoner.pt-br.wordpress.com/2008/07/25/linked-lists-in-the-linux-kernel/</guid>
<description><![CDATA[A couple of days ago I was having to dig through the SCSI mid layer code in the linux kernel, and I ]]></description>
<content:encoded><![CDATA[<p>A couple of days ago I was having to dig through the SCSI mid layer code in the linux kernel, and I came across many uses of struct list_head pointers using the linux kernel's circular, doubly linked list implementation, which is quite strange the first time you see it, and which I'd forgotten about, not having looked at it in a long time.  So I sort of had to re-figure it out, and I thought an explanation of it would make a good blog post, as it is a lot trickier than the linked lists you likely ran across in your college Data Structures class.  When you see it being used somewhere in some code without knowing what's behind it, you will likely find yourself thinking, "How can this work?  What the heck is going on here?"   But, I also thought, surely someone else has already explained this.  And so they have, and done quite a good job of it too.</p>
<p><a href="http://isis.poly.edu/kulesh/stuff/src/klist/">Linux Kernel Linked List Explained</a>.</p>
<p>A very clever use of the offsetof() macro (which itself is very clever) is at the heart of this linked list implementation.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Finding Version Information On Ubuntu Hardy Heron]]></title>
<link>http://vitalbodies.wordpress.com/?p=252</link>
<pubDate>Tue, 15 Jul 2008 06:49:19 +0000</pubDate>
<dc:creator>vitalbodies</dc:creator>
<guid>http://vitalbodies.pt-br.wordpress.com/2008/07/14/finding-version-information-on-ubuntu-hardy-heron/</guid>
<description><![CDATA[Finding Version Information On Ubuntu Hardy Heron
If you need support or help you will often be aske]]></description>
<content:encoded><![CDATA[<p><strong>Finding Version Information On Ubuntu Hardy Heron</strong></p>
<p>If you need support or help you will often be asked what version of Ubuntu you are running.</p>
<p>You could be asked what version of the Linux kernel you are running?</p>
<p>And what version of Gnome?</p>
<p>Do you know your network name?</p>
<p>How much memory is installed or what is the available disk space?</p>
<p><strong>Here is a quick how to for finding out the basics: </strong></p>
<p>System &#62; Administration &#62; System Monitor.</p>
<p>Click on the System tab.</p>
<p><a href="http://vitalbodies.files.wordpress.com/2008/07/system_monitor_system.png"><img class="aligncenter size-full wp-image-253" src="http://vitalbodies.wordpress.com/files/2008/07/system_monitor_system.png" alt="" width="470" height="406" /></a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[The Mystery behind symlink 'linux' during kernel compilation..]]></title>
<link>http://themaccabee.wordpress.com/?p=27</link>
<pubDate>Tue, 08 Jul 2008 13:30:37 +0000</pubDate>
<dc:creator>Stephen Thomas</dc:creator>
<guid>http://themaccabee.pt-br.wordpress.com/2008/07/08/the-mystery-behind-symlink-linux-during-kernel-compilation/</guid>
<description><![CDATA[I found a nice tutorial in which the usage of Symlink is nicely covered..
Thanks to
Brass Cannon Con]]></description>
<content:encoded><![CDATA[<p>I found a nice tutorial in which the usage of Symlink is nicely covered..</p>
<p>Thanks to</p>
<h4><a href="http://brasscannon.net/">Brass Cannon Consulting</a></h4>
<p>The full story is here...</p>
<p><a href="http://handsonhowto.com/older/ckernel.html">http://handsonhowto.com/older/ckernel.html</a></p>
<p>"Take a look in /usr/src -- you should see a symlink called "linux" which  in turn points to a directory such as "linux-2.4.3".  That would be  excellent.</p>
<div class="aside">
<p>A "symbolic link" or symlink is just a shortcut, a sort of fake file that points to a real file somewhere else.  It comes in handy when you want to refer to "the directory where the current Linux source is", and not be stumped when "current" changes from 2.2.20 to 2.2.22. Remove the old symlink, create a new one, and presto! <tt>/usr/src/linux</tt> keeps the same meaning -- "here's the current Linux source directory" although it's pointing to a different real directory.</div>
<p>So, we want to remove the symbolic link <tt>/usr/src/linux</tt> (assuming it IS just a symbolic link!) and re-create it pointing to a new directory,  "linux-2.2.20".  Here's how to do that:</p>
<pre>kevin@bazooka:/usr/src: su -
Password:
[root@bazooka /root]# cd /usr/src
[root@bazooka src]# ls -l
total 12
drwxr-xr-x    7 root     root         4096 Jan 31 08:03 RPM/
lrwxrwxrwx    1 root     root           12 Jan 31 08:30 linux -&#62; linux-2.4.3/
drwxr-xr-x   17 root     root         4096 Jan 31 08:25 linux-2.4.3/</pre>
<p>Note the "arrow" in <tt>linux -&#62; linux-2.4.3/</tt> and that the first character in the line is a lower-case <tt>l</tt> -- that's how you know that "linux" is a link, and not a real directory.  You will only see that in a <em>long</em> directory listing, ls -l.  If "linux" is a real directory and not a symlink, you'll want to <em>rename</em> it, not remove it. That would look something like this:</p>
<pre>[root@bazooka src]# ls -l
total 0
drwxr-xr-x    7 root     root         4096 Jan 31 08:03 RPM/
drwxr-xr-x   17 root     root         4096 Jan 31 08:25 linux/
[root@bazooka src]# mv linux linux-2.4.3
[root@bazooka src]# ls -l
total 0
drwxr-xr-x    7 root     root         4096 Jan 31 08:03 RPM/
drwxr-xr-x   17 root     root         4096 Jan 31 08:25 linux-2.4.3/</pre>
<p>Let's go back to the original example now, where we have an existing linux symlink pointing to a linux-2.4.3 directory.  (Remember, we are about to compile an older stable kernel, version 2.2.20, to support a commercial module that we can't run under a 2.4 kernel.)  Let's begin by  removing the <tt>/usr/src/linux</tt> symlink.</p>
<pre>[root@bazooka src]# pwd
/usr/src
[root@bazooka src]# ls -l
total 12
drwxr-xr-x    7 root     root         4096 Jan 31 08:03 RPM/
lrwxrwxrwx    1 root     root           12 Jan 31 08:30 linux -&#62; linux-2.4.3/
drwxr-xr-x   17 root     root         4096 Jan 31 08:25 linux-2.4.3/
[root@bazooka src]# rm linux
rm: remove `linux'? y
[root@bazooka src]# mkdir linux-2.2.20
[root@bazooka src]# ln -s linux-2.2.20 linux
[root@bazooka src]# ls -l
total 12
drwxr-xr-x    7 root     root         4096 Jan 31 08:03 RPM/
lrwxrwxrwx    1 root     root           12 Feb  5 13:45 linux -&#62; linux-2.2.20/
drwxr-xr-x    2 root     root         4096 Feb  5 13:44 linux-2.2.20/
drwxr-xr-x   17 root     root         4096 Jan 31 08:25 linux-2.4.3/</pre>
<p>Why do we care about this "linux" symlink so much? <strong><em> The Linux  kernel sources are picked up from a "linux" directory when they are packaged into a "tar" archive file; when you unpack them, therefore, they expect to go back <em>into</em> a "linux" directory.  If you only have a single "linux" directory, and you unpack them into /usr/src without doing the steps above, they will overwrite <em>some</em> of your existing source files, and leave you with a real mess.  You'll have old and new files all mixed together. In a  situation like that, the only thing to do is remove the entire "linux" directory and start over.  Using a symlink to point to the current version -- and keeping each version in its own directory -- makes it much easier to keep everything under  contro</em></strong>l.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[هسته سیستم عامل]]></title>
<link>http://kptools.wordpress.com/?p=108</link>
<pubDate>Sun, 29 Jun 2008 07:58:56 +0000</pubDate>
<dc:creator>Kia Taheri</dc:creator>
<guid>http://kptools.pt-br.wordpress.com/2008/06/29/kerne/</guid>
<description><![CDATA[مقصود از این مقاله معرفی kernel (هسته سیستم عامل) است. kernel (]]></description>
<content:encoded><![CDATA[<p>مقصود از این مقاله معرفی <a href="http://en.wikipedia.org/wiki/Kernel_(computer_science)">kernel</a> (هسته سیستم عامل) است. kernel (کِرنل بخوانید) یا به اصطلاح ِ فارسی، <a href="http://fa.wikipedia.org/wiki/%D9%87%D8%B3%D8%AA%D9%87_%D8%B3%DB%8C%D8%B3%D8%AA%D9%85_%D8%B9%D8%A7%D9%85%D9%84" target="_blank">هسته</a>، مهم ترین جزء و بخش یک <a href="http://fa.wikipedia.org/wiki/%D8%B3%DB%8C%D8%B3%D8%AA%D9%85_%D8%B9%D8%A7%D9%85%D9%84" target="_blank">سیستم عامل</a> است. هسته وظیفه پردازش اطلاعات و برقراری ارتباط با نرم افزار را برعهده دارد تا ارتباط آن با <a href="http://fa.wikipedia.org/wiki/%D8%B1%DB%8C%D8%B2_%D9%BE%D8%B1%D8%AF%D8%A7%D8%B2%D9%86%D8%AF%D9%87" target="_blank">ریزپردازنده</a> حفظ شود و با قطعات متصل به کامپیوتر ارتباط برقرار شود. خود هسته به طور کلی یک نرم افزار است که توسط افرادی، و با دانش برنامه نویسی ساخته میشود. زبان های برنامه نویسی متفاوتی هستند که میتوان با کمک آنها کرنل را به وجود آورد. اگر در ساخت یک کرنل از چند نرم افزار و بخش های متفاوت استفاده شود، مجموعه ای از برنامه ها پدید می آیند که به آن "مجموعه هسته" می گویند. مجموعه هسته، مجموعه نرم افزار هایی است که منابع سیستم را مدیریت میکند و میان نرم افزارها و سخت افزارهای سیستم ارتباط برقرار میکند. شاید سوال شما این باشد که این ارتباط، چگونه ارتباطی است؟ در جواب باید پاسخ داد که هسته دستورها و وظایف سخت افزارها را بیان میکند و اطلاعات آنها را وارد نرم افزار می کند. نرم افزار در این جا به منظور سیستم عامل است. هر سیستم عامل، یک مجموعه هسته دارد و هر هسته نیز چند مولفه دارد. کرنل وظیفه دارد دستورات cpu و حافطه و قطعات سیستم را با نرم افزار و برنامه هماهنگ کند. اولین فعالیت کرنل، مدیریت پردازش است. کرنل آدرس یک فرآیند را از برنامه در حال اجرا دریافت می کند و آن را پردازش می کند و به صورت یک دستور در می آورد و دستور را به سخت افزار، قطعات و cpu ارسال میکند. مرحله دوم از فعالیت های کرنل، مدیریت حافظه است که اطلاعات را از حافظه به سخت افزار منتقل میکند. فعالیت سوم، مدیریت قطعات (<a href="http://en.wikipedia.org/wiki/Computer_hardware" target="_blank">devices</a>) است، در این مرحله قطعات جانبی که به کامپیوتر متصل است شناسایی و مدیریت می شود.</p>
<p>تقریبا تمام سیستم عامل ها کرنل دارند اما بعضی از آنها نسبت به سایرین برتری دارند. مثلا سیستم عامل لینوکس نسبت به ویندوز برتری نسبی دارد. از آن جهت که <a href="http://fa.wikipedia.org/wiki/%D9%87%D8%B3%D8%AA%D9%87_%D9%84%DB%8C%D9%86%D9%88%DA%A9%D8%B3" target="_blank">هسته لینوکس</a> چند پارچه است، یعنی از لایه های مختلفی تشکیل شده و هر لایه یک وظیفه را دنبال میکند. پس در چنین شرایطی هیچ تداخلی در اعمال سیستم به وجود نمی آید و دسترسی نرم افزار ها به لایه های مختلف قطع میشود. اما ویندوز یکپارچه است و تمامی مراحل نام برده شده در یک لایه صورت میگیرد، به همین دلیل است که خطاها و اشکالات فنی در ویندوز خیلی زیاد بروز می یابند. برخی از کرنل ها کدباز (open source) هستند و از این جهت مشکلات کمتری دارند زیرا توسط عده ی زیادی از مردم در دنیا قابل توسعه و گسترش و رفع عیب است.</p>
<p>-  "کرنل" در ویکی‌پدیا: <a href="http://en.wikipedia.org/wiki/Kernel_(computer_science)" target="_blank">انگلیسی</a> - <a href="http://fa.wikipedia.org/wiki/%D9%87%D8%B3%D8%AA%D9%87_%D8%B3%DB%8C%D8%B3%D8%AA%D9%85_%D8%B9%D8%A7%D9%85%D9%84" target="_blank">فارسی</a></p>
<p><a href="ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p22.tar.bz2"></a></p>
<p>-  <a href="http://kernel.org" target="_blank">سایت رسمی هسته لینوکس</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[NFS support for BtrFS]]></title>
<link>http://balajirrao.wordpress.com/?p=53</link>
<pubDate>Sun, 29 Jun 2008 00:21:52 +0000</pubDate>
<dc:creator>balajirrao</dc:creator>
<guid>http://balajirrao.pt-br.wordpress.com/2008/06/29/nfs-support-for-btrfs/</guid>
<description><![CDATA[For the uninitiated, Btrfs is a new copy on write filesystem for Linux aimed at implementing advance]]></description>
<content:encoded><![CDATA[<p>For the uninitiated, Btrfs is a new copy on write filesystem for Linux aimed at implementing advanced features while focusing on fault tolerance, repair and easy administration. Initially developed by Oracle, Btrfs is licensed under the GPL and open for contribution from anyone. My interest in it lies in BtrFS being a very good competitor to the much talked of Sun ZFS. It has got a bunch of features like, (Taken from <a href="http://btrfs.wiki.kernel.org/index.php/Main_Page">Btrfs wiki</a>).</p>
<ul>
<li> Extent based file storage (2^64 max file size)</li>
<li> Space efficient packing of small files</li>
<li> Space efficient indexed directories</li>
<li> Dynamic inode allocation</li>
<li> Writable snapshots</li>
<li> Subvolumes (separate internal filesystem roots)</li>
<li> Object level mirroring and striping</li>
<li> Checksums on data and metadata (multiple algorithms available)</li>
<li> Strong integration with device mapper for multiple device support</li>
<li> Online filesystem check</li>
<li> Very fast offline filesystem check</li>
<li> Efficient incremental backup and FS mirroring</li>
</ul>
<p>After having decided to write NFS support for BtrFS today 24 hours ago,  I've come up with an initial version of the implementation. It works mostly, but its not perfect. I'm sure I have messed up some locking stuff. Let me see what the devs at btrfs devel have to say.</p>
<p>You can find the RFC patch <em><a href="http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg00225.html">here.</a></em> I just hope it gets into BtrFS in a couple of iterations. :)</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Openmoko in India]]></title>
<link>http://balajirrao.wordpress.com/?p=51</link>
<pubDate>Sun, 29 Jun 2008 00:07:51 +0000</pubDate>
<dc:creator>balajirrao</dc:creator>
<guid>http://balajirrao.pt-br.wordpress.com/2008/06/29/openmoko-in-india/</guid>
<description><![CDATA[I had dropped plans to buy this cool Open Source Linux phone, Open Moko, because of the hassles invo]]></description>
<content:encoded><![CDATA[<p>I had dropped plans to buy this cool Open Source Linux phone, <a href="http://wiki.openmoko.org/wiki/Main_Page">Open Moko</a>, because of the hassles involved in shipping from a foreign country and others. But I was told by a friend, that we have a dealer in India, <a href="http://idasystems.net/freerunner">Ida Systems.</a> Now I've changed my decision. I'm going to buy it :) Wow. Open Moko rocks! See below for a photo showing an Open Moko 1973 (prior to free runner) booting Linux. I just cant wait to get my hands to it!</p>
<p><a href="http://balajirrao.wordpress.com/files/2008/06/neo-freerunner-giz.jpg"><img class="alignnone size-full wp-image-52" src="http://balajirrao.wordpress.com/files/2008/06/neo-freerunner-giz.jpg" alt="Neo Freerunner" width="463" height="308" /></a></p>
<p><em>Image Courtesy : <a href="http://www.mobilelinuxinfo.com/category/openmoko/">http://www.mobilelinuxinfo.com/category/openmoko/</a></em></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[USB Data Snooping]]></title>
<link>http://balajirrao.wordpress.com/?p=45</link>
<pubDate>Wed, 25 Jun 2008 22:51:45 +0000</pubDate>
<dc:creator>balajirrao</dc:creator>
<guid>http://balajirrao.pt-br.wordpress.com/2008/06/26/usb-data-snooping/</guid>
<description><![CDATA[During my work for gPXE I had to snoop the USB data for various reasons. Here&#8217;s a small post s]]></description>
<content:encoded><![CDATA[<p>During my work for gPXE I had to snoop the USB data for various reasons. Here's a small post showing all the approaches to do it.</p>
<h4>QEMU</h4>
<p>If you are running your OS in QEMU, then you are very lucky. If you have got the QEMU source code, just go and uncomment the lines starting with #define DEBUG_*. Now when you run QEMU, you will see tons of very valuable information being printed on the console. This makes QEMU a bit slow. But who cares for speed when debugging! The best thing about this approach is that the data printed by QEMU is in a user understandable format unlike the dump by usbmon which follows next.</p>
<h4>USBMON</h4>
<p>This method is a bit involved. First you have to mount the debugfs in /sys/kernel/debug. There you see a directory called usbmon. In there you see many files 1t,1u,2t,2u etc. The one prefixed with 'u' is supposed to be a newer version. The number identifies the bus number. The bus your device is connected to is obtained by running lsusb - an utility supplied under the usbutils package.</p>
<p>Once you've identified the bus your device is attached to, go ahead and do 'cat 3t' for example and you see tons of information of this form.</p>
<pre>ffff810106c656c0 20722002 C Co:6:000:0 0 0
ffff8100aa4a0540 20735354 S Ci:6:003:0 s 80 06 0100 0000 0012 18 &#60;
ffff8100aa4a0540 20741001 C Ci:6:003:0 0 18 = 12010002 00000008 6d0419c0 01430102 0001
ffff8100aa4a0540 20741011 S Ci:6:003:0 s 80 06 0200 0000 0009 9 &#60;
ffff8100aa4a0540 20746000 C Ci:6:003:0 0 9 = 09022200 010100a0 32
ffff8100aa4a0540 20746008 S Ci:6:003:0 s 80 06 0200 0000 0022 34 &#60;
ffff8100aa4a0540 20754001 C Ci:6:003:0 0 34 = 09022200 010100a0 32090400 00010301 02000921 11010001 22370007 05810305
ffff8100aa4a0540 20754012 S Ci:6:003:0 s 80 06 0300 0000 00ff 255 &#60;
ffff8100aa4a0540 20759000 C Ci:6:003:0 0 4 = 04030904
ffff8100aa4a0540 20759006 S Ci:6:003:0 s 80 06 0302 0409 00ff 255 &#60;
ffff8100aa4a0540 20768000 C Ci:6:003:0 0 36 = 24035500 53004200 20004f00 70007400 69006300 61006c00 20004d00 6f007500
ffff8100aa4a0540 20768006 S Ci:6:003:0 s 80 06 0301 0409 00ff 255 &#60;
ffff8100aa4a0540 20775001 C Ci:6:003:0 0 18 = 12034c00 6f006700 69007400 65006300 6800
ffff8100aa4a0540 20775125 S Co:6:003:0 s 00 09 00</pre>
<p>The format of this dump is pretty well documented in a in source text file located in Documentation/. You can also get it <a href="http://lxr.linux.no/linux/Documentation/usb/usbmon.txt">here.</a> This output is really helpful.</p>
<p>This cool thing is used by device driver writers. The device for which they intend to write a device driver is  pass-through-ed to QEMU. They run a OS such as Windows in it and when the windows driver for the device interacts with its device, it can be snooped. And looking at this data, people write reverse engineered drivers!</p>
]]></content:encoded>
</item>

</channel>
</rss>
