<?xml version="1.0" encoding="iso-8859-1"?>
<!-- name="generator" content="pyblosxom/1.5rc3 20110618" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
<channel>
<title>Kristof's complaints</title>
<link>http://www.sigsegv.be/blog</link>
<description>Because there aren't enough idiots on the Internet already.</description>
<language>en</language>
<item>
  <title>A brief rant.</title>
  <link>http://www.sigsegv.be/blog/A_brief_rant.html</link>
  <description><![CDATA[
<p>
	Observe the <a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff561606%28v=vs.85%29.aspx">
	NdisAllocateMemoryWithTagPriority</a>[1] function.
</p>
<pre>
PVOID NdisAllocateMemoryWithTagPriority(
  __in  NDIS_HANDLE NdisHandle,
  __in  UINT Length,
  __in  ULONG Tag,
  __in  EX_POOL_PRIORITY Priority
);
</pre>
<p>
	Read the documentation:
</p>
<pre>
</i>Tag [in]</i>
    A string, delimited by single quotation marks, with up to four characters, usually specified in reversed order. 
    The NDIS-supplied default tag for this call is 'maDN', but the caller can override this default by supplying an explicit value.
</pre>
<p>
	That's right. Pass that string as a ULONG please. I just don't have the words.
</p>
<p>
	[1]Think kmalloc, but harder to type.
</p>

]]></description>
</item>

