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

<channel>
	<title>twam.info &#187; Gentoo</title>
	<atom:link href="http://www.twam.info/tag/gentoo/feed" rel="self" type="application/rss+xml" />
	<link>http://www.twam.info</link>
	<description>My computer, physics, electronics &#38; photography blog</description>
	<lastBuildDate>Wed, 25 Jan 2012 20:49:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CHOST: i586 vs. i486 on AMD Geode LX</title>
		<link>http://www.twam.info/hardware/chost-i586-vs-i486-on-amd-geode-lx</link>
		<comments>http://www.twam.info/hardware/chost-i586-vs-i486-on-amd-geode-lx#comments</comments>
		<pubDate>Mon, 25 May 2009 18:27:01 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Alix]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ALIX.3D3]]></category>
		<category><![CDATA[CHOST]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=510</guid>
		<description><![CDATA[On my blog post about Installing Gentoo on ALIX.3D3 Mart Raudsepp made an interesting comment: He pointed out, that on AMD Geode CPUs it might be better to use i486 CHOST instead of my used i586, because the CPU is more like a i486 as far as instruction scheduling and times go. This sounded interesting, [...]]]></description>
			<content:encoded><![CDATA[<p>On my blog post about <a href="http://www.twam.info/linux/gentoo/installing-gentoo-on-alix3d3">Installing Gentoo on ALIX.3D3 </a>Mart Raudsepp made an interesting <a href="http://www.twam.info/linux/gentoo/installing-gentoo-on-alix3d3/comment-page-1#comment-67">comment</a>: He pointed out, that on AMD Geode CPUs it might be better to use i486 CHOST instead of my used i586, because the CPU is more like a i486 as far as instruction scheduling and times go.</p>
<p>This sounded interesting, so I googled for some benchmark test to measure differences. I found <a href="http://www.tux.org/~mayer/linux/bmark.html">nbench</a>, which measures performance by executing some typical algorithms and compares them to a Pentium 90 based system. So I installed it and run on the i586 CHOST system, then rebuild it completely to i486 CHOST and run it again.<span id="more-510"></span> The differences are not that huge, but on some algorithms they&#8217;re measurable:</p>
<p><a href="http://www.twam.info/wp-content/uploads/2009/05/i486_i586_comparison.png"><img class="aligncenter size-full wp-image-513" title="i486 &amp; i586 CHOST comparison" src="http://www.twam.info/wp-content/uploads/2009/05/i486_i586_comparison.png" alt="i486 &amp; i586 CHOST comparison" width="580" height="450" /></a></p>
<p>The first 13 bars are the different algorithms. The main difference is on the string sort, which is heavily memory dependent. That last 3 rows are a index based on the algorithms. Here is main difference on memory index, as the normalized version shows very clear (positive values mean that i486 is faster):</p>
<p><a href="http://www.twam.info/wp-content/uploads/2009/05/i486_i586_comparison_normalized.png"><img class="aligncenter size-full wp-image-514" title="i486 &amp; i586 CHOST comparison (normalized)" src="http://www.twam.info/wp-content/uploads/2009/05/i486_i586_comparison_normalized.png" alt="i486 &amp; i586 CHOST comparison (normalized)" width="580" height="450" /></a></p>
<p>As there is no significant disadvantage of the i486 CHOST, this seems to be the choice. <img src='http://www.twam.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If anybody has other (free) benchmarks to suggest, please let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/hardware/chost-i586-vs-i486-on-amd-geode-lx/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Using Geode&#8217;s AES engine on ALIX.3D3</title>
		<link>http://www.twam.info/hardware/alix/using-geodes-aes-engine-on-alix3d3</link>
		<comments>http://www.twam.info/hardware/alix/using-geodes-aes-engine-on-alix3d3#comments</comments>
		<pubDate>Wed, 13 May 2009 17:08:45 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Alix]]></category>
		<category><![CDATA[ALIX.3D3]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[LUKS]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=491</guid>
		<description><![CDATA[The AMD Geode LX800 CPU has an on-chip AES 128-bit crypto accelerations block and a true random number generator. Using this block for encryption and decryption is a lot faster than software implemented algorithms and it unloads the CPU. There are two main purposes where en/decryption is needed: Storing files Communication over network (IPSEC, OpenVPN, [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.amd.com/us-en/ConnectivitySolutions/ProductInformation/0,,50_2330_9863_13022,00.html">AMD Geode LX800</a> CPU has an on-chip AES 128-bit crypto accelerations block and a true random number generator. Using this block for encryption and decryption is a lot faster than software implemented algorithms and it unloads the CPU. There are two main purposes where en/decryption is needed:</p>
<ul>
<li>Storing files</li>
<li>Communication over network (IPSEC, OpenVPN, WPA2, &#8230;)</li>
</ul>
<p>I&#8217;ll focus on the first point in this article using <a href="http://en.wikipedia.org/wiki/LUKS">LUKS</a> (Linux Unified Key Setup).</p>
<p><span id="more-491"></span>To use LUKS and the crypto block, some kernel adjustments have to be made:</p>
<pre>Device Drivers  ---&gt;
   [*] Multiple devices driver support (RAID and LVM)  ---&gt;
   &lt;*&gt;   Device mapper support
   &lt;*&gt;     Crypt target support

-*- Cryptographic API  ---&gt;
   -*- Cryptographic algorithm manager
   -*- CBC support
   {*} ECB support
   {*} AES cipher algorithms
   &lt;*&gt; AES cipher algorithms (i586)
   -*-   MD5 digest algorithm
   &lt;*&gt; SHA224 and SHA256 digest algorithm
   [*] Hardware crypto devices  ---&gt;
   &lt;*&gt;   Support for the Geode LX AES engine</pre>
<p>If you want to test with and without crypto acceleration, I recommend compiling the last one as a module. After compiling and rebooting we have to install LUKE userspace tools:</p>
<pre>emerge -v cryptsetup</pre>
<p>That&#8217;s all. Now we&#8217;re ready to test. As we want to bandwidth limitation from a slow CF card or USB stick, we create a memory loopback device for testing purposes with a size of 128 MB:</p>
<pre>mkdir /tmp/tmpfs
mount -t tmpfs none /tmp/tmpfs -o size=130m
dd if=/dev/zero of=/tmp/tmpfs/test.img count=131072 bs=1024
losetup /dev/loop1 /tmp/tmpfs/test.img</pre>
<p>The tmpfs ramdisk is with intent 130MB large, as the maximum default value is 50% of RAM and with that 128 MB wouldn&#8217;t fit in.</p>
<p>At first, we want to measure software AES performance. For this, we have to assure, that the driver for the crypto block is not loaded. You can get a list of all loaded modules with</p>
<pre>lsmod</pre>
<p>If there&#8217;s geode_aes listed, remove it by</p>
<pre>rmmod geode_aes</pre>
<p>Now we can create a LUKS device by</p>
<pre>cryptsetup -y --cipher aes --key-size 128 luksFormat /dev/loop1</pre>
<p>Mind the key size of 128 bit as the Geode crypto block is only capable of 128 bit keys. You have to confirm this command with a uppercase YES and entering the passphrase twice:</p>
<pre>Are you sure? (Type uppercase yes): YES
Enter LUKS passphrase:
Verify passphrase:
Command successful.</pre>
<p>Now we can open the container. Run</p>
<pre>cryptsetup luksOpen /dev/loop1 test</pre>
<p>and enter the previous set passphrase:</p>
<pre>Enter LUKS passphrase:
key slot 0 unlocked.
Command successful.</pre>
<p>The container is now under /dev/mapper/test and we can do some write test by running dd:</p>
<pre>dd if=/dev/zero of=/dev/mapper/test bs=16384</pre>
<p>After a few seconds, dd will terminate, complaining no space left:</p>
<pre>dd: writing `/dev/mapper/test': No space left on device
8160+0 records in
8159+0 records out
133689344 bytes (134 MB) copied, 18.574 s, 7.2 MB/s</pre>
<p>That&#8217;s OK. We can read here there 7.2 MB/s throughput with crypto block. After closing the container with</p>
<pre>cryptsetup luksClose test</pre>
<p>we can load the crypto block driver by</p>
<pre>modprobe geode_aes</pre>
<p>and can run the same commands as above. We&#8217;ll get a</p>
<pre>dd: writing `/dev/mapper/test': No space left on device
8160+0 records in
8159+0 records out
133689344 bytes (134 MB) copied, 4.88397 s, 27.4 MB/s</pre>
<p>noticing that we&#8217;ve got a 27.4 MB/s throughput now! This also works with <a href="http://de.wikipedia.org/wiki/ESSIV">ESSIV</a> as well. It&#8217;s a bit slower, but more secure. You can to alter the luksFormat to use it:</p>
<pre>cryptsetup -y --cipher aes-cbc-essiv:sha256 --key-size 128 luksFormat /dev/loop1</pre>
<p>I measured 7.0 MB/s without and 24.0 MB/s with crypto block. After all testing don&#8217;t forget to remove the loopback device and umount the ramdisk:</p>
<pre>losetup  -d /dev/loop1
umount /tmp/tmpfs/
rmdir /tmp/tmpfs</pre>
<p>Now you can setup your real crypto disk. You might want to initialize your partition with random data before creating the luksContainter. <em>dd</em> is once again your friend:</p>
<pre>dd if=/dev/urandom of=/dev/XXX bs=1M</pre>
<p>Concerning the use of the crypto block for network encryption: By chance it noticed that if I use WPA2 with AES the geode_aes has a 2 in the used row of lsmod:</p>
<pre>Module                  Size  Used by
lib80211_crypt_ccmp     4808  2
ipw2200               115904  0
libipw                 22792  1 ipw2200
geode_aes               5464  2
lib80211                4568  3 lib80211_crypt_ccmp,ipw2200,libipw</pre>
<p>So it seems, like WPA2 is using this as well. If you know a method to confirm this, let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/hardware/alix/using-geodes-aes-engine-on-alix3d3/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Updating BIOS on ALIX.3D3 within Linux</title>
		<link>http://www.twam.info/linux/updating-bios-on-alix3d3-within-linux</link>
		<comments>http://www.twam.info/linux/updating-bios-on-alix3d3-within-linux#comments</comments>
		<pubDate>Wed, 06 May 2009 18:45:10 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Alix]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ALIX.3D3]]></category>
		<category><![CDATA[BIOS]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=414</guid>
		<description><![CDATA[Usually BIOS updating means booting DOS and running a proprietary tool from the board vendor. A few days ago, coreboot&#8217;s flashrom 0.9 has realeased. It&#8217;s an open-source tool which supports program almost all flash chips used on x86 mainboards. Its compatibility list includes Geode™ CS5530/A, which can be found on the ALIX.3D3 board. So why not [...]]]></description>
			<content:encoded><![CDATA[<p>Usually BIOS updating means booting <a href="http://en.wikipedia.org/wiki/MS-DOS">DOS</a> and running a proprietary tool from the board vendor. A few days ago, coreboot&#8217;s <a href="http://www.coreboot.org/Flashrom">flashrom</a> 0.9 has <a href="http://www.coreboot.org/News#2009.2F05.2F04_flashrom_0.9.0_has_been_released">realeased</a>. It&#8217;s an open-source tool which supports program almost all flash chips used on x86 mainboards. Its compatibility list includes Geode™ CS5530/A, which can be found on the ALIX.3D3 board. So why not using flashrom to update ALIX.3D3 BIOS.</p>
<p><span id="more-414"></span>Sadly there is no ebuild for flashrom in portage, so Gentoo users (and maybe some other) have to build it on there own, but it&#8217;s quite easy. You need to install <a href="http://subversion.tigris.org/">subversion</a>, an open-source revision control system, first:</p>
<p>emerge -va subversion</p>
<p>As there is no portage package for flashrom, we need to install it somewhere. I installed it in /root/flashrom so it can be removed easily. You can achieve this by</p>
<pre>cd root
svn co svn://coreboot.org/flashrom/trunk flashrom
cd flashrom
make</pre>
<p>You can do an optional</p>
<pre>make install</pre>
<p>to install the binaries in /usr/local/sbin and install the man page. Now we should save our old BIOS. Running</p>
<pre>flashrom -r /root/bios_save.bin</pre>
<p>should display some info on the found chipset and flash chip:</p>
<pre>Calibrating delay loop... OK.
No coreboot table found.
Found chipset "AMD CS5536", enabling flash write... OK.
Found chip "AMIC A49LF040A" (512 KB) at physical address 0xfff80000.
Reading flash... done.</pre>
<p>If you have an image of the old installed BIOS you can check, if everything went right, by</p>
<pre>diff /root/bios_save.bin /root/bios_old.bin</pre>
<p>where /root/bios_old.bin is the old BIOS version, preferable found on the manufacturer&#8217;s website. Now we can update the BIOS. Download the new BIOS version (ALIX.3D3 can be found <a href="http://www.pcengines.ch/alix3d3.htm">here</a>) and run:</p>
<pre>flashrom -wv /root/bios_new.bin</pre>
<p>flashrom should print some information, a process status and after all a VERIFIED, if everything went right:</p>
<pre>Calibrating delay loop... OK.
No coreboot table found.
Found chipset "AMD CS5536", enabling flash write... OK.
Found chip "AMIC A49LF040A" (512 KB) at physical address 0xfff80000.
Flash image seems to be a legacy BIOS. Disabling checks.
Programming page: 0007 at address: 0x00070000
Verifying flash... VERIFIED.</pre>
<p>Now your BIOS should be updated. It&#8217;s time to plug (power) and pray.</p>
<p><strong>Update</strong>: After writing a <a href="http://bugs.gentoo.org/show_bug.cgi?id=268790">Gentoo Bug report</a>, there is now an <a href="http://packages.gentoo.org/package/sys-apps/flashrom">ebuild</a> in portage. You can install it by</p>
<pre>emerge -va flashrom</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/linux/updating-bios-on-alix3d3-within-linux/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Ethernet bonding with Linux and 802.3ad</title>
		<link>http://www.twam.info/linux/ethernet-bonding-with-linux-and-8023ad</link>
		<comments>http://www.twam.info/linux/ethernet-bonding-with-linux-and-8023ad#comments</comments>
		<pubDate>Wed, 06 May 2009 16:04:30 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network/Web]]></category>
		<category><![CDATA[Switch]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=402</guid>
		<description><![CDATA[Nowadays, most desktop mainboards provide more than one gigabit ethernet port. Connecting them both to the same switch causes most Linux distros by default to get a individual IP on each device and route traffic only on the primary device (based on device metric) or round-robin. A single connection always starts at one IP and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.twam.info/wp-content/uploads/2009/05/2nic_switch.png"><img class="alignright size-full wp-image-412" title="2 NIC + Switch" src="http://www.twam.info/wp-content/uploads/2009/05/2nic_switch.png" alt="2 NIC + Switch" width="117" height="87" /></a>Nowadays, most desktop mainboards provide more than one gigabit ethernet port. Connecting them both to the same switch causes most Linux distros by default to get a individual IP on each device and route traffic only on the primary device (based on device metric) or round-robin. A single connection always starts at one IP and so all traffic goes through one device, limiting maximum bandwidth to 1 GBit.</p>
<p>Here comes bonding (sometimes called (port) trunking or link aggregation) to play. It connects two ore more ethernet ports to one virtual port with only one MAC and so mostly one IP address. Wheres earlier only two hosts (with the same OS running) or two switches (from the same vendor) could be connected, nowadays there&#8217;s a standard protocol which makes it easy: <a href="http://en.wikipedia.org/wiki/Link_Aggregation_Control_Protocol#Link_Aggregation_Control_Protocol">LACP</a> which is part of <a href="http://en.wikipedia.org/wiki/802.3ad">IEEE 802.3ad</a>. <span id="more-402"></span>Linux supports difference bonding mechanisms including 802.3ad. To enable bonding at all there are some kernel settings needed:</p>
<pre>Device Drivers  ---&gt;
[*] Network device support  ---&gt;
&lt;*&gt;   Bonding driver support</pre>
<p>After compiling and rebooting, we need a userspace tool for configuring the virtual interface. It&#8217;s called ifenslave and provided with the Linux kernel. You can either compile it by hand</p>
<pre>/usr/src/linux/Documentation/networking
gcc -Wall -O -I/usr/src/linux/include ifenslave.c -o ifenslave
cp ifenslave /sbin/ifenslave</pre>
<p>or install it by emerge if you run <a href="http://www.gentoo.org">Gentoo Linux</a>:</p>
<pre>emerge -va ifenslave</pre>
<p>Now we can configure the bonding device, called bond0. Firstofall we need to set the 802.3ad mode and the MII link monitoring frequency by</p>
<pre>echo "802.3ad" &gt; /sys/class/net/bond0/bonding/mode
echo 100 &gt;/sys/class/net/bond0/bonding/miimon</pre>
<p>Now we can up the device and add some ethernet ports:</p>
<pre>ifconfig bond0 up
ifenslave bond0 eth0
ifenslave bond0 eth1</pre>
<p>Now bond0 is ready to be used. Run a dhcp client or set an IP by</p>
<pre>ifconfig bond0 192.168.1.2 netmask 255.255.255.0</pre>
<p>These steps are needed on each reboot. If you&#8217;re running gentoo, you can use baselayout for this. Add</p>
<pre>config_eth0=( "none" )
config_eth1=( "none" )
preup() {
	# Adjusting the bonding mode / MII monitor
	# Possible modes are : 0, 1, 2, 3, 4, 5, 6,
	#     OR
	#   balance-rr, active-backup, balance-xor, broadcast,
	#   802.3ad, balance-tlb, balance-alb
	# MII monitor time interval typically: 100 milliseconds
	if [[ ${IFACE} == "bond0" ]] ; then
		BOND_MODE="802.3ad"
		BOND_MIIMON="100"
		echo ${BOND_MODE} &gt;/sys/class/net/bond0/bonding/mode
		echo ${BOND_MIIMON}  &gt;/sys/class/net/bond0/bonding/miimon
		einfo "Bonding mode is set to ${BOND_MODE} on ${IFACE}"
		einfo "MII monitor interval is set to ${BOND_MIIMON} ms on ${IFACE}"
	else
		einfo "Doing nothing on ${IFACE}"
	fi
	return 0
}
slaves_bond0="eth0 eth1"
config_bond0=( "dhcp" )</pre>
<p>to your /etc/conf.d/net. I found this nice preup part in the <a href="http://www.gentoo-wiki.info/HOWTO_Setup_Bonded_ethernet_adapters">Gentoo Wiki Archive</a>.</p>
<p>Now you have to configure the other side of the link. You can either use a Linux box and configure it the same way or a 802.3ad-capable switch. I used an <a href="http://www.hp.com/rnd/products/switches/HP_ProCurve_Switch_1800_Series/overview.htm">HP Procurve 1800-24G</a> switch. You have to enable <a href="http://en.wikipedia.org/wiki/Link_Aggregation_Control_Protocol#Link_Aggregation_Control_Protocol">LACP</a> on the ports you&#8217;re connected:</p>
<p style="text-align: left;">
<div id="attachment_403" class="wp-caption aligncenter" style="width: 220px"><a href="http://www.twam.info/wp-content/uploads/2009/05/hp1800_lacp.png"><img class="size-medium wp-image-403" title="HP Procurve 1800-24G LACP Configuration" src="http://www.twam.info/wp-content/uploads/2009/05/hp1800_lacp-210x143.png" alt="HP Procurve 1800-24G LACP Configuration" width="210" height="143" /></a><p class="wp-caption-text">HP Procurve 1800-24G LACP Configuration</p></div>
<p>Now everything should work and you can enjoy a 2 GBits (or more) link. Further details can be found in the <a href="http://www.linuxfoundation.org/en/Net:Bonding">kernel documentation</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/linux/ethernet-bonding-with-linux-and-8023ad/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Changing scheduling parameters in Linux</title>
		<link>http://www.twam.info/linux/changing-scheduling-parameters-in-linux</link>
		<comments>http://www.twam.info/linux/changing-scheduling-parameters-in-linux#comments</comments>
		<pubDate>Mon, 04 May 2009 11:36:05 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Scheduling]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=369</guid>
		<description><![CDATA[Process scheduling within Linux is done by the kernel, following different aspects. Usually it&#8217;s goal is to share all resources fairly among all running processes. Sometimes, there&#8217;s a need to tell the kernel explicitly to prior some process, bind some process to a special CPU and so on. Changing process priorities is commonly known: nice [...]]]></description>
			<content:encoded><![CDATA[<p>Process scheduling within Linux is done by the kernel, following different aspects. Usually it&#8217;s goal is to share all resources fairly among all running processes.</p>
<p>Sometimes, there&#8217;s a need to tell the kernel explicitly to prior some process, bind some process to a special CPU and so on.</p>
<p>Changing process priorities is commonly known:</p>
<pre>nice -n 10 make</pre>
<p>runs the program make with a priority of 10 (-20 meaning most favorable and 19 least favorable scheduling). If you want to change a priority of a running program, <em>renice</em> is your choice.<span id="more-369"></span></p>
<h3>schedtool</h3>
<p>Nowadays multiprocessor machines get more and more in common. So it&#8217;s sometimes desirable to bind a process to one or more CPUs. This is done by <a href="http://freequaos.host.sk/schedtool"><em>schedtool</em></a>, which is not part of common distros. You can install it on Gentoo by</p>
<pre>emerge -va schedtool</pre>
<p><em>schedtool</em> allows you to view, and change the process CPU affinity. Try</p>
<pre>schedtool PID</pre>
<p>where PID is the process ID. For example, process 6702 of my system shows:</p>
<pre>PID  6702: PRIO   0, POLICY N: SCHED_NORMAL  , NICE   0, AFFINITY 0x3</pre>
<p>meaning it&#8217;s CPU affinity mask is 0&#215;03. Each bit of the affinity mask corresponds to a CPU in the system and a bit value of 1 meaning this CPU is allowed to use. So, 0&#215;03 = 0b00000011 means that CPU0 and CPU1 are allowed to use. You can change the CPU affinity by</p>
<pre>schedtool -a AFFINITY_MASK PID</pre>
<p>where PID is the process ID and AFFINITY_MASK the affinity mask (must be in hexadecimal) or a list of (decimal) comma separated CPU numbers. Be careful not to use affinity 0&#215;00 especially on viral processes. <img src='http://www.twam.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><em>schedtool</em> also allows the change of schedule policy for a single job. This is useful e.g. for long-running non-interactive jobs. You can enable the SCHED_BATCH policy for them by</p>
<pre>schedtool -B PID</pre>
<p>where PID is the process ID. Notice that you need a least kernel 2.6.16 for SCHED_BATCH support. There are different schedule policies for Real Time or Idle applications. See <a href="http://linux.die.net/man/8/schedtool">man schedtool</a> for detailed information.</p>
<h3>taskset</h3>
<p>Another program for setting process&#8217;s CPU affinity is <em>taskset</em>. It&#8217;s included in <a href="http://www.kernel.org/pub/linux/utils/util-linux-ng/">util-linux-ng</a>, which is part of most common distros. taskset is only capable of changing/viewing CPU affinity, not priorities or scheduling policies.</p>
<p>To view a process CPU affinity try</p>
<pre>taskset -p PID</pre>
<p>where PID is the process ID. For the same process as above my systems shows:</p>
<pre>pid 6702's current affinity mask: 3</pre>
<p>You can change CPU affinity easily by</p>
<pre>taskset -p AFFINITY_MASK PID</pre>
<p>where PID is the process ID and AFFINITY_MASK the affinity mask. If you wish the use a command seperated CPU list you have to</p>
<pre>taskset -c -p CPU_LIST PID</pre>
<p>where PID is the process ID and CPU_LIST the CPU list like 1,3,4-6.</p>
<p>Unlike schedtool taskset is capable of starting programs with a specific CPU affinity mask by</p>
<pre>taskset AFFINITY_MASK COMMAND</pre>
<p>where AFFINITY_MASK is the affinity mask and COMMAND and command to execute. Seed <a href="http://linux.die.net/man/1/taskset">man taskset</a> for detailed information.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/linux/changing-scheduling-parameters-in-linux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sound on ALIX.3D3</title>
		<link>http://www.twam.info/hardware/alix/sound-on-alix3d3</link>
		<comments>http://www.twam.info/hardware/alix/sound-on-alix3d3#comments</comments>
		<pubDate>Sat, 02 May 2009 14:10:18 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Alix]]></category>
		<category><![CDATA[ALIX.3D3]]></category>
		<category><![CDATA[ALSA]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sound]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=346</guid>
		<description><![CDATA[The AMD CS5536 Geode on the ALIX.3D3 board has an included audio controller which headset output and microphone input is populated on the board. lspci lists the audio controller as 00:0f.3 Multimedia audio controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] Audio (rev 01) ALSA (Advanced Linux Sound Architecture) supports this chip. To use audio [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.amd.com/us-en/ConnectivitySolutions/ProductInformation/0,,50_2330_9863_13022,00.html">AMD CS5536</a> Geode on the ALIX.3D3 board has an included audio controller which headset output and microphone input is populated on the board. <em>lspci</em> lists the audio controller as</p>
<pre>00:0f.3 Multimedia audio controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] Audio (rev 01)</pre>
<p><a href="http://www.alsa-project.org/">ALSA</a> (Advanced Linux Sound Architecture) supports this chip. <span id="more-346"></span>To use audio on the board, some adjustments to kernel are needed:</p>
<pre>Device Drivers  ---&gt;
   &lt;*&gt; Sound card support  ---&gt;
      &lt;*&gt;   Advanced Linux Sound Architecture  ---&gt;
         [*]   Dynamic device file minor numbers
         [*]   PCI sound devices  ---&gt;
            &lt;*&gt;   CS5535/CS5536 Audio</pre>
<p>After compiling and installing the kernel, we need to install ALSA userspace tools:</p>
<pre>emerge -va alsa-headers alsa-lib alsa-utils</pre>
<p>After rebooting the kernel should recognize the sound device:</p>
<pre>[    2.830979] cs5535audio 0000:00:0f.3: PCI INT B -&gt; Link[LNKB] -&gt; GSI 11 (level, low) -&gt; IRQ 11
[    2.842814] cs5535audio 0000:00:0f.3: setting latency timer to 64
[    2.850457] ALSA device list:
[    2.863735]   #0: CS5535 Audio cs5535audio at 0xfe00, irq 11</pre>
<p>Now it&#8217;s time to setup the audio channels. Run</p>
<pre>alsamixer</pre>
<p>unmute and pull up the Headphone and PCM faders. Unmute &#8220;Mic Boost&#8221; and change to the Capture View and pull up Capture there. It should look like</p>
<p><a href="http://www.twam.info/wp-content/uploads/2009/05/playback.png"><img class="size-medium wp-image-352" title="alsamixer: Playback" src="http://www.twam.info/wp-content/uploads/2009/05/playback-300x184.png" alt="alsamixer: Playback" width="210" height="129" /></a> <a href="http://www.twam.info/wp-content/uploads/2009/05/capture.png"><img class="size-medium wp-image-348" title="alsamixer: Capture" src="http://www.twam.info/wp-content/uploads/2009/05/capture-300x184.png" alt="alsamixer: Capture" width="210" height="129" /></a></p>
<p>You can navigate with the left/right keys, change the volume with the up/down keys, mute/unmute with M, change between Playback/Capture/All with TAB and quit with ESC.</p>
<div id="attachment_355" class="wp-caption alignright" style="width: 196px"><a href="http://www.twam.info/wp-content/uploads/2009/05/headphone_microphone.jpg"><img class="size-medium wp-image-355" title="J12/J13 on ALIX.3D3" src="http://www.twam.info/wp-content/uploads/2009/05/headphone_microphone-266x300.jpg" alt="J12/J13 on ALIX.3D3" width="186" height="210" /></a><p class="wp-caption-text">J12/J13 on ALIX.3D3</p></div>
<p>Now connect a headphone oder speakers to J12 (headphone output) and run</p>
<pre>speaker-test -twav -c2</pre>
<p>You should hear a female voice saying &#8220;front left&#8221; and &#8220;front right&#8221; on the corresponding channel. Cancel the test with Control+C. Now connect a microphone to J13 (microphone input) and run</p>
<pre>arecord -d 5 -f cd -t wav /tmp/mic-test.wav</pre>
<p>You have 5 seconds to make some noise. Afterwards run</p>
<pre>aplay /tmp/mic-test.wav</pre>
<p>and you should hear the previous made noise. Finally do</p>
<pre>rc-update add alsasound boot</pre>
<p>so that ALSA can save/restore your settings on reboot.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/hardware/alix/sound-on-alix3d3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Framebuffer on ALIX.3D3</title>
		<link>http://www.twam.info/hardware/alix/framebuffer-on-alix3d3</link>
		<comments>http://www.twam.info/hardware/alix/framebuffer-on-alix3d3#comments</comments>
		<pubDate>Sat, 02 May 2009 11:11:47 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Alix]]></category>
		<category><![CDATA[ALIX.3D3]]></category>
		<category><![CDATA[Framebuffer]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=332</guid>
		<description><![CDATA[In contrary to most ALIX devices, the ALIX.3D3 has an integrated VGA controller and an Award BIOS (tinyBIOS doesn&#8217;t support VGA), so why not attach a monitor. Standard text mode is supported by default (and faster than graphical mode), but if you wish to change resolution, add a boot logo or even want to use [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_338" class="wp-caption alignright" style="width: 220px"><a href="http://www.twam.info/wp-content/uploads/2009/05/cute_tux.png"><img class="size-medium wp-image-338" title="ALIX.3D3 booting" src="http://www.twam.info/wp-content/uploads/2009/05/cute_tux-300x240.png" alt="ALIX.3D3 booting" width="210" height="168" /></a><p class="wp-caption-text">ALIX.3D3 booting</p></div>
<p>In contrary to most ALIX devices, the ALIX.3D3 has an integrated VGA controller and an Award BIOS (tinyBIOS doesn&#8217;t support VGA), so why not attach a monitor.</p>
<p>Standard text mode is supported by default (and faster than graphical mode), but if you wish to change resolution, add a boot logo or even want to use a graphical boot screen like splashutils a framebuffer device is needed.</p>
<p><em>lspci</em> lists the integrated VGA controller of the <a onclick="javascript:pageTracker._trackPageview('/outbound/article/www.amd.com');" href="http://www.amd.com/us-en/ConnectivitySolutions/ProductInformation/0,,50_2330_9863_13022,00.html">AMD Geode LX800</a> CPU as the video device:</p>
<pre>00:01.1 VGA compatible controller: Advanced Micro Devices [AMD] Geode LX Video</pre>
<p>Luckily the linux kernel supports this device directly and so no VESA framebuffer is needed. <span id="more-332"></span>To support it, you have to select some options in the kernel config:</p>
<pre>Device Drivers  ---&gt;
   Graphics support  ---&gt;
      &lt;*&gt; Support for frame buffer devices  ---&gt;
         [*]   AMD Geode family framebuffer support (EXPERIMENTAL)
         &lt;*&gt;     AMD Geode LX framebuffer support (EXPERIMENTAL)
      Console display driver support  ---&gt;
         -*- VGA text console
         [*]   Enable Scrollback Buffer in System RAM
         (64)    Scrollback Buffer Size (in KB)
         &lt;*&gt; Framebuffer Console support</pre>
<p>If you like to have to linux boot logo as well, you should add some points in addition:</p>
<pre>Device Drivers  ---&gt;
   Graphics support  ---&gt;
      [*] Bootup logo  ---&gt;
         --- Bootup logo
         [*]   Standard 224-color Linux logo</pre>
<p>After compiling and installing the kernel, we have to tell him with resolution we prefer. You have to add something like</p>
<pre>lxfb.mode_option=1280x1024@60</pre>
<p>to you kernel boot line. If you use <a href="http://www.gnu.org/software/grub/">GRUB</a> as your bootloader just append it to the kernel line in /boot/grub/menu.lst.</p>
<p>Before rebooting you should install framebuffer userspace tools. There&#8217;s a ebuild for them, so just try</p>
<pre>emerge -va fbset</pre>
<p>Now you can reboot. After rebooting resolution should have changed. You can controll settings with fbset tool. It should printout something like</p>
<pre>mode "1280x1024-60"
    # D: 107.968 MHz, H: 63.962 kHz, V: 60.002 Hz
    geometry 1280 1024 1280 1024 16
    timings 9262 248 48 38 1 112 3
    rgba 5/11,6/5,5/0,0/0
endmode</pre>
<p>You can change modes with this tool if you added your mode to /etc/fb.modes. This file is empty on default, but there are examples in /usr/share/doc/fbset-2.1/. I copied fb.modes.ATI to /etc/fb.modes and tested some modes, which were running fine.</p>
<p>If you want to make some screenshots from your framebuffer, I recommend installing fbgrab by</p>
<pre>emerge -va fbgrab</pre>
<p>Now you scan make some nice shots with</p>
<pre>fbgrab /tmp/cute_tux.png</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/hardware/alix/framebuffer-on-alix3d3/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing Gentoo on ALIX.3D3</title>
		<link>http://www.twam.info/linux/gentoo/installing-gentoo-on-alix3d3</link>
		<comments>http://www.twam.info/linux/gentoo/installing-gentoo-on-alix3d3#comments</comments>
		<pubDate>Fri, 01 May 2009 14:54:09 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Alix]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[ALIX.3D3]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=321</guid>
		<description><![CDATA[When I ordered the ALIX.3D3 board I thought installing Gentoo on this should be a piece of cake, but finally there were some stumbling blocks and that&#8217;s why I want to summarize how I got gentoo running. First of all, I recommend installing Gentoo on a normal desktop to get to know the installing process, [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Gentoo Logo" src="http://www.gentoo.org/images/glogo-small.png" alt="" width="146" height="149" />When I ordered the ALIX.3D3 board I thought installing <a href="http://www.gentoo.org/">Gentoo</a> on this should be a piece of cake, but finally there were some <span class="hw">stumbling blocks and that&#8217;s why I want to summarize how I got gentoo running.</span></p>
<p>First of all, I recommend installing Gentoo on a normal desktop to get to know the installing process, which is a bit different from graphical installers of mainstream distros. The <a href="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml">Gentoo Handbook</a> is a great documentation how this done.</p>
<p>To install gentoo, you have to boot a minimal or &#8220;rescue&#8221; linux usually from cd/dvd. I tried to convice the bios to boot from a usb cd-rom drive, but I hadn&#8217;t any success.<span id="more-321"></span></p>
<p>So I had to prepare a USB stick to boot from. There&#8217;s a nice tool <a href="http://unetbootin.sourceforge.net/">UNetbootin</a> which automatically copies ISO images to a usbstick and makes it bootable. I tried a lot with the Linux version of it but didn&#8217;t had any success regardless of which ISO image or USB stick I took. So I booted windows and tried it with this version. I had success on the first attempt, using the install-x86-minimal.iso from Gentoo and a 3 EUR SD-card Reader with a 4 GB SDHC card in it, formatted as FAT32 as the only partition (not in superfloppy mode).</p>
<p>If you&#8217;ve got a booting usb stick, insert it into a USB plug of the board, attach a USB keyboard and a monitor to the VGA port. Power on and press escape to select the boot menu. There should be an option for the usb stick if everything went fine.</p>
<p>Now the gentoo minimal system should boot and you can proceed with the usual installing (look into <a href="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml">Gentoo Handbook</a> for details). The AMD Geode LX800 cpu is a i586 cpu, so you have to install a i386, i486 oder i586 stage (i686 or amd64 won&#8217;t work!). I installed a i486 stage 3 and updated later to i586.</p>
<p>Partitioning should follow your preferences but don&#8217;t a forget a swap partition. 256 MB of RAM is not that much and gcc will not compile without!</p>
<p>I took</p>
<pre>CFLAGS="-O2 -march=i486 -pipe"</pre>
<p>for installation as the gcc version on the stage3 archive don&#8217;t support the geode march.</p>
<p>The rest of the installation is business as usual. I installed gentoo-sources for a optimized kernel and took this configuration here: <a href="http://www.twam.info/wp-content/uploads/2009/05/config">ALIX.3D3 kernel-2.6.29-r2 config</a></p>
<p>After finishing installation and booting with the new kernel, it&#8217;s time to update the systems to i586. For this, at first update all packages to actual version, especially gcc to version 4.3. Afterwards it&#8217;s save to change</p>
<pre>CFLAGS="-march=geode -Os -fno-align-jumps -fno-align-functions -fno-align-labels -fno-align-loops -pipe -fomit-frame-pointer"</pre>
<p>and proceed with changing of the CHOST variable. There&#8217;s a nice tutorial here: <a href="http://www.gentoo.org/doc/en/change-chost.xml">Changing CHOST</a>.</p>
<p>Now you should have a nice and optimized gentoo on your ALIX.3D3</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/linux/gentoo/installing-gentoo-on-alix3d3/feed</wfw:commentRss>
		<slash:comments>51</slash:comments>
		</item>
		<item>
		<title>Temperature sensor on ALIX.3D3</title>
		<link>http://www.twam.info/hardware/alix/temperature-sensor-on-alix3d3</link>
		<comments>http://www.twam.info/hardware/alix/temperature-sensor-on-alix3d3#comments</comments>
		<pubDate>Thu, 30 Apr 2009 13:35:57 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Alix]]></category>
		<category><![CDATA[ALIX.3D3]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sensor]]></category>
		<category><![CDATA[Temperature]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=308</guid>
		<description><![CDATA[The schematics of the ALIX.3D3 mention a temperature sensors LM86 on page 2 which external sensors pins are connected to the TDP/TDN pins of the Geode LX800 CPU. So this sensor should be able to measure CPU and mainboard temperature. The LM86 ist connected by the SMBus (which is compatible to I²C if bus speed [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_313" class="wp-caption alignright" style="width: 220px"><a href="http://www.twam.info/wp-content/uploads/2009/04/lm86.jpg"><img class="size-medium wp-image-313" title="LM86 on ALIX.3D3" src="http://www.twam.info/wp-content/uploads/2009/04/lm86-300x228.jpg" alt="LM86 on ALIX.3D3" width="210" height="160" /></a><p class="wp-caption-text">LM86 on ALIX.3D3</p></div>
<p>The <a href="http://www.alix-box.info/wiki/images/Alix3c.pdf">schematics</a> of the ALIX.3D3 mention a temperature sensors <a href="http://www.national.com/mpf/LM/LM86.html">LM86</a> on page 2 which external sensors pins are connected to the TDP/TDN pins of the Geode LX800 CPU. So this sensor should be able to measure CPU and mainboard temperature.</p>
<p>The LM86 ist connected by the <a href="http://www.smbus.org/">SMBus</a> (which is compatible to <a href="http://de.wikipedia.org/wiki/I%C2%B2C">I²C</a> if bus speed is below 100kHz, see <a href="http://www.maxim-ic.com/appnotes.cfm/appnote_number/476">Maxim&#8217;s Appnote</a> for detailed comparison) via the <a href="http://www.amd.com/us-en/ConnectivitySolutions/ProductInformation/0,,50_2330_9863_13022,00.html">AMD CS5536</a> Geode companion.<span id="more-308"></span></p>
<p>To support the temperature sensor by the linux kernel, several options must be set:</p>
<pre>Device Drivers  ---&gt;
&lt;*&gt; I2C support  ---&gt;
&lt;*&gt;   I2C device interface
      I2C Hardware Bus support  ---&gt;
      &lt;*&gt; Geode ACCESS.bus support
&lt;*&gt; Hardware Monitoring support  ---&gt;
&lt;*&gt;   National Semiconductor LM90 and compatibles</pre>
<p>After compiling and booting the kernel, we need some userspace tools to read information by the temperatur sensor. Usually this is done by <a href="http://www.lm-sensors.org/">Lm_sensors</a>. Gentoo provides ebuilds so you should be fine with</p>
<pre>emerge -va lm_sensors</pre>
<p>After emerging, you should run</p>
<pre>sensors-detect</pre>
<p>to search for sensors. The program will ask you some question on which devices it should scan for sensors and which modules should be loaded. If you compiled everything into kernel (not into modules) you should be fine with</p>
<pre>We can start with probing for (PCI) I2C or SMBus adapters.
Do you want to probe now? (YES/no): YES
Probing for PCI bus adapters...
Use driver `scx200_acb' for device 0000:00:0f.0: CS5536 [Geode companion] ISA

We will now try to load each adapter module in turn.
Load `scx200_acb' (say NO if built into your kernel)? (YES/no): no
If you have undetectable or unsupported I2C/SMBus adapters, you can have
them scanned by manually loading the modules before running this script.

We are now going to do the I2C/SMBus adapter probings. Some chips may
be double detected; we choose the one with the highest confidence
value in that case.
If you found that the adapter hung after probing a certain address,
you can specify that address to remain unprobed.

Next adapter: CS5536 ACB0 (i2c-0)
Do you want to scan it? (YES/no/selectively): YES
Client found at address 0x4c
Handled by driver `lm90' (already loaded), chip type `lm86'

Some chips are also accessible through the ISA I/O ports. We have to
write to arbitrary I/O ports to probe them. This is usually safe though.
Yes, you do have ISA I/O ports even if you do not have any ISA slots!
Do you want to scan the ISA I/O ports? (YES/no): no

Some Super I/O chips may also contain sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no): no

Some south bridges, CPUs or memory controllers may also contain
embedded sensors. Do you want to scan for them? (YES/no): no</pre>
<p>After answering all questions, sensor-detect should be able to find your sensor</p>
<pre>Driver `lm90' (should be inserted):
  Detects correctly:
  * Bus `CS5536 ACB0'
    Busdriver `UNKNOWN', I2C address 0x4c
    Chip `lm86' (confidence: 6)</pre>
<p>sensors-detect will ask to save config (say YES) and propose some to commands to be executed, but we don&#8217;t care, because we compiled everything direct into kernel.</p>
<p>Now sould be able to run <em>sensors</em> and get temperatures:</p>
<pre>lm86-i2c-0-4c
Adapter: CS5536 ACB0
M/B Temp:    +47 C  (low  =    +0 C, high =   +70 C)
CPU Temp:  +56.8 C  (low  =  +0.0 C, high = +70.0 C)
M/B Crit:    +85 C  (hyst =   +75 C)
CPU Crit:    +85 C  (hyst =   +75 C)</pre>
<p>If everthing&#8217;s fine, you can add lm_sensors to default runlevel with</p>
<pre>rc-update add lm_sensors default</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/hardware/alix/temperature-sensor-on-alix3d3/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Watchdog on ALIX.3D3</title>
		<link>http://www.twam.info/hardware/alix/watchdog-on-alix3d3</link>
		<comments>http://www.twam.info/hardware/alix/watchdog-on-alix3d3#comments</comments>
		<pubDate>Tue, 28 Apr 2009 15:09:13 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Alix]]></category>
		<category><![CDATA[ALIX.3D3]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Watchdog]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=291</guid>
		<description><![CDATA[The AMD CS5536 Geode companion on the ALIX.3D3 board has an internal watchdog, beeing able to reboot the system by itself if it&#8217;s hangup. To use this watchdog device, kernel support is needed. In kernel 2.6.29 you have to enable   Device Drivers  ---&#62;     [*] Watchdog Timer Support  ---&#62;       [*]   Disable watchdog shutdown [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.amd.com/us-en/ConnectivitySolutions/ProductInformation/0,,50_2330_9863_13022,00.html">AMD CS5536</a> Geode companion on the ALIX.3D3 board has an internal watchdog, beeing able to reboot the system by itself if it&#8217;s hangup. To use this watchdog device, kernel support is needed. In kernel 2.6.29 you have to enable</p>
<pre>  Device Drivers  ---&gt;
    [*] Watchdog Timer Support  ---&gt;
      [*]   Disable watchdog shutdown on close
      &lt;*&gt;   AMD Geode CS5535/CS5536 Watchdog</pre>
<p>for beeing able to use the watchdog timer. The <em>Disable watchdog shutdown on close</em> is optional. Usually if the watchdog program terminates it tell&#8217;s the kernel to disable the watchdog and the kernel does. With this option you can prevent the kernel from disabling the watchdog.<span id="more-291"></span></p>
<p>After compiling the kernel and rebooting you have to install a software to tell the watchdog everything&#8217;s fine. You can install it by</p>
<pre>emerge -va watchdog</pre>
<p>Afterwards you have to enable the hardware watchdog and enable realtime priority in the config file /etc/watchdog.conf</p>
<pre>watchdog-device = /dev/watchdog
realtime        = yes
priority        = 1</pre>
<p>Now you can start the program by</p>
<pre>/etc/init.d/watchdog start</pre>
<p>It now sends about every 10 seconds a ping to the watchdog device, claiming everything&#8217;s fine. <img src='http://www.twam.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  You can configure the program to watch files, network, system load as well, but that&#8217;s optional.</p>
<p>Finally do a</p>
<pre>rc-update add watchdog boot</pre>
<p>to start the program on each boot.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/hardware/alix/watchdog-on-alix3d3/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>wget and IPv6</title>
		<link>http://www.twam.info/software/wget-and-ipv6</link>
		<comments>http://www.twam.info/software/wget-and-ipv6#comments</comments>
		<pubDate>Sat, 04 Apr 2009 22:34:10 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Network/Web]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Portage]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=226</guid>
		<description><![CDATA[wget is THE standard Linux tool to download files via http(s) or ftp on console and of course Gentoo&#8217;s emerge is using wget as well. But wget prefers IPv4 over IPv6, meaning if your download mirror supports IPv6, wget doesn&#8217;t use it by default. You can change this behavior by setting prefer-family = IPv6 either [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gnu.org/software/wget/">wget</a> is THE standard Linux tool to download files via http(s) or ftp on console and of course Gentoo&#8217;s emerge is using wget as well.</p>
<p>But wget prefers IPv4 over IPv6, meaning if your download mirror supports IPv6, wget doesn&#8217;t use it by default. You can change this behavior by setting</p>
<pre>prefer-family = IPv6</pre>
<p>either in /etc/wgetrc for everybody or in $HOME/.wgetrc for a user only. </p>
<p>So enable it and tell portage to use an IPv6 enabled mirror, by setting GENTOO_MIRROR in /etc/make.conf. You&#8217;ll find a list of IPv6 capable mirrors on <a href="http://www.gentoo.org/main/en/mirrors2.xml">gentoo.org</a> (look for mirrors marked with *).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/software/wget-and-ipv6/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kernel 2.6.29: Kernel Mode Setting with Intel GM965</title>
		<link>http://www.twam.info/linux/gentoo/kernel-mode-setting-with-intel-gm965</link>
		<comments>http://www.twam.info/linux/gentoo/kernel-mode-setting-with-intel-gm965#comments</comments>
		<pubDate>Sat, 04 Apr 2009 15:53:06 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=221</guid>
		<description><![CDATA[Kernel 2.6.29 introduced the Kernel Mode Setting feature, meaning the kernel to be able to change resolution and adresse other outputs. For example kernels pre 2.6.29 always actived the external DVI device (if connected) on my macbook and showed boot screens there. This is now configurable. Also switching between X11 and console is much faster. [...]]]></description>
			<content:encoded><![CDATA[<p>Kernel 2.6.29 introduced the Kernel Mode Setting feature, meaning the kernel to be able to change resolution and adresse other outputs. For example kernels pre 2.6.29 always actived the external DVI device (if connected) on my macbook and showed boot screens there. This is now configurable. Also switching between X11 and console is much faster. <span id="more-221"></span></p>
<p>To get KMS running on my macbook, I installed the 2.6.29 with the following settings</p>
<pre>  Device Drivers  ---&gt;
    Graphics support  ---&gt;
      &lt;*&gt; Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)  ---&gt;
        &lt;*&gt;   Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver)  ---&gt;
          i915 driver
          [ ]    Enable modesetting on intel by default</pre>
<p>You don&#8217;t have to enable KMS by default. It&#8217;s possible to do this via i915.modeset=1 as a boot option.</p>
<p>After booting the kernel, drm should have detected your outputs and load inteldrmfb</p>
<pre>[    1.905481] [drm] TV-15: set mode NTSC 480i 0
[    2.021462] allocated 1280x800 fb: 0x00fdf000, bo ffff88013eaf2900
[    2.094941] [drm] LVDS-8: set mode 1280x800 17
[    2.191879] Console: switching to colour frame buffer device 160x50
[    2.195013] fb0: inteldrmfb frame buffer device
[    2.195038] registered panic notifier
[    2.195059] [drm] Initialized i915 1.6.0 20080730 on minor 0</pre>
<p>To use KMS within X11, I had to update the latest xorg-server, x11-libs and xf86-video-intel from the x11-overlay. In /etc/X11/xorgs.conf must</p>
<pre>        Option          "AccelMethod"   "UXA"</pre>
<p>set in the intel driver section.</p>
<p>Notice that output names may have changed, if you use a multimonitor setup oder xrandr. I had VGA,TV,LVDS,TMDS-1 prior to 2.6.29 and now it&#8217;s VGA1,TV1,LVDS1,DVI1.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/linux/gentoo/kernel-mode-setting-with-intel-gm965/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IPv6 @ Home</title>
		<link>http://www.twam.info/linux/gentoo/ipv6-home</link>
		<comments>http://www.twam.info/linux/gentoo/ipv6-home#comments</comments>
		<pubDate>Tue, 31 Mar 2009 19:13:53 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Network/Web]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[SiXXs]]></category>

		<guid isPermaLink="false">http://www.twam.info/?p=150</guid>
		<description><![CDATA[Via SiXXs können auch Privatpersonen ohne natives IPv6 Internet Zugang zum &#8220;neuen&#8221; Netz erhalten. Registriert man sich auf der Seite kann ein IPv6 Tunnel unter anderem via AYIYA realisiert werden, welches sogar NAT unterstützt und somit auf fast allen PC funktionieren sollte. Das Programm AICCU initialisiert die Tunnel und benötigt als Konfiguration lediglich SiXXs-Benutzername und [...]]]></description>
			<content:encoded><![CDATA[<p>Via <a href="http://www.sixxs.net/">SiXXs</a> können auch Privatpersonen ohne natives IPv6 Internet Zugang zum &#8220;neuen&#8221; Netz erhalten. Registriert man sich auf der Seite kann ein IPv6 Tunnel unter anderem via AYIYA realisiert werden, welches sogar NAT unterstützt und somit auf fast allen PC funktionieren sollte.</p>
<p>Das Programm AICCU initialisiert die Tunnel und benötigt als Konfiguration lediglich SiXXs-Benutzername und Passwort sowie eine Tunnel Nummer. Das Programm gibt es als net-misc/aiccu als Ebuild für Gentoo.</p>
<p>Ist der Tunnel erfolgreich eingerichtet kann auch ein IPv6 Subnet beantragt werden und weitere PCs im Heimnetz ans IPv6 Netz zu bekommen. Der <a href="http://www.gentoo.org/doc/en/ipv6.xml">Gentoo-IPv6-Router-Guide</a> erklärt wie man radvd und dhcpv6 konfiguriert.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/linux/gentoo/ipv6-home/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Home-Server</title>
		<link>http://www.twam.info/hardware/home-server</link>
		<comments>http://www.twam.info/hardware/home-server#comments</comments>
		<pubDate>Wed, 30 Jan 2008 18:00:21 +0000</pubDate>
		<dc:creator>twam</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://blog.twam.info/?p=110</guid>
		<description><![CDATA[Seit einigen Jahren betreibe ich im Keller unseres Hauses einen kleinen Linux-Server als Internet-Gateway, eMail-Server und zentrale Datenablage. Da der Rechner 24 Stunden am Tag, 7 Tage die Woche läuft und Strom verbraucht ist es sinnvoll diesen auf ökologischen und ökonomischen Gründen zu optimieren. Die Server die bisher diese Aufgabe erfüllten brauchten im Idle-Zustand deutlich [...]]]></description>
			<content:encoded><![CDATA[<p>Seit einigen Jahren betreibe ich im Keller unseres Hauses einen kleinen Linux-Server als Internet-Gateway, eMail-Server und zentrale Datenablage.</p>
<p>Da der Rechner 24 Stunden am Tag, 7 Tage die Woche läuft und Strom verbraucht ist es sinnvoll diesen auf ökologischen und ökonomischen Gründen zu optimieren.</p>
<p>Die Server die bisher diese Aufgabe erfüllten brauchten im Idle-Zustand deutlich über 100 Watt, dank 5 Festplatten (1x System, 4x Daten als RAID5) und nicht unterstützer Stromsparmodi von Festplatten und CPU. Um diese Situation zu verbessern wurde der Server im Dezember 2007 aufgerüstet mit dem Ziel im Schnitt unter 50 Watt zu bleiben.<span id="more-110"></span></p>
<p>Nach längerem Recherchieren und Probieren war es geschafft! <strong>45 Watt</strong> im Schnitt, dank folgender Hardware-Konfiguration</p>
<ul>
<li><a onclick="window.open(this.href, '_blank'); return false;" href="http://www.intel.com/products/processor/core2duo">Intel Core 2 Duo T550 Prozessor</a> mit nur 34 Watt TDP</li>
<li><a onclick="window.open(this.href, '_blank'); return false;" href="http://www.aopen.de/products_detail.aspx?Auno=2064">AOpen i945GTm-VHL</a> Board mit Socket M, Intel 945GT Chipsatz (inkl. Grafik) und onboard Intel Gigabit Ethernet Controller</li>
<li>Zwei 1024 MB Infineon/Qimonda DDR2-667 CL5-Module (RAMHYS64T128021HDL-3S-B) damit ausreichend Cache vorhanden ist (und die Festplatte länger schlafen kann)</li>
<li>Zwei <a onclick="window.open(this.href, '_blank'); return false;" href="http://www.samsung.com/global/business/hdd/productmodel.do?group=&amp;type=61&amp;subtype=63&amp;model_cd=248&amp;ppmi=1155">Samsung HD753LJ</a> Festplatten mit 750 GB und 32 MB Cache als RAID1 (gespiegelt) zur Datenablage welche laut Datenblatt 7.7-8.6 Watt benötigen und im Sleep-Modus nur 0.8-1.2 Watt</li>
<li><a onclick="window.open(this.href, '_blank'); return false;" href="http://addonics.com/products/flash_memory_reader/ad4cfprj.asp">Addonics Quad-CF PCI adapter</a> zur Aufnahme der Compact-Flash Karten für System und Swap (Alternativ hätte man die CF-Karten auch per Adapter an den onboard IDE Controller anschließen können, doch alle Adapter die ich probiert habe unterstützen keinen DMA-Modus und waren daher unzumutbar langsam)</li>
<li><a onclick="window.open(this.href, '_blank'); return false;" href="http://sandisk.com/Products/Catalog%281191%29-SanDisk_Extreme_IV_CompactFlash.aspx">SanDisk Extreme IV 8 GB</a> Compact-Flash-Karte als System-Laufwerk (~ 40 MB/s)</li>
<li><a onclick="window.open(this.href, '_blank'); return false;" href="http://sandisk.com/Products/Catalog%281027%29-SanDisk_Extreme_III_CompactFlash.aspx">SanDisk Extreme III 2 GB</a> Compact-Flash-Karte als Swap-Laufwerk (~ 20 MB/s)</li>
</ul>
<p>Als Betriebssystem läuft auf dem Server Gentoo-Linux. Hier ist zu beachten, dass man einen Kernel &gt;2.6.24 wählt, da ab diesem ein Tickless-Systems auf der x86-64-Architektur unterstützt wird und die CPU somit deutlich länger schlafen kann.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.twam.info/hardware/home-server/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

