<?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>logIt &#187; kernel</title>
	<atom:link href="https://lakm.us/logit/tag/kernel/feed/" rel="self" type="application/rss+xml" />
	<link>https://lakm.us/logit</link>
	<description>Log Around The Clock</description>
	<lastBuildDate>Sat, 06 Jun 2015 14:17:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Compile USB Serial Modem Using option.c (Ubuntu on Beagleboard xM)</title>
		<link>https://lakm.us/logit/2012/01/compile-usb-serial-modem-using-option-c-ubuntu-on-beagleboard-xm/</link>
		<comments>https://lakm.us/logit/2012/01/compile-usb-serial-modem-using-option-c-ubuntu-on-beagleboard-xm/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 08:54:18 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[General Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[BeagleBoard]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[embedded system]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[modem]]></category>
		<category><![CDATA[OMAP3]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://xp-racy.lan/it/?p=341</guid>
		<description><![CDATA[Despite possibility to use (1) $ modprobe -v usbserial vendor=0x05c6 product=0x0015 or (2) usb-modeswitch, (3) Matthias Urlichs initially wrote option.c driver as a way to insert USB modem as kernel module. This driver exists because the &#8220;normal&#8221; serial driver doesn&#8217;t work too well with GSM modems. Issues: - data loss &#8212; one single Receive URB [...]]]></description>
				<content:encoded><![CDATA[<p>Despite possibility to use (1)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ modprobe <span style="color: #660033;">-v</span> usbserial <span style="color: #007800;">vendor</span>=0x05c6 <span style="color: #007800;">product</span>=0x0015</pre></div></div>

<p>or (2) <code>usb-modeswitch</code>, (3) <a href="http://matthias.urlichs.de/">Matthias Urlichs</a> initially wrote <code>option.c</code> driver as a way to insert USB modem as kernel module.</p>
<blockquote><p>This driver exists because the &#8220;normal&#8221; serial driver doesn&#8217;t work too well<br />
with GSM modems. Issues:<br />
- data loss &#8212; one single Receive URB is not nearly enough<br />
- nonstandard flow (Option devices) control<br />
- controlling the baud rate doesn&#8217;t make sense</p></blockquote>
<p>Most modems will be successfully attached with this driver, appearing in one of the typical <code>/dev/ttyUSB0</code> to <code>/dev/ttyUSB2</code>. The product ID <code>0x0015</code> for GSM modem compiled here is a Qualcomm (vendor ID 0x05c6) OEM modem I received from <a href="http://www.armkits.com/product/devkit8500d.asp">Embest DevKit8500D</a> order. There are more than one form factor when searching for its images on Google. Closest one we have in Indonesia is ADVAN DT8-HT bundled in <a href="http://www.telkomsel.com/telkomselflash">Telkomsel Flash</a>.</p>
<div class="wp-caption aligncenter" style="width: 510px"><img alt="qualcomm-05c6-0015-telkomsel-advan.jpg" src="../../../../images/qualcomm-05c6-0015-telkomsel-advan.jpg" title="qualcomm-05c6-0015-telkomsel-advan.jpg" class="aligncenter" width="250" height="172" /><p class="wp-caption-text">Qualcomm 05c6:0015 from Indonesian operator</p></div>
<p>I&#8217;m compiling it for the <a href="http://beagleboard.org/hardware-xM">Beagleboard xM</a> Rev C running Ubuntu Oneiric (installed in <a href="../2011/12/ubuntu-on-beagleboard-xm-with-easycap-video-capture-compiling-driver">this post</a>). A quick look gives:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation <span style="color: #000000;">2.0</span> root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation <span style="color: #000000;">2.0</span> root hub
Bus 001 Device 002: ID 0424:<span style="color: #000000;">9514</span> Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 005: ID 05c6:0015 Qualcomm, Inc.</pre></div></div>

<p>The above <code>0x0015</code> product ID doesn&#8217;t exist inside <code>option.c</code> of linux <a href="https://launchpad.net/ubuntu/+source/linux/3.0.0-12.20">kernel 3.0.0-12 source</a>. Adding this to series of existing Qualcomm modems gives:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>635
636
637
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">	<span style="color: #7a0874; font-weight: bold;">&#123;</span> USB_DEVICE<span style="color: #7a0874; font-weight: bold;">&#40;</span>QUALCOMM_VENDOR_ID, 0x6000<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>, <span style="color: #000000; font-weight: bold;">/*</span> ZTE AC8700 <span style="color: #000000; font-weight: bold;">*/</span>
	<span style="color: #7a0874; font-weight: bold;">&#123;</span> USB_DEVICE<span style="color: #7a0874; font-weight: bold;">&#40;</span>QUALCOMM_VENDOR_ID, 0x6613<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>, <span style="color: #000000; font-weight: bold;">/*</span> Onda H600<span style="color: #000000; font-weight: bold;">/</span>ZTE MF330 <span style="color: #000000; font-weight: bold;">*/</span>
	<span style="color: #7a0874; font-weight: bold;">&#123;</span> USB_DEVICE<span style="color: #7a0874; font-weight: bold;">&#40;</span>QUALCOMM_VENDOR_ID, 0x0015<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#125;</span>, <span style="color: #000000; font-weight: bold;">/*</span> Qualcomm no brand <span style="color: #000000; font-weight: bold;">*/</span></pre></td></tr></table></div>

<p>The <code>include</code> also needs <code>usb-wwan.h</code> from that kernel source. Copy them both under  <code>/usr/src/linux-headers-3.0.6-x3/drivers/usb/serial/</code>. For other <code>include</code> files, install:</p>
<ol>
<li><a href="http://ports.ubuntu.com/ubuntu-ports/pool/main/l/linux/linux-headers-3.0.0-12_3.0.0-12.20_all.deb">linux-headers-3.0.0-12_3.0.0-12.20_all.deb</a></li>
<li><a href="https://launchpad.net/ubuntu/oneiric/armel/linux-image-3.0.0-12-omap/3.0.0-12.20">linux-image-3.0.0-12-omap_3.0.0-12.20_armel.deb</a></li>
</ol>
<p>and create this link as <code>root</code></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>
$ <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.0-<span style="color: #000000;">12</span><span style="color: #000000; font-weight: bold;">/</span>arch<span style="color: #000000; font-weight: bold;">/</span>arm<span style="color: #000000; font-weight: bold;">/</span>mach-versatile<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>mach mach</pre></td></tr></table></div>

<p>After removing the old one (pointed to <code>build -> /build/buildd/linux-3.0</code>), create a link inside <code>/lib/modules/3.0.6-x3</code> named <code>build</code> pointing to:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">build -<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3</pre></div></div>

<p>Modify the original <code>Makefile</code> to contain only rule for <code>option.o</code></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">obj-m			+= option.o</pre></div></div>

<p>and then build the driver</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>build<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #007800;">M</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>usb<span style="color: #000000; font-weight: bold;">/</span>serial<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">make</span>: Entering directory <span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #ff0000;">'
  LD      /usr/src/linux-headers-3.0.6-x3/drivers/usb/serial/built-in.o
  CC [M]  /usr/src/linux-headers-3.0.6-x3/drivers/usb/serial/option.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /usr/src/linux-headers-3.0.6-x3/drivers/usb/serial/option.mod.o
  LD [M]  /usr/src/linux-headers-3.0.6-x3/drivers/usb/serial/option.ko
make: Leaving directory `/usr/src/linux-headers-3.0.6-x3`</span></pre></div></div>

<p>Copy the build and deploy</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>usb<span style="color: #000000; font-weight: bold;">/</span>serial<span style="color: #000000; font-weight: bold;">/</span>option.ko <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>kernel<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>usb<span style="color: #000000; font-weight: bold;">/</span>serial<span style="color: #000000; font-weight: bold;">/</span>
$ depmod <span style="color: #660033;">-a</span></pre></div></div>

<p>Now <code>syslog</code> will show the following lines if the modem is inserted:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">kernel:<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">4790.229888</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> usb <span style="color: #000000;">1</span>-<span style="color: #000000;">2.5</span>: GSM modem <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span>-port<span style="color: #7a0874; font-weight: bold;">&#41;</span> converter now attached to ttyUSB0
kernel:<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">4790.237121</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> option <span style="color: #000000;">1</span>-<span style="color: #000000;">2.5</span>:<span style="color: #000000;">1.0</span>: GSM modem <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span>-port<span style="color: #7a0874; font-weight: bold;">&#41;</span> converter detected
kernel:<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">4790.238250</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> usb <span style="color: #000000;">1</span>-<span style="color: #000000;">2.5</span>: GSM modem <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span>-port<span style="color: #7a0874; font-weight: bold;">&#41;</span> converter now attached to ttyUSB1
kernel:<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">4790.240142</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> option <span style="color: #000000;">1</span>-<span style="color: #000000;">2.5</span>:<span style="color: #000000;">1.1</span>: GSM modem <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span>-port<span style="color: #7a0874; font-weight: bold;">&#41;</span> converter detected
kernel:<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">4790.241210</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> usb <span style="color: #000000;">1</span>-<span style="color: #000000;">2.5</span>: GSM modem <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">1</span>-port<span style="color: #7a0874; font-weight: bold;">&#41;</span> converter now attached to ttyUSB2
mtp-probe: checking bus <span style="color: #000000;">1</span>, device <span style="color: #000000;">9</span>: <span style="color: #ff0000;">&quot;/sys/devices/platform/usbhs-omap.0/ehci-omap.0/usb1/1-2/1-2.5&quot;</span>
mtp-probe: bus: <span style="color: #000000;">1</span>, device: <span style="color: #000000;">9</span> was not an MTP device
kernel:<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">4791.227294</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> scsi <span style="color: #000000;">2</span>:<span style="color: #000000;">0</span>:<span style="color: #000000;">0</span>:<span style="color: #000000;">0</span>: Direct-Access     Qualcomm MMC Storage      <span style="color: #000000;">2.31</span> PQ: <span style="color: #000000;">0</span> ANSI: <span style="color: #000000;">2</span>
kernel:<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">4791.232238</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> sd <span style="color: #000000;">2</span>:<span style="color: #000000;">0</span>:<span style="color: #000000;">0</span>:<span style="color: #000000;">0</span>: Attached scsi generic sg0 <span style="color: #7a0874; font-weight: bold;">type</span> <span style="color: #000000;">0</span>
kernel:<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">4791.246887</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> sd <span style="color: #000000;">2</span>:<span style="color: #000000;">0</span>:<span style="color: #000000;">0</span>:<span style="color: #000000;">0</span>: <span style="color: #7a0874; font-weight: bold;">&#91;</span>sda<span style="color: #7a0874; font-weight: bold;">&#93;</span> Attached SCSI removable disk</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2012/01/compile-usb-serial-modem-using-option-c-ubuntu-on-beagleboard-xm/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ubuntu on Beagleboard xM with Easycap Video Capture (Compiling Driver)</title>
		<link>https://lakm.us/logit/2011/12/ubuntu-on-beagleboard-xm-with-easycap-video-capture-compiling-driver/</link>
		<comments>https://lakm.us/logit/2011/12/ubuntu-on-beagleboard-xm-with-easycap-video-capture-compiling-driver/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 12:25:58 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ARMv7]]></category>
		<category><![CDATA[BeagleBoard]]></category>
		<category><![CDATA[embedded system]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[OMAP3]]></category>
		<category><![CDATA[rootfs]]></category>
		<category><![CDATA[USB]]></category>
		<category><![CDATA[video capture]]></category>

		<guid isPermaLink="false">http://xp-racy.lan/it/?p=233</guid>
		<description><![CDATA[Attempt to run Ubuntu in BeagleBoard xM rev C board has taken me to try various options of kernel and release. The goal was to have both Ubuntu and widely-available Easycap as video input via the USB of this compact TI OMAP board. Porting Ubuntu would spare us some flexibility to try different alternatives of [...]]]></description>
				<content:encoded><![CDATA[<p>Attempt to run Ubuntu in <a href="http://beagleboard.org/hardware-xM">BeagleBoard xM</a> rev C board has taken me to try various options of kernel and release. The goal was to have both Ubuntu and widely-available <a href="http://easycap.co.uk/">Easycap</a> as video input via the USB of this compact TI OMAP board. Porting Ubuntu would spare us some flexibility to try different alternatives of video processing and networking options for the stream. The easiest way initially was to run Ubuntu preinstalled image. I had two popular options immediately: 1) Ubuntu Port CD Image release 2) Robert C. Nelson custom image (rootfs). I started with the later first to see the board running at once. The latest found in <a href="http://rcn-ee.net/deb/rootfs/">http://rcn-ee.net/deb/rootfs/</a> was ubuntu-11.10-r0-minimal-armel.tar.xz which gave me Ubuntu 11.10 Oneiric with custom linux 3.0.3-x2 kernel.</p>
<div class="wp-caption aligncenter" style="width: 510px"><img alt="Easycap USB Video-Audio Capture.jpg" src="../../../../images/easycap.jpg" title="Easycap USB Video-Audio Capture" class="aligncenter" width="138" height="127" /><p class="wp-caption-text">Easycap USB Video-Audio Capture</p></div>
<p>It turned out that this custom kernel hadn&#8217;t been compiled with<del datetime="2013-03-25T02:25:52+00:00">out</del> Easycap. We can compare that to my laptop running linux 2.6.38-10 where it was part of its kernel compilation:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>ubuntu-laptop<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">cat</span>  <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-2.6.38-<span style="color: #000000;">10</span><span style="color: #000000; font-weight: bold;">/</span>.config <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-i</span> easy
<span style="color: #007800;">CONFIG_EASYCAP</span>=m</pre></div></div>

<p>Compiling the whole thing using <code>make menuconfig</code> to change <code>.config</code> file and so on seemed too much. A more partial approach was to touch only relevant <code>Makefile</code> involved in building the driver. First we needed the kernel header files provided as <a href="http://rcn-ee.net/deb/oneiric/v3.0.6-x3/linux-headers-3.0.6-x3_1.0oneiric_armel.deb">linux-headers-3.0.6-x3_1.0oneiric_armel.deb</a> and then source files for Easycap. As this was custom kernel, by guessing I found that it was closest to official linux 3.0.0-12.20 at <a href="https://launchpad.net/ubuntu/+source/linux/3.0.0-12.20">launchpad</a>, hence easycap source files were copied from it (the custom kernel might&#8217;ve been forked from this release as some random header files comparison to <code>linux-headers-3.0.0-12-omap_3.0.0-12.20_armel</code> returned no difference).</p>
<p>FYI Easycap linux driver is no longer developed separately as a SourceForge project, it has been part of <code>drivers/staging</code> in recent kernel releases (where you get <code>dmesg</code> like &#8220;<em>module is from the staging directory, the quality is unknown, you have been warned</em>&#8221; when inserting it). In the source we&#8217;ll find <code>/linux-3.0/drivers/staging/easycap/</code> to be copied into <code>/usr/src/linux-headers-3.0.6-x3/drivers/staging/easycap/</code> on the board.</p>
<p>After removing the old one (pointed to  <code>build -> /build/buildd/linux-3.0</code>), I created a link inside <code>/lib/modules/3.0.6-x3</code> named <code>build</code> pointing to:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">build -<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3</pre></div></div>

<p>then copied the <code>Makefile</code> from my laptop to replace original Easycap source with this content of rules:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">obj-m	+= easycap.o
&nbsp;
easycap-y	:= easycap_main.o easycap_low.o easycap_sound.o
easycap-y	+= easycap_ioctl.o easycap_settings.o
easycap-y	+= easycap_testcard.o
&nbsp;
ccflags-y := <span style="color: #660033;">-Wall</span>
<span style="color: #666666; font-style: italic;"># Impose all or none of the following:</span>
ccflags-y += -DEASYCAP_IS_VIDEODEV_CLIENT
ccflags-y += -DEASYCAP_NEEDS_V4L2_DEVICE_H
ccflags-y += -DEASYCAP_NEEDS_V4L2_FOPS
ccflags-y += -DEASYCAP_NEEDS_UNLOCKED_IOCTL</pre></div></div>

<p>Compiling should work afterward:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>build<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #007800;">M</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>
  LD      <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>built-in.o
  CC <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span>  <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap_main.o
  CC <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span>  <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap_low.o
  CC <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span>  <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap_sound.o
  CC <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span>  <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap_ioctl.o
  CC <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span>  <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap_settings.o
  CC <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span>  <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap_testcard.o
  LD <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span>  <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap.o
  Building modules, stage 2.
  MODPOST <span style="color: #000000;">1</span> modules
  CC      <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap.mod.o
  LD <span style="color: #7a0874; font-weight: bold;">&#91;</span>M<span style="color: #7a0874; font-weight: bold;">&#93;</span>  <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #000000; font-weight: bold;">/</span>drivers<span style="color: #000000; font-weight: bold;">/</span>staging<span style="color: #000000; font-weight: bold;">/</span>easycap<span style="color: #000000; font-weight: bold;">/</span>easycap.ko
<span style="color: #c20cb9; font-weight: bold;">make</span>: Leaving directory <span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>linux-headers-3.0.6-x3<span style="color: #ff0000;">'</span></pre></div></div>

<p>I tried to <code>insmod</code> the <code>easycap.ko</code> built, but dmesg showed some error and no <code>/dev/video0</code> created. There must be some other drivers that must be loaded first which I didn&#8217;t know in what sequence (i.e. <code>v4l2-common</code> etc.), hence I decided to just copy that under the <code>/lib/modules/3.0.6-x3/kernel/drivers/staging/easycap</code>, <code>depmod -a</code>, <del datetime="2012-01-10T04:33:20+00:00">and reboot</del>.</p>
<p>If you plug the Easycap while inspecting the <code>syslog</code> tail, there won&#8217;t be similar message as found in kernel 2.6.38-10. Instead, you&#8217;ll see:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1377.696838</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> usb <span style="color: #000000;">1</span>-<span style="color: #000000;">2.3</span>: new high speed USB device number <span style="color: #000000;">6</span> using ehci-omap
mtp-probe: checking bus <span style="color: #000000;">1</span>, device <span style="color: #000000;">6</span>: <span style="color: #ff0000;">&quot;/sys/devices/platform/usbhs-omap.0/ehci-omap.0/usb1/1-2/1-2.3&quot;</span>
mtp-probe: bus: <span style="color: #000000;">1</span>, device: <span style="color: #000000;">6</span> was not an MTP device
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1378.052459</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Linux video capture interface: v2.00
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1378.169006</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Easycap version: 0.9.01
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1378.198944</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> usbcore: registered new interface driver snd-usb-audio
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.043853</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_standard: selected standard: PAL_BGHIN
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.151245</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_format: sought:    640x480,UYVY<span style="color: #7a0874; font-weight: bold;">&#40;</span>0x59565955<span style="color: #7a0874; font-weight: bold;">&#41;</span>,<span style="color: #000000;">1</span>=field,<span style="color: #000000;">0</span><span style="color: #007800;">x00</span>=std mask
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.151306</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_format: sought:    V4L2_FIELD_NONE
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.151336</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_format: actioning: 640x480 PAL_BGHIN_AT_640x480_FMT_UYVY-n
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.181488</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_brightness: adjusting brightness to  0x7F
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.184478</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_contrast: adjusting contrast to  0x3F
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.212768</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_saturation: adjusting saturation to  0x2F
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.214599</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_hue: adjusting hue to  0x00
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.219207</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0easycap_usb_probe: registered with videodev: <span style="color: #000000;">0</span>=minor
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.219238</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0easycap_usb_probe: ends successfully <span style="color: #000000; font-weight: bold;">for</span> interface <span style="color: #000000;">0</span>
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.219543</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> usbcore: registered new interface driver easycap
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1381.314453</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap:: easycap_open: ==========<span style="color: #007800;">OPEN</span>=========
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.031188</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_standard: selected standard: PAL_BGHIN
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.228759</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_format: sought:    640x480,UYVY<span style="color: #7a0874; font-weight: bold;">&#40;</span>0x59565955<span style="color: #7a0874; font-weight: bold;">&#41;</span>,<span style="color: #000000;">1</span>=field,<span style="color: #000000;">0</span><span style="color: #007800;">x00</span>=std mask
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.228790</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_format: sought:    V4L2_FIELD_NONE
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.228851</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_format: actioning: 640x480 PAL_BGHIN_AT_640x480_FMT_UYVY-n
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.233489</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_brightness: adjusting brightness to  0x7F
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.235198</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_contrast: adjusting contrast to  0x3F
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.237884</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_saturation: adjusting saturation to  0x2F
kernel: <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1384.239501</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> easycap::0adjust_hue: adjusting hue to  0x00</pre></div></div>

<p>Later I find out that newer image is available on the Robert&#8217;s site, but not sure which linux source I should use for the Easycap if I were to to use it. Anyway, before deciding to just go with this one I&#8217;ve tried various kernels. Here are list of images and their kernel versions (I wasn&#8217;t quite sure which one was running smoothly and which wasn&#8217;t):</p>
<ol>
<li>linux-2.6.35.9-l9 Ubuntu 10.04 Lucid: ubuntu-10.04.1-r4-minimal-armel.tar</li>
<li>linux-3.1.4-x6 Ubuntu 11.10 Oneiric: ubuntu-11.10-r2-minimal-armel.tar.xz</li>
<li>linux-3.1.4-x6 Ubuntu 11.04 Natty: ubuntu-11.04-r7-minimal-armel.tar.xz</li>
<li>linux-2.6.38.2-d9 Ubuntu 10.10 Maverick: ubuntu-10.10-r6-minimal-armel.tar.xz</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2011/12/ubuntu-on-beagleboard-xm-with-easycap-video-capture-compiling-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu ARM on QEMU Processor Emulator</title>
		<link>https://lakm.us/logit/2011/11/ubuntu-on-qemu-processor-emulator/</link>
		<comments>https://lakm.us/logit/2011/11/ubuntu-on-qemu-processor-emulator/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 04:14:55 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ARMv7]]></category>
		<category><![CDATA[embedded system]]></category>
		<category><![CDATA[emulator]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Lucid]]></category>
		<category><![CDATA[OMAP3]]></category>
		<category><![CDATA[QEMU]]></category>
		<category><![CDATA[rootfs]]></category>
		<category><![CDATA[RootStock]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://xp-racy.lan/it/?p=300</guid>
		<description><![CDATA[There are times when you need to try things on virtualized environment before hand e.g. 1) checking application functionality or 2) actual device shipment is still on its long way. Those were also my cases with ARM Linux. Unlike virtualization in production environment however, putting software to emulate CPU architecture will slow down the guest [...]]]></description>
				<content:encoded><![CDATA[<p>There are times when you need to try things on virtualized environment before hand e.g. 1) checking application functionality or 2) actual device shipment is still on its long way. Those were also my cases with ARM Linux. Unlike virtualization in production environment however, putting software to emulate CPU architecture will slow down the guest machine a lot.</p>
<p>Ready-to-use image for from the old Ubuntu 9.10 Karmic is avalaible as suggested in <a href="https://wiki.ubuntu.com/ARM/RootfsFromScratch">RootStock Wiki</a> .</p>
<p>To run Ubuntu 10,04 Lucid you can create similar <code>.img</code> filled by RootStock generated root file system as described in <a href="../2011/10/running-ubuntu-on-devkit8500d-natty-kernel-and-lucid-rootfs/">this post</a> generating <code>lucid-arm.img</code>. Boot image is obtained from <a href="http://ports.ubuntu.com/dists/lucid/main/installer-armel/current/images/versatile/netboot/vmlinuz">Lucid port page</a>, of which I saved with the name <code>vmlinuz-lucid-current-ports</code> which is actually linux kernel 2.6.32-21. Running QEMU is then:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">qemu-system-arm <span style="color: #660033;">-M</span> versatilepb <span style="color: #660033;">-cpu</span> cortex-a8 \
  <span style="color: #660033;">-kernel</span> vmlinuz-lucid-current-ports \
  <span style="color: #660033;">-hda</span> lucid-arm.img <span style="color: #660033;">-m</span> <span style="color: #000000;">256</span> <span style="color: #660033;">-append</span> <span style="color: #ff0000;">&quot;root=/dev/sda mem=256M devtmpfs.mount=0 rw&quot;</span></pre></div></div>

<p>However, adding <code>-redir tcp:3232::22</code> isn&#8217;t directly working (although <code>telnet</code> is showing both directions are functional). This redirection is working with the Karmic image which gives instant <code>ssh</code> on my host laptop as in:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> localhost <span style="color: #660033;">-oPort</span>=<span style="color: #000000;">3232</span> <span style="color: #660033;">-l</span> ubuntu</pre></div></div>

<p>Note: successful QEMU machine image probably won&#8217;t boot successfully with the real board. I can&#8217;t use kernel 2.6.38-10 for Lucid rootfs on QEMU, but successfully boot that on DevKit8500D board.</p>
<div class="wp-caption aligncenter" style="width: 510px"><img alt="qemu-ubuntu-10.04-lucid-kernel-2.6.32-21.jpg" src="../../../../images/qemu-ubuntu-10.04-lucid-kernel-2.6.32-21.jpg" title="qemu-ubuntu-10.04-lucid-kernel-2.6.32-21.jpg" class="aligncenter" width="480" height="435" /><p class="wp-caption-text">QEMU console of Ubuntu 10.04 VM</p></div>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2011/11/ubuntu-on-qemu-processor-emulator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running Ubuntu on DevKit8500D (Natty Kernel and Lucid RootFS)</title>
		<link>https://lakm.us/logit/2011/10/running-ubuntu-on-devkit8500d-natty-kernel-and-lucid-rootfs/</link>
		<comments>https://lakm.us/logit/2011/10/running-ubuntu-on-devkit8500d-natty-kernel-and-lucid-rootfs/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 12:50:31 +0000</pubDate>
		<dc:creator>Arif</dc:creator>
				<category><![CDATA[ARM Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ARMv7]]></category>
		<category><![CDATA[BeagleBoard]]></category>
		<category><![CDATA[DevKit8500D]]></category>
		<category><![CDATA[embedded system]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Lucid]]></category>
		<category><![CDATA[Natty]]></category>
		<category><![CDATA[OMAP3]]></category>
		<category><![CDATA[rootfs]]></category>
		<category><![CDATA[RootStock]]></category>

		<guid isPermaLink="false">http://xp-racy.lan/it/?p=264</guid>
		<description><![CDATA[BeagleBoard xM that comes with Texas Instruments’ DM3730 DaVinci™ processor has its Chinese sister from Embest, the DevKit8500D evaluation kit. This similarity and eLinux wiki (showing working previous DevKit8000) have made me confident that Ubuntu would also port to this board with no hassle. As always, that wasn&#8217;t the story. I tried preinstalled images available [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://beagleboard.org/hardware-xM">BeagleBoard xM</a> that comes with Texas Instruments’ DM3730 DaVinci™ processor has its Chinese sister from Embest, the <a href="http://www.armkits.com/product/devkit8500d.asp">DevKit8500D</a> evaluation kit. This similarity  and <a href="http://elinux.org/Devkit8000_Ubuntu">eLinux wiki</a> (showing working previous DevKit8000) have made me confident that Ubuntu would also port to this board with no hassle. As always, that wasn&#8217;t the story. I tried preinstalled images available on <a href="http://cdimage.ubuntu.com/releases">Ubuntu CD Image</a> and final combination that worked out of a series of trial-and-error was Natty kernel with Lucid rootfs.</p>
<div class="wp-caption aligncenter" style="width: 510px"><img alt="DevKit8500D TI OMAP3" src="../../../../images/devkit8500d.gif" title="DevKit8500D TI OMAP3 " width="300" height="224" /><p class="wp-caption-text">I bricked one of these DevKit8500D by overvoltaged it to 12V DC. Yes, It has no regulator.</p></div>
<p>
Various howto made net-boot or preinstalled images seem feasible, but trying them is another thing. The first attempt was to boot Ubuntu Lucid 10.04 LTS to have similar distribution as my laptop, but it would stop at boot with the message</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Error: unrecognized<span style="color: #000000; font-weight: bold;">/</span>unsupported machine ID <span style="color: #7a0874; font-weight: bold;">&#40;</span>r1 = 0x00000ae9<span style="color: #7a0874; font-weight: bold;">&#41;</span>.</pre></div></div>

<p>The above ID (2793 in decimal) isn&#8217;t found in Lucid released with linux 2.6.32-21. Ubuntu Natty 11.04 boot image didn&#8217;t complain because the ID already listed in <code>/usr/src/linux-source-2.6.38/arch/arm/tools/mach-types</code></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">...
 nemini                  MACH_NEMINI             NEMINI                  <span style="color: #000000;">2793</span>
...</pre></div></div>

<p>However, <a href="http://cdimage.ubuntu.com/releases/11.04/release/ubuntu-11.04-preinstalled-headless-armel+omap.img.gz">ubuntu-11.04-preinstalled-headless-armel+omap.img.gz</a> wouldn&#8217;t finish loading the linux kernel 2.6.38 somehow. Hence, I replaced the root file system using rootfs created using <a href="https://wiki.ubuntu.com/ARM/RootStock">RootStock</a> method. After successful boot, I installed <a href="https://launchpad.net/ubuntu/natty/+package/linux-image-2.6.38-8-omap">linux-image-2.6.38-8-omap_2.6.38-8.42_armel.deb</a> to have the rootfs kernel lib files updated (this would require <code>wireless-crda</code> dependency to be installed).</p>
<p><a id="LucidRooststock" href="#LucidRooststock" rel="bookmark" title="LucidRootstock"><br />
<h4>Creating Lucid RootStock &#038; Replacing Natty&#8217;s</h4>
<p></a></p>
<p>Using RootStock relies much on the host environment, in my case (version 0.1.99.3) the laptop has Lucid with 2.6.38 kernel (Natty), and it failed to create rootfs with option <code>--dist natty</code> by stopping at this QEMU error:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">qemu: fatal: cp15 insn ee1d6f70
&nbsp;
<span style="color: #007800;">R00</span>=4009f960 <span style="color: #007800;">R01</span>=420822e8 <span style="color: #007800;">R02</span>=0d696914 <span style="color: #007800;">R03</span>=000086a8
<span style="color: #007800;">R04</span>=00008ef0 <span style="color: #007800;">R05</span>=00000000 <span style="color: #007800;">R06</span>=000097c9 <span style="color: #007800;">R07</span>=<span style="color: #000000;">42082308</span>
<span style="color: #007800;">R08</span>=00020040 <span style="color: #007800;">R09</span>=00000000 <span style="color: #007800;">R10</span>=4009f000 <span style="color: #007800;">R11</span>=00000000
<span style="color: #007800;">R12</span>=00008b88 <span style="color: #007800;">R13</span>=4007f7f8 <span style="color: #007800;">R14</span>=4008f450 <span style="color: #007800;">R15</span>=4008aea0
<span style="color: #007800;">PSR</span>=<span style="color: #000000;">20000030</span> <span style="color: #660033;">--C-</span> T usr32</pre></div></div>

<p>DevKit8500D also freezed on boot when too many seeds used in the rootfs. A minimal seeds of Lucid rootfs used is</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>ubuntu-laptop<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> rootstock <span style="color: #660033;">--fqdn</span> omap <span style="color: #660033;">--login</span> ubuntu <span style="color: #660033;">--password</span> temppwd <span style="color: #660033;">--imagesize</span> 2G <span style="color: #660033;">--seed</span> <span style="color: #c20cb9; font-weight: bold;">wget</span>,<span style="color: #c20cb9; font-weight: bold;">nano</span>,linux-firmware,wireless-tools,usbutils <span style="color: #660033;">--dist</span> lucid <span style="color: #660033;">--serial</span> ttyO2 <span style="color: #660033;">--components</span> <span style="color: #ff0000;">&quot;main universe multiverse&quot;</span></pre></div></div>

<p>It will retrieve many packages from <a href="http://ports.ubuntu.com">http://ports.ubuntu.com</a> which takes long and produces i.e. <code>armel-rootfs-201110261541.tgz</code>.</p>
<p>A card at <code>/dev/sdb</code> with Natty boot images are obtained by</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">gunzip</span> <span style="color: #660033;">-c</span> ubuntu-<span style="color: #000000;">11.10</span>-preinstalled-server-armel+omap.img.gz <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">bs</span>=4M <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb</pre></div></div>

<p>The root file system will reside at <code>/dev/sdb2</code> while boot images are in <code>/dev/sdb1</code>. To replace this with Lucid rootfs, run following steps</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">if</span></span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=lucid-arm.img <span style="color: #007800;">bs</span>=1MB <span style="color: #007800;">count</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">seek</span>=<span style="color: #000000;">1024</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> mkfs.ext3 <span style="color: #660033;">-F</span> lucid-arm.img
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> loop lucid-arm.img <span style="color: #000000; font-weight: bold;">/</span>mnt
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>mnt <span style="color: #660033;">-zxf</span> armel-rootfs-<span style="color: #000000; font-weight: bold;">&lt;</span>some rootstock generated <span style="color: #c20cb9; font-weight: bold;">date</span><span style="color: #000000; font-weight: bold;">&gt;</span>.tgz
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #000000; font-weight: bold;">/</span>mnt
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">if</span></span>=lucid-arm.img <span style="color: #007800;">of</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>sdb2 <span style="color: #007800;">bs</span>=1MB <span style="color: #007800;">count</span>=<span style="color: #000000;">0</span> <span style="color: #007800;">seek</span>=<span style="color: #000000;">1024</span></pre></td></tr></table></div>

<p>There are reasons for why-not-using the included <a href="http://www.angstrom-distribution.org/">Ångström Linux</a> (forked to <code>linux-2.6.32-devkit8500</code>) but this method of booting Ubuntu wasn&#8217;t straightforward after all. The on-board LAN (using Davicom DM9000AEP chip) doesn&#8217;t work and I need to use USB ethernet detected as Davicom DM9601 (a bit ridiculous?). <a href="http://easycap.co.uk/">Easycap</a> USB video capture also works with this kernel as it has been part of 2.6.38 <code>drivers/staging</code> compilation.</p>
<div class="wp-caption aligncenter" style="width: 510px"><img alt="DM9601 USB-LAN-Card" src="../../../../images/USB-LAN-Card.jpg" title="DM9601 USB-LAN-Card" class="aligncenter" width="200" height="145" /><p class="wp-caption-text">DM9601 USB LAN</p></div>
<p>Before coming up with this combo, I&#8217;ve tried:</p>
<ol>
<li>Ubuntu Lucid 10.04 CD Image: <a href="http://cdimage.ubuntu.com/ports/releases/lucid/release/ubuntu-10.04-server-armel+omap.img">ubuntu-10.04-server-armel+omap.img</a>
<li>Ubuntu Oneiric 11.10 CD Image: <a href="http://cdimage.ubuntu.com/releases/11.10/release/ubuntu-11.10-preinstalled-server-armel+omap.img.gz">ubuntu-11.10-preinstalled-server-armel+omap.img.gz</a></li>
<li>Robert C. Nelson&#8217; Oneiric: <a href="http://rcn-ee.net/deb/rootfs/oneiric/ubuntu-11.10-r0-minimal-armel.tar.xz">ubuntu-11.10-r0-minimal-armel.tar.xz</a> (as pointed out by the above eLinux page which has changed quite regularly since October 2011)</li>
</ol>
<p>But nothing seemed to work.</p>
]]></content:encoded>
			<wfw:commentRss>https://lakm.us/logit/2011/10/running-ubuntu-on-devkit8500d-natty-kernel-and-lucid-rootfs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