<item>
  <title>World IPv6 day</title>
  <link>http://www.sigsegv.be/blog/world_IPv6_day.html</link>
  <description><![CDATA[
<p>
	A little while ago (well, a long while, but I've been busy) the 
	<a href="http://www.isoc.org/">Internet Society</a> organised 
	<a href="http://www.worldipv6day.org/">World IPv6 day</a>.
</p>
<p>
	I'm not going to bother explaining what that was about, I'm sure everyone knows 
	by now. Instead, I'm going to complain about a 
	<a href="http://www.sigsegv.be/blog/ipv6_planet_grep.1024px">little experiment</a> 
	I did more than three years ago.
	Hopefully all the buzz around World IPv6 day and the IANA pool exhaustion has encouraged
	a few more people to offer their blog over modern IPv6, in addition to crusty old IPv4.
</p>
<p>
	The results are, ... well, results. Three years ago there was one blog in Planet Grep which 
	was reachable on the IPv6 internet. This blog is still there (though with a different IP)
	and there's all of four more. That's 5 out of 69, or 7.24%.
	<br/>
	Just for fun I reran the test on the current list of blogs on Planet Grep. 7 of 97 
	sites, or 7.21% have an IPv6 address.
	<br/>
	Not exactly great that. On the bright side: at least the sites which advertise quad-A records 
	are indeed reachable on those addresses, and the one site which had an IPv6 address
	back in 2008 still has one.
</p>
<p>
	Come on guys (and girls obviously), we can do better than this.
</p>


]]></description>
</item>

<item>
  <title>Change is a constant</title>
  <link>http://www.sigsegv.be/blog/change_is_constant.html</link>
  <description><![CDATA[
<p>
  Just in case I haven't told everyone yet, I'll be leaving my current employer mid January.
  From then on I'll be freelancing. I've already got a <a href="http://www.codepro.be">website</a> 
  and everything. (Well, not everything. In fact, just the website, but the rest is being worked on.)
</p>

<p>
  Why? Well, two reasons really, the first is that a really interesting project and the second
  is the bad influence <a href="http://www.codematters.be/">of</a> 
  <a href="http://cobbaut.blogspot.com/">a</a> <a href="http://www.paeps.cx">few<a> 
  <a href="http://jabberwocky.eu/">friends</a>.
</p>

<p>
  If you have a problem, if no one else can help, ...<br/>
  Well, you should probably call the <a href="http://en.wikipedia.org/wiki/The_A-Team">A-Team</a>,
  but you've got a software problem you should call me. The A-Team doesn't know anything about software.
</p>

]]></description>
</item>

<item>
  <title>Tcptrack 1.4.0</title>
  <link>http://www.sigsegv.be/blog/tcptrack.html</link>
  <description><![CDATA[
<p>
  <a href="http://www.rhythm.cx/~steve/devel/tcptrack/">Tcptrack</a> 1.4.0 is out.
  This version supports IPv6. Blame yours truly for any bugs you find.
</p>


]]></description>
</item>

<item>
  <title>Don&#x27;t lie to me!</title>
  <link>http://www.sigsegv.be/blog/Don_t_lie_to_me.html</link>
  <description><![CDATA[

<p>
  while toying with my <a href="unproductive.1024px">little project</a> I decided that things would be much simpler
  if I could netboot the board. Unfortunately the bootloader does not provide this functionality.

U-boot can do this, so we'll just be evil and have the native bootloader (which I can't upgrade)
boot U-boot, and have U-boot load the FreeBSD kernel (While I'm on the subject: I've gotten it to boot again.).
</p>

<p>
While adding support for my board I ran into the following error message:
<pre>
	make: *** No rule to make target `ts7800_config'.  Stop.
</pre>

Clearly I forgot to add something in the makefiles.
After an hour of fruitless makefile reading I discovered the cause: a little shell script to generate the 
configuration. The mkconfig script searches a file I hadn't edited yet.

Here's the relevant code:
<pre class="sh_sh">
     line=`egrep -i "^[[:space:]]*${2}[[:space:]]" boards.cfg` || {
                echo "make: *** No rule to make target \`$2_config'.  Stop." &gt;&amp;2
		exit 1  
</pre>

Can you spot what upset me? <br/>
Don't lie to me when reporting errors!
If it hadn't pretended to be make I'd have found the problem instantly.
</p>
<p>
Now to get U-boot to actually start...
</p>


]]></description>
</item>

<item>
  <title>Reverse the polarity!</title>
  <link>http://www.sigsegv.be/blog/Reverse_the_polarity.html</link>
  <description><![CDATA[
<p>
  It was a dark and stormy night.
  Well, not really. It was more of a sunny afternoon but I promised 
  <a href="http://www.grep.be/blog/">Wouter</a> I would
  start my next blog post with the famous <a href="http://en.wikipedia.org/wiki/It_was_a_dark_and_stormy_night">
  Bulwer-Lytton</a> sentence.
</p>
<p>
  So, anyway, it wasn't a dark and stormy night but a bright and sunny afternoon a few weeks ago when I ordered a USB
  charging cable for my cell phone. They're unreasonably expensive in Belgium but I found a great deal on 
<a href="http://www.dealextreme.com">DealExtreme</a>. A Genuine&copy; Immitation&#8482; Nokia&reg;-Like one even.
</p>
<p>
  Today the cable arrived but when I plugged in my phone it refused to charge.<br/>
  Linux complained too:
<pre>
[959307.552135] hub 5-0:1.0: over-current change on port 2
</pre>
</p>
<p>
  Clearly something was wrong with the cable. Two minutes with a multimeter and a working cable for comparison 
  showed that somehow the ground and +5V connections were inverted.
  <br/>
  15 minutes with a soldering iron fixed that. All in all I got a great deal: a charging cable, half an hour of
  entertainment and that lovely feeling of having fixed something for less than a quarter of the price of
  a genuine Nokia cable.
</p>
<p>
  Beware of geeks with soldering irons.
</p>


]]></description>
</item>

<item>
  <title>You&#x27;re doing it wrong!</title>
  <link>http://www.sigsegv.be/blog/you_re_doing_it_wrong.html</link>
  <description><![CDATA[
<p>
  It's been far too long since I've really complained about something.
</p>
<p>
  ${Work} has decreed that passwords must be changed regularly and today it was my turn.
  Fine, despite the usual silliness in reducing the key space (by enforcing certain sets 
  of characters to be present) and a ridiculous maximum length of 8 characters, 
  I can deal with that. <a href="http://nsd.dyndns.org/pwsafe/">pwsafe</a> generates and
  remembers the password for me. After a while I even manage to remember it myself.
</p>
<p>
  Clearly that's not a good rant. This, however, is worth complaining about:
</p>
<p>
  <img src="/images/how_not_to_do_web_development.png" alt="How _not_ to do web development"/>
</p>
  That's the brand shiny new piece of *(*^#%*@% password change tool I'm supposed to use to change my password.
  The first thing it does is demand four security questions. Yes, that's right, someone's been stupid
  enough to think they do anything other than <b>reduce</b> security.
  <br/>
  I did the obvious thing:
<pre>
  dd if=/dev/urandom bs=1k count=10 | md5sum
</pre>
  Just divide the result in four more or less equal parts and there's the answers to the insecurity questions.
  Simple, except it rewards me with the above session timeout.
  <br/>
  Note that 'back' and 'forward' should not be used, in defiance of 20 years of precedent.
  Also note that if you're a slow reader you'll just get the login page again.
  <br/>
  After all, it's not nice to show error messages to the users. It upsets them so 
  it's best to hide them as soon as possible.
<p>
  

]]></description>
</item>

<item>
  <title>Lies, damned lies and ...</title>
  <link>http://www.sigsegv.be/blog/Lies_Damned_Lies_and_.html</link>
  <description><![CDATA[
<p>
The build system at work needed a bit of a cleanup. It's a fairly standard autoconf/automake deal
which has been extended by people who don't understand those tools. This is understandable. There 
are after all very few people who truly do. I certainly don't.
</p>
<p>
Still, seeing HOST be confused with TARGET does indicate there's a problem.
</p>

<p>
While I don't know much about autotools I do know a thing or two about plain old make.
I spent some time setting up a non-recursive build system, borrowing heavily from the
Linux kernel build system bag of tricks.
<br/>
After a little work I got the first few applications building with the new system.
Before committing it I wanted some performance numbers. Sure, the new system is 
(at least in my opinion) much cleaner, simpler, and powerful, but a faster build 
is something every developer cares about.
</p>
<p>
Measuring build times can be a little tricky as they could vary significantly due to 
caching, other processes running on the system, ...
<br/>
The mathematical tools to deal with this exist, but who wants to spend hours refreshing
statistics courses? Fortunately there's a very simple tool to do exactly the kind of statistical
calculations benchmarks call for: <a href="http://svn.freebsd.org/viewvc/base/head/usr.bin/ministat/ministat.c?revision=189934&view=markup">ministat</a>.
All you need to do is hand it two files with the results to compare.
<br/>
It's a FreeBSD tool, getting it to work on Linux is a (trivial) exercise left for the reader.
</p>

<p>
Here's the output of 11 test runs of both the old (autotools, recursive make) and the
new (plain make, non-recursive) system when running 6 jobs simultaneously.
<pre>

x old-system.txt
+ new-system.txt
+------------------------------------------------------------------------------+
|+                                                                          x  |
|+                                                                          x  |
|+                                                                          x  |
|++                                                                         x  |
|++                                                                         x  |
|++                                                                         xx |
|++                                                                         xxx|
|A|                                                                         A| |
+------------------------------------------------------------------------------+
    N           Min           Max        Median           Avg        Stddev
x  11        662.44        673.03        663.69     665.20545      3.224591
+  11        324.47        329.55        326.46     326.61364     1.8295151
Difference at 95.0% confidence
  -338.592 +/- 2.3318
  -50.9003% +/- 0.350539%
  (Student's t, pooled s = 2.62156)

</pre>
</p>

<p>
The results surprised me a little: because there's so little variation in the results, but mostly
because the build time with the new system is so much better.
There's little variance in these results so simply comparing the first measurements 
would have told us the same thing. On the other hand, now we <b>know</b>.
</p>
<p>
I believe I'll have little trouble convincing my coworkers that the new system is better.
</p>


]]></description>
</item>

<item>
  <title>Tele-M@te</title>
  <link>http://www.sigsegv.be/blog/Tele-Mate.html</link>
  <description><![CDATA[
<p>
  Dad brought home a GSM module. I was supposed to figure out how to use 
  it to provide remote access to a panel PC.
  <br/>
  There's no documentation with the device of course, because that would be far too easy.
  </br>
  There's a sticker with an URL on it, presumably the website of the manufacturer.
  <a href="http://www.NeoConnex.com">www.NeoConnex.com</a> which fails to resolve. Goody.
</p>
<p>
  <img alt="Tele-M@te" src="/images/Tele-Mate.jpg"/>
</p>
<p>
  It's got 4 connections marked 'In', 4 marked 'out, two sets of TX/RX, two grounds and one marked 24V.
  There's also one marked 'K', no idea what that one does.

  On the inside I found a Morotola G18 GSM module, a Rabbit 2000 microprocessor and tucked away 
  at the top a MAX-232 chip. 
</p>
<p> 
  It looks like the device has two serial ports so I assume it's basically a serial modem. 
  Getting it to work should be a simple matter of issuing the correct AT commands. Fortunately 
  the Morotola module documentation is easy to find.

  After soldering together a DB-9 connector and hooking it up at 9600 baud, 8N1 it produces a prompt of sorts:
  <blockquote>
    <pre>
OK
    </pre>
  </blockquote>

  Unfortunately that's the end of the good news. It doesn't respond to AT commands, or rather it always responds with
  <blockquote>
    <pre>
Expected setting or rule
ERROR
    </pre>
  </blockquote>
</p>
<p>
  Inserting a SIM card doesn't help, but it does complain about a bad PIN code. 
  After a few more attempts I give up that approach and start looking for the PUK code to unlock my SIM again.
</p>
<p>
  After some more negotiation with Google the <a href="http://www.archive.org/web/web.php">Wayback machine</a> turns 
  up an old copy of the 
  <a href="http://web.archive.org/web/20051026105226/http://www.neoconnex.com/">www.neoconnex.com</a> website.
  It looks like the company disappeared soon after October 2005.
  <br/>
  The manual on the website reveals the device can't be used as a modem but can send SMS based on its inputs,
  or set the outputs when it receives an SMS. 
  These actions can be configured according to rules set through a program called 'Tele-M@te Commander'. <br/>
  That explains the error message when entering AT commands.<br/>
</p>
<p>
  The Wayback Machine doesn't have the program so I'm completely stuck. 
  Copies of 'Tele-M@te Commander' or an ISP for a Rabbit 2000 micro controller can be exchanged for beer.
</p>


]]></description>
</item>

<item>
  <title>Less useless</title>
  <link>http://www.sigsegv.be/blog/less_useless.html</link>
  <description><![CDATA[
<p>
  For a while I've been trying to get FreeBSD to boot on my TS-7800.<br/>
  It's getting close, but it's not quite there yet. I'm currently struggling with 
  the network driver (mge(4)) and the Marvell 88EE1118 PHY. There seems to be a problem
  with the auto negotiation.
</p>
<p> 
  It still doesn't work, but I did find a bug in the PHY driver which got 
  <a href="http://svn.freebsd.org/viewvc/base?view=revision&revision=197587">patched</a>
  yesterday. I was slightly useful!
</p>

]]></description>
</item>

</channel>
</rss>

