<?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>bert&#039;s blog</title>
	<atom:link href="http://biot.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://biot.com/blog</link>
	<description></description>
	<lastBuildDate>Sat, 11 Jul 2009 12:48:47 +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>Ultimatum</title>
		<link>http://biot.com/blog/ultimatum</link>
		<comments>http://biot.com/blog/ultimatum#comments</comments>
		<pubDate>Mon, 29 Jun 2009 12:49:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://biot.com/blog/?p=10</guid>
		<description><![CDATA[I read a review of a new book called Ultimatum. It seems interesting &#8212; it&#8217;s an eco-thriller set in the future &#8212; so I thought I&#8217;d buy it. Now I switched to ebooks some time ago; I don&#8217;t read books on dead trees anymore. I use an ebook reader I bought from a French company [...]]]></description>
			<content:encoded><![CDATA[<p>I read a <a href="http://www.economist.com/books/displaystory.cfm?story_id=13777094">review</a> of a new book called Ultimatum. It seems interesting &#8212; it&#8217;s an eco-thriller set in the future &#8212; so I thought I&#8217;d buy it.</p>
<p>Now I switched to ebooks some time ago; I don&#8217;t read books on dead trees anymore. I use an ebook reader I bought from a French company called <a href="http://bookeen.com/">Bookeen</a>, which unfortunately appears to have imploded since. I also own a <a href="http://en.wikipedia.org/wiki/Sony_Reader">Sony PRS-505</a>, a much better reader. Ebook readers are great: they use E-Ink displays instead of LCDs. This type of display does not emit light; it relies on actual black or white particles shifting position behind the panel. if a black particle comes up, that&#8217;s a dot on the display. This means:</p>
<ul>
<li>The displays are monochrome for now (though color versions are on the way)</li>
<li>Reading on such a display does not strain the eyes, like a CRT or LCD monitor does. It really is exactly like reading on a slice of dead tree.</li>
<li>It takes a long time to draw something on the screen &#8212; easily a second to refresh the display. These aren&#8217;t photons being shifted, after all, but real blobs of stuff.</li>
<li>The display needs electricity only to shift those particles; once they&#8217;re in place, no power is required to keep them there &#8212; unlike LCDs, CRTs, and so on. This is called a bistable display. But hey, battery life is great: I typically charge my reader once every couple of weeks, while using it for hours nearly every day.</li>
</ul>
<p>This is great technology, and obviously the future of books. Some people will dispute that, of course: they&#8217;ll come up with retarded arguments like the &#8220;texture&#8221; and the &#8220;smell&#8221; of books. These are the same kinds of people that will insist that music sounds better on vinyl, and movies look better in a theater. But you can&#8217;t stop progress: the music industry had its business model turned upside down by the internet, and the movie industry is getting its lunch eaten as well.</p>
<p>The Dying Dinosaurs Of Print, in the words of the incomparable <a href="http://ebooktest.blogspot.com/">Mike Cane</a>, are mostly ignoring ebooks. Where they&#8217;re not ignoring it, they&#8217;re requiring <a href="http://en.wikipedia.org/wiki/Digital_rights_management">DRM</a> to restrict your freedom on what you can do with your purchased book. Is any of this starting to sound familiar? You bet. That&#8217;s another reason why I&#8217;m sure ebooks are the future: the publishing industry is just as blind to the coming disaster as the music and movie industries were.</p>
<p>The smartest player in the industry is Amazon, whose <a href="http://www.amazon.com/kindle/">Kindle</a> reader integrates seamlessly with its online ebook store. The ebooks on Amazon are cheaper than the dead tree version, as they should be &#8212; typically $10. But that&#8217;s only in the US, and only if you have a Kindle. I&#8217;m in Europe, and I don&#8217;t have a Kindle. In fact, they&#8217;re not for sale in europe, and neither are Amazon&#8217;s ebooks.</p>
<p>Sony sells ebooks through its online store &#8212; for US residents only. They sell the reader in the UK as well, in partnership with <a href="http://www.waterstones.com/">Waterstone&#8217;s</a>, whose ebook store doesn&#8217;t even HAVE that book. Even if they did, something tells me they wouldn&#8217;t sell it to us non-brit European beasties anyway. There&#8217;s also <a href="http://www.mobipocket.com/">Mobipocket</a>, whose online store only sells DRM-encumbered ebooks in the outdated mobipocket format &#8212; and they don&#8217;t have that book either.</p>
<p>So where do I buy this book? Quite simply, I <strong>can&#8217;t</strong>. Nobody will take my money! But of course, just as in the music and movie industry, if you fail to sell people what they want to buy at the price they&#8217;re willing to pay, they&#8217;ll just download it for free. The book is already on some torrent sites, albeit as an audio ebook. I&#8217;m not interested in that: I want the text-only ebook version. But it&#8217;s only a matter of time until it appears.</p>
<p>So this is what I&#8217;m going to do: I&#8217;ll wait for the book to appear as a text ebook on some torrent site. If at that time I can legally buy it online for $10 (or even €10), I&#8217;ll buy it. If not, I&#8217;ll download it for free.</p>
<p>And that, ladies and gentlemen, is what&#8217;s going to kill the dead tree book publishing industry.</p>
]]></content:encoded>
			<wfw:commentRss>http://biot.com/blog/ultimatum/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Belgacom&#8217;s attack on the Belgian broadband market</title>
		<link>http://biot.com/blog/belgacoms-attack-on-the-belgian-broadband-market</link>
		<comments>http://biot.com/blog/belgacoms-attack-on-the-belgian-broadband-market#comments</comments>
		<pubDate>Sun, 21 Jun 2009 21:48:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://biot.com/blog/?p=9</guid>
		<description><![CDATA[I live in Belgium, where internet access is sadly very expensive (around €45 per month), and always limited by volume, generally around 25GB per month. If you transfer more, you get charged €1 per GB extra. That may sound insane, and it is &#8212; such limits simply can&#8217;t exist in a healthy, competitive market. Therein [...]]]></description>
			<content:encoded><![CDATA[<p>I live in Belgium, where internet access is sadly very expensive (around €45 per month), and always limited by volume, generally around 25GB per month. If you transfer more, you get charged €1 per GB extra. That may sound insane, and it is &#8212; such limits simply can&#8217;t exist in a healthy, competitive market.</p>
<p>Therein lies the rub: broadband access in Belgium is controlled by a duopoly consisting of the incumbent operator, Belgacom, and a large cable operator, Telenet, which operates only in the northern part of the country. People in the southern part of the country pretty much get it in the shorts.</p>
<p>European law dictates that incumbent operators must share their networks, in order to create competition in a formerly monopolized market. This has been the case since 1998, and in many countries this made a big difference. Not in Belgium, however. The government owns over 50% of the shares in Belgacom &#8212; and is also in charge of regulating Belgacom. That, of course, is not a recipe for creating a competitive telecoms market. So the politicians did what politicians do: they stacked the regulatory agency (BIPT) with a bunch of toadies that let Belgacom run wild, and every so often skimmed the cream off of Belgacom&#8217;s massive profits, generally right in time to fill a hole in the government budget. Amazing how that works.</p>
<p>The result is a thoroughly distorted broadband market. This has not gone unnoticed by the European Commission; its <a href="http://ec.europa.eu/information_society/policy/ecomm/doc/implementation_enforcement/annualreports/14threport/be.pdf">2008 report</a> lays out the awful state of the Belgian broadband market in quite a bit of detail &#8212; it even mentions a few of Belgacom&#8217;s nasty anti-competitive moves.</p>
<p>So while Belgacom is required to offer wholesale, bitstream and unbundled access to other operators, they are allowed to make all of these offers prohibitively uncompetitive, expensive and complex. The wholesale offer is ridiculously uncompetitive; if you sell it to customers at the same price at which Belgacom offers the same product, you will lose money on every DSL line. The bitstream offer is very expensive and complex to deploy &#8212; more about this below &#8212; and the unbundled offer is even worse. Practically speaking, very few operators do unbundled DSL, and none do wholesale. The bitstream offer is somewhere between the two, and while it&#8217;s complex and expensive, it&#8217;s the only real choice ISPs have. This bitstream offer is called BROBA.</p>
<p>So what makes deploying BROBA so hard? For starters, the whole thing is based on <a href="http://en.wikipedia.org/wiki/Asynchronous_Transfer_Mode">ATM</a> &#8212; an outdated network technology that died years ago, in every aspect of networking except DSL. ATM equipment is expensive, and very limited in speed; where nowadays every computer comes with a gigabit ethernet interface built in, the Belgian BROBA infrastructure is basically built on STM-1 cards &#8212; those are 155Mbit/s, and ATM guarantees at least 20% overhead, so those really aren&#8217;t going to do more than 140Mbit/s of IP traffic. And that&#8217;s just one of the reasons ATM died years ago.</p>
<p>Another problem is that Belgacom forces ISPs to buy VPs (virtual links) to every single local exchange where they want to offer DSL service, and more VPs if you want to offer different classes of service. There are about 1000 of these, and Belgacom forces you to buy access lines to various (arbitrary) &#8220;zones&#8221; of the country to transport these VPs. Your customers then come in on a certain VC (virtual circuit) over those virtual links. You terminate these in something called a <a href="http://en.wikipedia.org/wiki/Broadband_Remote_Access_Server">BAS</a>, which authenticates the customer and connects him or her to the internet. This is all massively expensive, and requires a lot of expertise to boot.</p>
<p>In the meantime, the rest of the world has moved off of ATM, and onto ethernet. It&#8217;s a huge trend in the telecoms industry: everything IP, and everything on ethernet. There are enormous advantages to ethernet: the per-port cost is very cheap, and new standards for ever-higher speeds, quality of service, troubleshooting, and multiplexing are being developed all the time.</p>
<p>So Belgacom started moving off of ATM years ago, along with every other large telecom operator. But their BROBA offer didn&#8217;t move off of ATM: keeping ISPs on expensive ATM gear suited them just fine, thanks very much. They have tons of ATM gear anyway, so keeping it around for the regulated offer doesn&#8217;t cost them much. Of course, even the toothless BIPT would at some point start making noises about this; it was only a matter of time until they required Belgacom to offer BROBA on ethernet to ISPs. So about four years ago Belgacom set about designing an ethernet interconnect setup that would somehow disadvantage the ISPs.</p>
<p>Now there are really only two ways to multiplex ethernet links: MPLS and VLANs. MPLS is a tag-switching technology very popular in large networks; it allows various services like QoS and VPNs to exist as a kind of &#8220;overlay&#8221; onto the physical ethernet backbone. VLANs are virtual ethernet networks, very popular in smaller networks and easy to use, but don&#8217;t scale as well as MPLS. So the logical way to hand over customers from a telco providing DSL service to an ISP providing internet access for them, is simply to put each customer in his own VLAN. Easy to implement, easy for ISPs to filter, route, put in their own VPN, etc.</p>
<p>So Belgacom decided that this was the one thing they were NOT going to do. One of the requirements they set for the new BROBA over ethernet design was that ISPs would NOT be able to identify customers by their VLAN ID on a certain link. So that&#8217;s what they did. Amazingly, the BIPT outdid themselves in this case: they didn&#8217;t even demand BROBA on ethernet from Belgacom. This was four years ago. Seriously.</p>
<p>Belgacom put forward their new <a href="http://www.belgacom.be/wholesale/gallery/content/documents/ngn/20090324_NGN_presentation.pdf">BROBA over ethernet</a> design recently, and in addition to the deliberate VLAN sabotage, they also put in a few more zingers! They won&#8217;t support anything but PPPoE &#8212; so you&#8217;ll be buying new modems for most (all) of your existing customers, and swapping them out at the exact moment of migration to the new ethernet design. If you want to check if the migration worked, well, you can forget about that too, since they won&#8217;t support ethernet <a href="http://en.wikipedia.org/wiki/OA%26M">OAM</a> (it&#8217;s &#8220;not possible&#8221;, according to Belgacom, in a hilariously deadpan lie).</p>
<p>This is not the usual Belgacom attempt at sabotaging anything that smells of competition. They&#8217;ve always tried nasty stuff, but they could only go so far. The BIPT, toothless as it is, still had to abide by European law. So while not competitive, there was in the end something of a market. But recently, <a href="http://www.quickonomie.be/nl/">Minister Q</a> &#8212; an unusually clued in politician, thoroughly in favor of free markets &#8212; managed to get a law voted that gives the BIPT more power over operators. He then threw out the BIPT&#8217;s entire board and chairman. Replacing them takes a while, however, and many political parties will try to stack the board with more toadies that will keep Belgacom from losing ground in the market; they like filling holes in their budget, after all. So with the old board getting thrown out and the new board members getting vetted, and then no doubt taking some time to get their feet wet in such an important regulatory body, we&#8217;re looking at a period of no regulation at all.</p>
<p>That, presumably, is why Belgacom published their new design now. It&#8217;s a total attack on what little broadband competition there is in Belgium; they mean to kill off what little there is, and to do it while the regulator is not in fighting shape.</p>
<p>The broadband market in Belgium has never been healthy, but if Belgacom gets away with this there won&#8217;t be any competition at all. That&#8217;s what makes this latest nastiness on Belgacom&#8217;s part so different: it&#8217;s a flanking attack on the entire market at once.</p>
<p>Belgacom has always been against competition in what it regards as its domain; this is very much in its DNA as a company. No amount of timid regulation or fines will tame it; not even the larger fines the BIPT can now apply. The only way Belgium will ever have a truly healthy and competitive broadband market is if Belgacom is forced to spin off its local networks; i.e. putting the copper wire, the equipment it terminates in, and the networks connecting the buildings or street cabinets that equipment is in, into another company, which then offers only wholesale services to operators, where Belgacom is just one of the operators.</p>
<p>This was done in the UK, for example, where BT spun off Openreach. This was also done in Belgium for the electricity and natural gas markets, where the incumbent (Electrabel) was forced to let go of their local networks. Electrabel, you see, was not majority-owned by the Belgian government. And this is the problem, of course. The Belgian government will never neuter Belgacom like this while it&#8217;s the majority shareholder. And in Belgium&#8217;s current unstable political climate, there isn&#8217;t a soul that will even try to sell off Belgacom. Unless they need a lot of money in short order. So do we have to hope for massive budget shortfalls before this gets fixed?</p>
<p><em>Full disclosure: I am an independent consultant, and among other things I often do work in the Telecom and ISP market in Belgium. I do not, however, have any financial interests in any of them; I am simply passionate about free markets, and utterly outraged about this latest stunt Belgacom is trying to pull.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://biot.com/blog/belgacoms-attack-on-the-belgian-broadband-market/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Woke up this morning&#8230;</title>
		<link>http://biot.com/blog/woke-up-this-morning</link>
		<comments>http://biot.com/blog/woke-up-this-morning#comments</comments>
		<pubDate>Tue, 05 May 2009 12:23:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://biot.com/blog/?p=8</guid>
		<description><![CDATA[&#8230;to the sound of a webserver in trouble. I run an update service for a software company. They need to distribute software and data updates to their existing customers, and were tired of endlessly burning and mailing out DVDs. So I set up a web service and made a nice REST API for them, so [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230;to the sound of a webserver in trouble. I run an update service for a software company. They need to distribute software and data updates to their existing customers, and were tired of endlessly burning and mailing out DVDs. So I set up a web service and made a nice <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST</a> API for them, so they can upload files, queue up those files for download by specific customers, and so on. The software on the customer site just checks the server, and downloads whatever is queued up for it. Authentication is based on a dongle that is shipped to the customer. It works great, with very little effort on anyone&#8217;s part. It&#8217;s a lot cheaper than shipping out DVDs, too.</p>
<p>While testing, and indeed in the first few months of the service being live, I saw the update files were all pretty small &#8212; a couple of MB usually &#8212; so like the idiot that I am, I wrote the code for sending an update via the web service like this:</p>
<ul>
<li>In the webserver child process, read the entire file into memory</li>
<li>output that content towards the webserver via CGI</li>
</ul>
<p>Not a problem, works like a charm. Then they uploaded a 200MB update.</p>
<p>The child process reads in the 200MB file, thus growing to that size in memory. The webserver is apache, and it gets that 200MB of content from the child process, thus also growing to 200MB in size. For some reason I don&#8217;t quite understand, apache does NOT let go of the child process, even though it demonstrably has all its output. So I now have 400MB worth of memory in use, for a single download. Five customers started up their application, and the 2GB of memory in the server melted like snow in a name-writing contest. The memory can&#8217;t be shared, because the child process handles putting it in memory; the kernel can&#8217;t possible know it&#8217;s all the same bunch of bits. It can&#8217;t even be shared between the apache and its child process, the CGI interface is too crude for that. It&#8217;s just a pipe, forget about <a href="http://www.linuxmanpages.com/man2/mmap.2.php">mmap<a href="http://www.linuxmanpages.com/man2/mmap.2.php"></a> or anything like that.</p>
<p>The machine eventually ran itself out of swap, and started killing processes. That&#8217;s when I noticed, of course. I threw a ton of swap at the machine to keep it going, found the code that caused the crazy memory usage, put a brown paper bag over my head, and started looking for a better solution.</p>
<p>The obvious way to handle this is to have the kernel send the file to the remote end, and have the userspace process &#8212; apache in this case &#8212; wash its hands of the whole thing. Linux can do this with the <a href="http://www.linuxmanpages.com/man2/sendfile.2.php">sendfile</a> system call. It takes input and output file descriptors, and just sends one to the other. The calling process simply waits for sendfile() to return.</p>
<p>But how can I do this from an apache subprocess? It doesn&#8217;t have access to the remote end&#8217;s socket file descriptor, only apache has this. That&#8217;s where <a href="http://tn123.ath.cx/mod_xsendfile/">mod_xsendfile</a> comes in. It examines headers coming from subprocesses, looking for a <b>X-Sendfile</b> header. If found, it takes the value (everything after the colon) to be a filename to send to the remote end. The module then discards the content sent by the subprocess, and calls sendfile() instead. So instead of reading in the whole file and outputting it back to apache, I now return only the full path to the file in an X-Sendfile header, and the whole thing is solved. Apache now needs no memory at all per update it sends out, so it&#8217;s a lot more scalable.</p>
<p>Apache has a fairly crufty old codebase, and it&#8217;s not the most dynamic of projects &#8212; but I still don&#8217;t understand why mod_xsendfile isn&#8217;t a standard module. This should be in every apache distribution &#8212; it solved this problem beautifully. Nevertheless, the module is available, and it works. There&#8217;s life in the old girl yet!</p>
<p>I should note that <a href="http://www.lighttpd.net/">lighttpd</a> has this functionality built in, as a part of the included <a href="http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ModFastCGI">mod_fastcgi</a>. This is perhaps no surprise &#8212; lighttpd is specifically intended to be more lightweight and scalable, and perform better, than apache.</p>
]]></content:encoded>
			<wfw:commentRss>http://biot.com/blog/woke-up-this-morning/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The problem with current HD media centers</title>
		<link>http://biot.com/blog/the-problem-with-current-hd-media-centers</link>
		<comments>http://biot.com/blog/the-problem-with-current-hd-media-centers#comments</comments>
		<pubDate>Fri, 01 May 2009 00:32:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://biot.com/blog/?p=7</guid>
		<description><![CDATA[My current media center settop box is the Popcorn Hour A-110. It&#8217;s a very small box, and it&#8217;s mostly empty at that: 2/3 of the box is space where you can plug in a SATA hard disk. I bought it because my previous media center, an original Xbox running XBMC, was very loud; two fans [...]]]></description>
			<content:encoded><![CDATA[<p>My current media center settop box is the <a href="http://www.engadgethd.com/2009/03/18/popcorn-hour-a-110-review">Popcorn Hour A-110</a>. It&#8217;s a very small box, and it&#8217;s mostly empty at that: 2/3 of the box is space where you can plug in a SATA hard disk. I bought it because my previous media center, an original Xbox running <a href="http://xbmc.org/">XBMC</a>, was very loud; two fans and a harddisk do not make for a quiet box. It also didn&#8217;t have anywhere near enough oomph to play 1080p HD movies. The popcorn hour has no moving parts at all, and so makes no noise whatsoever. It decodes 1080p without any problems, and supports just about any container and codec. It&#8217;s pretty cheap considering the specs, too: I bought mine for about €250.</p>
<p>Decoding 1080p in real time is quite a bit of work; it takes about 80% of one of the cores in my desktop&#8217;s Intel Q6600 CPU. So how does the Popcorn Hour do it, without even a fan to cool it down? The heart of the box is the <a href="http://www.sigmadesigns.com/public/Products/SMP8630/SMP8630_series.html">Sigma Designs 8635</a> chip. This is a <a href="http://en.wikipedia.org/wiki/System-on-a-chip">SoC</a> specifically designed for media centers. It has a 300Mhz <a href="http://en.wikipedia.org/wiki/MIPS_architecture">MIPS</a> core, and a bunch of <a href="http://en.wikipedia.org/wiki/Digital_signal_processor">DSP</a>s used for decoding video and audio, as well as video scaling, 2D graphics acceleration, and much more. The chip has an incredible number of interfaces &#8212; everything from audio/video output ports to USB, ethernet, PCI and even <a href="http://en.wikipedia.org/wiki/ISO/IEC_7816">ISO 7816</a>. You can connect this chip to most things you buy in a home electronics store, and a few things in your wallet, too :-)</p>
<p>The <a href="http://en.wikipedia.org/wiki/Printed_circuit_board">PCB</a> has some other components on it &#8212; RAM, a SATA-USB interface chip, an ethernet PHY and a <a href="http://en.wikipedia.org/wiki/High-Definition_Multimedia_Interface">HDMI 1.3a</a> support chip &#8212; but these are all just peripherals hanging off of the 8635. The chip runs cool, evidently &#8212; it has a pretty regular heat sink on it.</p>
<p>The Popcorn Hour runs a piece of software called <a href="http://www.networkedmediatank.com/">Networked Media Tank</a> (NMT). Both the box and this software are made by a company called Syabas, which licences out the software to other manufacturers of media center boxes based on the 8635 chip. There are <strong>lots</strong> of these now; it seems most media centers supporting 1080p are in fact running NMT. They&#8217;re all based on the 8635, and all come with the same generic remote control unit.</p>
<p>Unfortunately, NMT is pretty awful. Coming from XBMC, the Rolls Royce of media centers, using NMT is a huge step backward. The user interface is a disaster in usability, and it&#8217;s ugly and slow. It has only very basic features, nothing fancy or interesting. To give an example: a recent update finally gave the ability to resume watching a movie from where you left off. Hot stuff!</p>
<p>It&#8217;s not going anywhere, either. The Syabas people are evidently concentrating on bug fixes and implementing basic features like that resume. They aren&#8217;t doing a major overhaul of the UI or feature set. This software is never going to be appreciably better than it is now.</p>
<p>So the obvious question is, can you run XBMC on the Popcorn Hour? That would be the best of both worlds: great software running on great hardware. Unfortunately, it&#8217;s not quite that simple. For one thing, XBMC runs only on Intel hardware (and apparently has some machine code, so it&#8217;s not just a matter of recompiling on another platform). It also relies on <a href="http://en.wikipedia.org/wiki/Opengl">OpenGL</a> support for its UI, and uses the CPU for decoding video &#8212; it has no code for offloading that type of operation to another chip. In short, XBMC was made for a very different hardware platform. The XBMC developers don&#8217;t appear to be very interested in porting to a MIPS architecture either. To top it all off, driving the DSPs in the 8635 appears to be somewhat of a closed affair: Sigma Designs doesn&#8217;t even publish a datasheet for it. An open source effort to make decent software for the box is thus not just a lot of work, but may actually involve reverse engineering the video decoding hardware&#8230; a non-trivial task.</p>
<p>So an improved UI for my media center doesn&#8217;t seem likely. Ah well, it wasn&#8217;t all that expensive, and when something better comes out I&#8217;ll look at that. So what would a next-generation media center be? Sigma Designs may come out with a new version of their chip which supports 3D acceleration, and somebody else might then write a decent UI for it. But I dislike closed platforms, and I don&#8217;t think I&#8217;ll throw more money at a media center that is based on a Sigma Designs chip. As long as it&#8217;s closed, we&#8217;re going to be stuck with crap like NMT. After all, if Sigma Designs opened their chip up, their product would have more software written for it, and Syabas would have to clean up their act. Yes, open source is good for competition.</p>
<p>There is light at the end of the tunnel, however. Nvidia just came out with the <a href="http://www.nvidia.com/object/sff_ion.html">ION</a> platform. This is a low-power SoC featuring much the same sort of built-in peripheral interfaces as the Sigma Designs chip, except this one doesn&#8217;t have a CPU core on board &#8212; it has a GeForce 9400M graphics chip instead. Nvidia combines this with an Intel <a href="http://en.wikipedia.org/wiki/Intel_atom">Atom</a> CPU. The Atoms are Intel&#8217;s low-power x86 CPU, marketed towards netbooks and such. Unfortunately, where CPU performance is concerned, they&#8217;re crap. However, Nvidia has announced an upcoming version of ION that uses VIA&#8217;s <a href="http://en.wikipedia.org/wiki/VIA_Nano">Nano</a> CPU &#8212; a direct competitor to the Atom.</p>
<p>The interesting bit about the ION platform is the hardware video decoding on the GeForce portion of it. It can decode 1080p in real time, and I assume (considering its target market) the whole setup can be passively cooled. Nvidia&#8217;s track record with opening up specs for driving their chips is spotty at best &#8212; their linux graphics drivers are still closed, but they did come up with <a href="http://en.wikipedia.org/wiki/CUDA">CUDA</a> (also supported on the ION, by the way &#8212; you can <em>encode</em> video with it!). We&#8217;ll have to see if they&#8217;re more open with this. If they are, an XBMC port to the platform seems likely.</p>
]]></content:encoded>
			<wfw:commentRss>http://biot.com/blog/the-problem-with-current-hd-media-centers/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Navigation DVD hacking</title>
		<link>http://biot.com/blog/navigation-dvd-hacking</link>
		<comments>http://biot.com/blog/navigation-dvd-hacking#comments</comments>
		<pubDate>Fri, 27 Mar 2009 01:11:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://biot.com/blog/?p=6</guid>
		<description><![CDATA[My car has a built-in navigation system with a couple of really annoying nanny features. It wants me to read an inane legal disclaimer and hit &#8220;I Agree&#8221; on the touch screen every time the car starts, and it won&#8217;t let me select new destinations, or dial a phone number, while driving. This is obviously [...]]]></description>
			<content:encoded><![CDATA[<p>My car has a built-in navigation system with a couple of really annoying nanny features. It wants me to read an inane legal disclaimer and hit &#8220;I Agree&#8221; on the touch screen every time the car starts, and it won&#8217;t let me select new destinations, or dial a phone number, while driving. This is obviously not what customers want; it&#8217;s what car manufacturers put in to avoid being sued, and I dislike it.</p>
<p>So I thought I&#8217;d look into it, and see if it can be hacked in some way or another. I didn&#8217;t succeed, unfortunately, and it&#8217;s not really worth spending a huge amount of time on, but I thought I&#8217;d at least document what I did find out.</p>
<p>The DVD has a regular ISO9660 filesystem on it. On the file system are a bunch of <b>.KWI</b> files, and a directory called <b>IDX</b>. KWI stands for KIWI, which is an open standard that describes the format map media in car navigation systems. The standard is managed by a consortium called Kiwi-W, originally made up of Japanese car manufacturers but which now has a wider membership. The standard describing the KIWI file format(s) can be found <a href="http://www.kiwi-w.org/documents_eng.html">here</a>.</p>
<p>A couple of things to note:</p>
<ul>
<li>The map, routing and POI data on the DVD is not encrypted. You can just <a href="http://www.linuxmanpages.com/man1/strings.1.php">strings</a> them and see places and such fly by.</li>
<li>The firmware for the navigation system is <i>also</i> on the DVD, in the LOADING.KWI file.</li>
</ul>
<p>Every KWI file on the DVD has its own binary format; other than a set of defined data types, they don&#8217;t really have much structure in common. The names are standard, however. Since we&#8217;re looking for the code that implements the nanny features, the LOADING.KWI file is what we need: that&#8217;s where all the code is. It&#8217;s essentially a container format, much like a ZIP file. It contains a series of modules with some metadata thrown in. I&#8217;ve written a tool (see below) to view or extract the modules from a LOADING.KWI file. This is what&#8217;s in my DVD&#8217;s LOADING.KWI file:</p>
<pre>
number of systems found: 1
System 1
    Manufacturer ID: 0f 56 a3 00 3c 3c 8a 00 07 00 01 66
    Number of modules in this system: 5
    Module 1:
	Name: V206
	Version: 100J
	Category: Program
	Valid from: 2006-07-17
	Address: 0x800
	Size: 15.2 MB

    Module 2:
	Name: V214
	Version: 100K
	Category: Program
	Valid from: 2006-07-17
	Address: 0xF3F000
	Size: 15.7 MB

    Module 3:
	Name: V308
	Version: 100E
	Category: Program
	Valid from: 2006-06-09
	Address: 0x1EE9000
	Size: 20.5 MB

    Module 4:
	Name: V309
	Version: 100E
	Category: Program
	Valid from: 2006-06-09
	Address: 0x336D000
	Size: 20.4 MB

    Module 5:
	Name: V312
	Version: 100E
	Category: Program
	Valid from: 2006-06-08
	Address: 0x47DC800
	Size: 18.9 MB
</pre>
<p>The manufacturer ID shown consists of a number of fields that describe the location, in latitude and longitude, of the navigation DVD&#8217;s manufacturer&#8217;s HQ. The 13th byte, 07, means they&#8217;re on the 7th floor of the building at that location. You can&#8217;t make this stuff up.</p>
<p>Anyway, if we look at a hexdump of the start of the first module, called V206, this is what we see:</p>
<pre style="width: 50em;">
00000000   2E 4C 44 52  0D 0A 56 32  30 36 31 30  30 4A 0D 0A  .LDR..V206100J..
00000010   4A 75 6C 20  31 34 20 32  30 30 36 00  00 00 0D 0A  Jul 14 2006.....
00000020   32 30 3A 33  35 3A 31 37  00 00 00 00  00 00 0D 0A  20:35:17........
00000030   41 49 53 49  4E 20 41 57  20 63 6F 2E  4C 54 44 00  AISIN AW co.LTD.
00000040   00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  ................
</pre>
<p>So this is some kind of header, and Aisin AW Co Ltd. is clearly the bunch on the 7th floor that made this navigation DVD. They&#8217;re also a leading member of the Kiwi-W consortium. The modules contain other interesting stuff: there are icons in there, in regular BMP format. I extracted some (you can find them by looking for the letters BM &#8212; 42 4d in hex &#8212; in the modules). They were icons I&#8217;ve seen on the navigation display.</p>
<p>Some of the code in there was apparently compiled with symbols. There is also lots of text to be found: debug output, various strings &#8212; and then there&#8217;s this:</p>
<pre style="width: 50em;">
00891070   67 61 E7 E3  6F 2E 00 00  44 72 69 76  65 20 73 61  ga..o...Drive sa
00891080   66 65 6C 79  20 61 6E 64  20 6F 62 65  79 20 74 72  fely and obey tr
00891090   61 66 66 69  63 20 72 75  6C 65 73 2E  0A 57 61 74  affic rules..Wat
008910A0   63 68 69 6E  67 20 74 68  69 73 20 73  63 72 65 65  ching this scree
008910B0   6E 20 77 68  69 6C 65 20  76 65 68 69  63 6C 65 20  n while vehicle
008910C0   69 73 0A 69  6E 20 6D 6F  74 69 6F 6E  20 63 61 6E  is.in motion can
008910D0   20 6C 65 61  64 20 74 6F  20 61 20 73  65 72 69 6F   lead to a serio
008910E0   75 73 20 61  63 63 69 64  65 6E 74 2E  0A 4D 61 6B  us accident..Mak
008910F0   65 20 73 65  6C 65 63 74  69 6F 6E 73  20 6F 6E 6C  e selections onl
00891100   79 20 77 68  69 6C 65 20  73 74 6F 70  70 65 64 2E  y while stopped.
</pre>
<p>That&#8217;s the disclaimer, alright. The &#8220;I Agree&#8221; bit is there as well. So what you do to find the code that puts up the button and waits for the user to hit it, is note down where in the file that string is, and then look for code that references something at that location. And <a href="http://en.wikipedia.org/wiki/NOP">NOP</a> it out.</p>
<p>Alas, it&#8217;s not that simple in this case: the module itself is clearly in some format I don&#8217;t know. It may well be an executable format, like <a href="http://en.wikipedia.org/wiki/Executable_and_Linkable_Format">ELF</a>, or it may be a container format containing several executables and a bunch of icons. I&#8217;m not even sure what CPU the navigation system uses, so randomly looking for references isn&#8217;t going to do much good.</p>
<p>I don&#8217;t really have any more time to spend on this, and I <i>really</i> don&#8217;t want to rip the navigation unit out of the car to look at what CPU is on the motherboard. If anyone has more information, let me know. The car is a Lexus IS 220d, but other Toyota/Lexus models are likely to have the same unit.</p>
<p>The tool I wrote to view/extract modules from the LOADING.KWI file is called &#8220;kiwi&#8221;, and can be downloaded <a href="http://biot.com/f/kiwi">here</a>. You&#8217;ll need python on your system.</p>
]]></content:encoded>
			<wfw:commentRss>http://biot.com/blog/navigation-dvd-hacking/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>USB sniffing on linux</title>
		<link>http://biot.com/blog/usb-sniffing-on-linux</link>
		<comments>http://biot.com/blog/usb-sniffing-on-linux#comments</comments>
		<pubDate>Wed, 18 Mar 2009 08:19:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://biot.com/blog/?p=5</guid>
		<description><![CDATA[The linux kernel has a facility called &#8220;usbmon&#8221; which can be used to sniff the USB bus. It&#8217;s been in there for ages, and the output is really easy to collect, even from the command line shell. Simply mount debugfs and insmod the usbmon module: mount -t debugfs none_debugs /sys/kernel/debug modprobe usbmon Then you can [...]]]></description>
			<content:encoded><![CDATA[<p>The linux kernel has a facility called &#8220;usbmon&#8221; which can be used to sniff the USB bus. It&#8217;s been in there for ages, and the output is really easy to collect, even from the command line shell. Simply mount debugfs and insmod the usbmon module:</p>
<pre>mount -t debugfs none_debugs /sys/kernel/debug
modprobe usbmon
</pre>
<p>Then you can just cat USB traffic like this:</p>
<pre>cat /sys/kernel/debug/usbmon/1u
</pre>
<p>It all comes out in an ASCII dump format which is easily parsed. Every USB bus also has a device file where you can sniff the raw packets straight off the wire. More info in the <a href="http://lxr.linux.no/linux+v2.6.28.8/Documentation/usb/usbmon.txt">usbmon documentation</a>.</p>
<p>But while it&#8217;s all easily parsed if you need it, there aren&#8217;t really any tools around that do it for you. That is&#8230; except for libpcap. Libpcap is the power behind the throne of the venerable <a href="http://www.tcpdump.org/">tcpdump</a> tool. Tcpdump is not much more than a command line parser and pretty-printer of various network protocols. The heavy duty lifting is done by libpcap, not least by providing a cross-platform API for sniffing devices, something that is otherwise non-standard and different on every platform. It&#8217;s great, I&#8217;ve used it before (in <a href="/capstats/">capstats</a>) and it&#8217;s very easy to use.</p>
<p>Libpcap on linux supports usbmon sniffing, which means you can use tcpdump to sniff a USB port and write this to a capture file. But best of all: <a href="http://www.wireshark.org/">wireshark</a>, the all-singing all-dancing network analyzer that uses tcpdump capture files, has USB support as well.<br />
So this is the result:</p>
<p class="aligncenter">
<a href="/p/wireshark-usb.png"><img src="/p/.cache/wireshark-usb.png" alt="Wireshark screenshot" /></a>
</p>
<p>The screenshot shows a filter applied to only see device 18 on the sniffed USB bus. That&#8217;s an <a href="http://arduino.cc">arduino</a>, i.e. an FTDI USB-serial chip. The FTDI chips send status updates to the USB host system every 16ms (!). The status update consists of a two-byte message (described <a href="http://lxr.linux.no/linux+v2.6.28.7/drivers/usb/serial/ftdi_sio.h#L1334">here</a>). This is actually present in every packet coming in from the FTDI chip; status updates just don&#8217;t have any other data. So for a clean sniffing session from the arduino, we want to filter out any packets  that are < 3 bytes in length.</p>
<p>The end result is serial data which the arduino sent to the host system. The screenshot shows a session on my arduino shell, <a href="/arsh/">arsh</a>. This is great stuff &#8211; wireshark includes a massive amount of analysis tools and lots of options for filtering and otherwise massaging your captured data.</p>
<p>You need relatively recent versions of libpcap, tcpdump and wireshark for this. I compiled all three of these out of their respective repositories (easy compile all). On my ubuntu system, the libpcap version was particularly old. Tcpdump doesn&#8217;t have a pretty-printer for USB data yet, so you can only dump to a capture file for processing by wireshark.</p>
]]></content:encoded>
			<wfw:commentRss>http://biot.com/blog/usb-sniffing-on-linux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

