<?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>The Jimmo Articles</title>
	<atom:link href="http://www.jimmo.org/mind/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.jimmo.org/mind</link>
	<description>Cogitations, comments and opinions on things that interest me</description>
	<lastBuildDate>Sun, 05 Sep 2010 06:42:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Spam is not an effective e-marketing strategy!</title>
		<link>http://www.jimmo.org/mind/?p=442</link>
		<comments>http://www.jimmo.org/mind/?p=442#comments</comments>
		<pubDate>Tue, 27 Jul 2010 10:15:28 +0000</pubDate>
		<dc:creator>Jimmo</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jimmo.org/mind/?p=442</guid>
		<description><![CDATA[Thinking of embarking on an electronic mailing campaign? Be very careful which distribution list you use!]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.jimmo.org/mind/wp-content/uploads/2010/07/fhudsonk.jpg" alt="" title="fhudsonk" width="630" height="250" class="aligncenter size-full wp-image-447" /><br />
When a self-titled &#8220;award winning entrepreneur&#8221; sends you unsolicited marketing email (otherwise known as spam), one has to assume that none of those awards were for e-marketing.  If you&#8217;re trying the electronic equivalent of a mail shot, you really need to be sure that the distribution list you use contains well-qualified addresses of people who have actually subscribed, or registered an interest, in these communications&#8230;and those sorts of list cost money!</p>
<p>Today I received one such unsolicited email from someone called <b>Fiona Hudson-Kelly</b>.  In this spam, she describes herself as an &#8220;award winning entrepreneur&#8221; offering to train folks on modern marketing tools, including email campaigns.  Naturally, this spam includes an &#8220;unsubscribe&#8221; link, despite never having subscribed.  I know this because (a) I never subscribe to any such list and (b) the address I received it on wouldn&#8217;t be used for any such purpose.  In other words, it was a spammers list of trawled email addresses.</p>
<p>Here&#8217;s an excerpt&#8230;</p>
<blockquote><p><i>The internet has changed the way in which we reach clients, have you brought your marketing techniques up to date to make the most of these new opportunities? You can now send out an e-mail campaign and watch to see who opens your e-mails and who visits xxx web site, you can then use other marketing methods to reach these people including telemarketing which is very targeted or direct mail to those who have shown an interest.</i></p></blockquote>
<p>Oh, the irony!  An example of how not to conduct an e-mail campaign right there &#8211; for free!  Their website, at the time of writing, was broken and a google for their name pulls up a load of self-referential hits but little from any 3rd party, aside from a couple of other folks pointing out the foot-in-mouth nature of spamming folks while claiming to be in a position to train budding entrepreneurs on e-marketing!  Her twitter and LinkedIn pages are also incongruously light for someone who so blatantly lauds their own status.</p>
<p>The lesson is simple. <b>DO NOT SPAM POTENTIAL CUSTOMERS!</b>  Nothing damages your credibility more.  If you want to drum up a business training junior entrepreneurs or consulting on small businesses, then do it properly with a well-constructed site and appropriate links/materials in electronic and paper press.  (Google Chris Cardell for an example of someone who does a much better job of getting people to opt-in, although getting <b>off</b> his mailing list seems to be nigh on impossible).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jimmo.org/mind/?feed=rss2&amp;p=442</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Homosexuals granted right to apply for asylum</title>
		<link>http://www.jimmo.org/mind/?p=439</link>
		<comments>http://www.jimmo.org/mind/?p=439#comments</comments>
		<pubDate>Wed, 07 Jul 2010 13:11:38 +0000</pubDate>
		<dc:creator>Jimmo</dc:creator>
				<category><![CDATA[Society]]></category>

		<guid isPermaLink="false">http://www.jimmo.org/mind/?p=439</guid>
		<description><![CDATA[The Supreme Court in the UK has today ruled that one can apply for asylum on the basis of persecution for having a non-heterosexual orientation. In this specific case, two men had previously been refused asylum on the basis that they could effectively live &#8220;in...]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.jimmo.org/mind/wp-content/uploads/2010/07/asylum.jpg" alt="" title="asylum" width="630" height="250" class="aligncenter size-full wp-image-438" /><br />
The Supreme Court in the UK has today ruled that one can apply for asylum on the basis of persecution for having a non-heterosexual orientation. In this specific case, two men had previously been refused asylum on the basis that they could effectively live &#8220;in the closet&#8221; in their home countries to avoid persecution.  You can read more about it in this <a href="http://news.bbc.co.uk/1/hi/uk/10180564.stm">BBC news article</a>.</p>
<p>Sadly, homophobia is still all too prevalent in the world &#8211; even now, in the 21st century.  Worse still, there are homophobic states that have institutionalized prejudice against non-heterosexuals, which can include prison sentences or even execution!  As a civilized nation, I believe it is absolutely correct that we should protect people from such persecution as a point of principle.</p>
<p>However, there are some other issues here that are beyond that simple point of principle.  Firstly, the individuals in question had to cross a lot of other countries to get to the United Kingdom, some of whom are also signatories to the Refugee Convention and are &#8220;liberal European states&#8221;.  Why is it that one has to come all the way to the UK specifically to file such a claim for asylum, I wonder?</p>
<p>Secondly, I think more diplomatic pressures need to be applied to such homophobic countries (with a zero-tolerance policy at home) because there are a huge number of non-heterosexual folk out there and asylum isn&#8217;t the long term solution!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jimmo.org/mind/?feed=rss2&amp;p=439</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alpha Course poll says there is no god</title>
		<link>http://www.jimmo.org/mind/?p=425</link>
		<comments>http://www.jimmo.org/mind/?p=425#comments</comments>
		<pubDate>Sat, 24 Oct 2009 07:11:00 +0000</pubDate>
		<dc:creator>Jimmo</dc:creator>
				<category><![CDATA[Atheism]]></category>

		<guid isPermaLink="false">http://www.jimmo.org/mind/?p=425</guid>
		<description><![CDATA[A Christianity activist group called the Alpha Course has been running an online poll to determine what proportion of those taking the poll believe in god or not. The poll was rather cynically loaded by having two positive options (&#8220;yes&#8221; and &#8220;probably&#8221;, the latter of...]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.jimmo.org/mind/wp-content/uploads/2009/10/alphapoll.png" alt="" title="alphapoll" width="630" height="250" class="aligncenter size-full wp-image-424" /><br />
A Christianity activist group called the <a href="http://uk.alpha.org/">Alpha Course</a> has been running an online poll to determine what proportion of those taking the poll believe in god or not.  The poll was rather cynically loaded by having two positive options (&#8220;yes&#8221; and &#8220;probably&#8221;, the latter of which is intended to capture as many &#8220;maybe&#8221; votes as possible) and one negative option (&#8220;no&#8221;).  Naturally, if this had worked the way the Alpha Course intended, they would be crowing about how only x-percent did not believe in god, etc..</p>
<p>
Unfortunately for the Alpha Course, their assumption that the majority view aligned with theirs was spectacularly blown out of the water by the poll result which &#8211; at the time of writing &#8211; shows that 97% of respondents think there is no god.</p>
<p>
Naturally, their response to this was that the poll result must have been rigged by a coordinated campaign to skew the results with the Alpha Course spokesman, Mark Elsdon-Dew, going on to say that <i>&#8220;I don&#8217;t think this is indicative of people&#8217;s faith in this country&#8221;</i>.</p>
<p>
Well, yes &#8211; it is possible for any online poll as superficially implemented as this one to be deliberately skewed (let&#8217;s not forget the skewing factor of the loaded poll options, by the way).</p>
<p>
On the other hand, it&#8217;s also possible that the general result is correct &#8211; even if you allow a fat margin of error for deliberate skewing votes, the results are so polarized that one would still end up with a negative majority.</p>
<p>
If nothing else, this is a great example of confirmation bias &#8211; if the result agreed with their own beliefs, it would be lauded as a vindication.  Now that it&#8217;s overwhelmingly contrary to their beliefs, it just <i>has</i> to be a deliberately skewed result that doesn&#8217;t represent the &#8220;true&#8221; sentiment.</p>
<p>
Statistical research and analysis needs to be conducted with exacting discipline. One of the reasons why statistics are so notoriously unreliable is because they are, more often than not, gathered by people who just don&#8217;t know what they&#8217;re doing!  Without truly understanding the science of statistics, it&#8217;s all too easy to bias or misinterpret the outcome (deliberately or inadvertently).</p>
<p>
As for this fatuous poll by the Alpha Course, well&#8230;they only have themselves to blame <img src='http://www.jimmo.org/mind/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jimmo.org/mind/?feed=rss2&amp;p=425</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extortionate immigration fees &amp; gratuitous hurdles</title>
		<link>http://www.jimmo.org/mind/?p=410</link>
		<comments>http://www.jimmo.org/mind/?p=410#comments</comments>
		<pubDate>Wed, 16 Sep 2009 10:32:23 +0000</pubDate>
		<dc:creator>Jimmo</dc:creator>
				<category><![CDATA[Society]]></category>
		<category><![CDATA[citizenship test]]></category>
		<category><![CDATA[ILR]]></category>
		<category><![CDATA[immigration]]></category>
		<category><![CDATA[life in the UK]]></category>
		<category><![CDATA[visa]]></category>

		<guid isPermaLink="false">http://www.jimmo.org/mind/?p=410</guid>
		<description><![CDATA[I&#8217;m extremely annoyed that legitimate immigrants are financially penalized and gratuitously impeded while illegal immigrants can take advantage of free support and representation via legal aid etc.. One of my staff, a hard working professional who pays all her taxes, is married to a United...]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.jimmo.org/mind/wp-content/uploads/2009/09/ukba.png" alt="" title="ukba" width="700" height="300" class="aligncenter size-full wp-image-416" /><br />
I&#8217;m extremely annoyed that legitimate immigrants are financially penalized and gratuitously impeded while illegal immigrants can take advantage of free support and representation via legal aid etc..</p>
<p>One of my staff, a hard working professional who pays all her taxes, is married to a United Kingdom citizen.  In addition to the hundreds of pounds spent getting her marriage visa, they are now forced to pay a whopping <b>&pound;820</b> for an <i>Indefinite Leave to Remain</i>, which allows her to reside indefinitely within the UK.  This seems to be an extortionate fee for what should be mostly a routine bit of paperwork, especially after all the due diligence has already been done for the granting of the original marriage visa <i>and</i> subsequent &#8220;certificate of approval&#8221; that one also needs to apply for before the marriage.</p>
<h4>Gratuitous memory test</h4>
<p>Another prerequisite, in addition to this fee, is that she passes the <a href="http://www.lifeintheuktest.gov.uk/htmlsite/index.html">Life in the UK</a> &#8220;citizenship&#8221; test. This, of course, cost an additional fee which is currently <b>&pound;33.28</b>.</p>
<p>I find it quite reasonable to ensure that people who seek to reside indefinitely in the UK have a sufficient command of the local language to get by, together with a reasonable level of understanding about the country.  However, the test comprises of questions that very, very few native born British citizens can answer &#8211; certainly not to the required 75% pass mark (including myself and every one of the degree educated IT professionals in my office).  For example:</p>
<p><b><i>Why did the Huguenots come to Britain in the 16th and 17th centuries?</p>
<p>In which year did 18 year olds get the right to vote?</p>
<p>When did Britain join the European Economic Community?</i></b></p>
<p>What the hell do these questions have to do with living in the UK as a regular, normal citizen? Perhaps next time I&#8217;m in the bank or supermarket they will refuse to serve me?  I can see ATM&#8217;s flashing questions up like &#8220;Trivial Pursuit&#8221; quiz machines&#8230;</p>
<div align="center"><img src="http://www.jimmo.org/mind/wp-content/uploads/2009/09/atmtest.jpg"></div>
<p>I mean, come on!  Who really needs to know stuff like this to go about their daily business?  I find this entire test to be nothing but a revenue generating obstacle which is both cynical and discriminatory.  For shame!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jimmo.org/mind/?feed=rss2&amp;p=410</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Should I use a physical or virtual memory model?</title>
		<link>http://www.jimmo.org/mind/?p=387</link>
		<comments>http://www.jimmo.org/mind/?p=387#comments</comments>
		<pubDate>Wed, 09 Sep 2009 05:26:12 +0000</pubDate>
		<dc:creator>Jimmo</dc:creator>
				<category><![CDATA[OS Development]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[OS development]]></category>

		<guid isPermaLink="false">http://www.jimmo.org/mind/?p=387</guid>
		<description><![CDATA[One of the most important considerations for your OS kernel is memory management. For all but the very simplest of environments, your kernel is going to need memory allocation and deallocation (free) facilities. This, of course, means carving off a &#8220;chunk&#8221; of memory each time...]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.jimmo.org/mind/wp-content/uploads/2009/09/ddpov.jpg" alt="" title="ddpov" width="700" height="300" class="alignnone size-full wp-image-408" /><br />
One of the most important considerations for your OS kernel is memory management. For all but the very simplest of environments, your kernel is going to need memory allocation and deallocation (free) facilities.  This, of course, means carving off a &#8220;chunk&#8221; of memory each time somebody asks for some and managing it when they give it back.  You also have the small, circular problem of allocating memory to hold the data structures your memory allocator needs to manage the memory it&#8217;s allocating!</p>
<p>Before we even get there, we have a more fundamental consideration.  From whence does this memory come and how do we manage <b>that</b>?  Well, the system has an amount of physical memory and the simplest model is to use it &#8220;as is&#8221; &#8211; which of course means referring to that memory via its physical addresses.</p>
<p>While this makes memory management a little easier, it causes some other complications for our OS.  For starters, if we&#8217;re using physical addresses then we&#8217;re going to be constrained by the amount of physical memory installed in the system at run time. This might not seem like much of a problem at first, as pretty much every machine will have at least 4 MB and that&#8217;s plenty of space for a simple, toy kernel &#8211; and if you use <a href="http://www.gnu.org/software/grub/">GRUB</a> to boot your kernel, you&#8217;ll probably end up loaded on the 1 megabyte boundary (physical address <code>0x100000</code>) in a 32-bit &#8220;flat&#8221; protected mode.</p>
<p>However, having your hand up the skirt of the boot loader and making a load of assumptions about your environment isn&#8217;t wise.  In the case of multiboot compliant boot loaders like GRUB, the <a href="http://www.gnu.org/software/grub/manual/multiboot/html_node/index.html">multiboot specification</a> doesn&#8217;t define your load address, or even a valid stack pointer, as part of the specification which means that these are officially <b>undefined</b> and you should write your code accordingly!</p>
<p>If we can&#8217;t be sure what our addresses will be, we&#8217;ll have to write code that is position independent. This is fine for loadable modules but might be a bit of a hassle if the entire kernel has to be this way.</p>
<p>Moreover, you may want to have more flexibility about how the memory address space appears to your kernel and, if you implement it, user land &#8211; it can be helpful to be able to reference a contiguous address space.  This becomes much more important if you want to take advantage of other &#8220;virtual memory&#8221; features like extending the amount of apparent available memory by paging between memory and disk.</p>
<h3>So virtual memory is the way to go?</h3>
<p>Well, not necessarily. Mainstream operating systems that are &#8220;general purpose&#8221; or intended to be used across platforms of varying configurations typically need to implement virtual memory to provide a consistent, generic environment between systems.  However, operating systems intended for very specific hardware architectures and/or embedded systems don&#8217;t always need this degree of flexibility.</p>
<p>Now let&#8217;s be honest &#8211; whatever lofty goals we have in mind, the reality is that the vast majority of &#8220;hobby operating systems&#8221; will never be that widely used and indeed, most will never make it further than your own eyeballs.  Do you really need a full virtual memory implementation?  You could just muddle on with physical memory only or, if the architecture supports it, use segmentation.</p>
<p>However, both of those approaches also have their disadvantages and besides, writing a toy kernel is as much a <i>learning exercise</i> as anything else &#8211; so for most of the other articles in the <b>OS Development/Memory</b> section, I&#8217;m going to assume you <i>do</i> want to implement a page-based virtual memory management system.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jimmo.org/mind/?feed=rss2&amp;p=387</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Atheism and morality</title>
		<link>http://www.jimmo.org/mind/?p=315</link>
		<comments>http://www.jimmo.org/mind/?p=315#comments</comments>
		<pubDate>Sun, 06 Sep 2009 09:08:00 +0000</pubDate>
		<dc:creator>Jimmo</dc:creator>
				<category><![CDATA[Atheism]]></category>
		<category><![CDATA[morality]]></category>
		<category><![CDATA[Reason]]></category>

		<guid isPermaLink="false">http://www.jimmo.org/mind/?p=315</guid>
		<description><![CDATA[Those who are antipathetic to atheism sometimes assert that atheists are inherently immoral, as morality is derived from God via scripture and therefore a rejection of religion denies the atheist from that moral frame of reference. It&#8217;s particularly important to debunk this argument because it...]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.jimmo.org/mind/wp-content/uploads/2009/09/amoral.png" alt="" title="amoral" width="700" height="300" class="alignleft size-full wp-image-325" /><br />
Those who are antipathetic to atheism sometimes assert that atheists are inherently immoral, as morality is derived from God via scripture and therefore a rejection of religion denies the atheist from that moral frame of reference.</p>
<p>It&#8217;s particularly important to debunk this argument because it cynically attempts to impugn the character of atheists as a form of &#8220;straw man&#8221; argument, to distract from the pivotal issue of the existence of God (and, in some militant cases, to try and intimidate others who might be questioning their faith).</p>
<p>There are some fundamental flaws to the argument that atheists must, by definition, be amoral.  The first is the assertion that morality is derived from God via scripture, as this as an objective morality.  The notion of an objective morality is philosophically questionable, as we know that moral viewpoints have shifted and evolved over the years. What society once viewed as morally acceptable is not necessarily so today.  Even then, we can see differences in moral outlooks between countries and cultures in the present day.  Almost every major conflict in the world today is between parties who each believe they have the moral high ground (whether we agree with them or not).  Few consciously take a contrary view out of malice aforethought.</p>
<p>The usual response to this is that the God&#8217;s morality, as described in scripture, is not the same as human morality; it is divine and absolute. This falls immediately foul of another problem, which is that scripture contains some things that most of us (religious or not) would not consider morally acceptable today.  This is unsurprising as human morality changes over time&#8230;but this is conflict with the assertion that it&#8217;s origins are from divine morality.  How does one square that circle?</p>
<p>Ah, well, we&#8217;re told that due to its age, scripture cannot be interpreted literally, it needs to be contextualized for a modern setting.  Once again, we run into a fundamental problem because if our morality is founded on these religious sources, how can we re-interpret these dictates except by drawing on an <i>external</i> moral frame of reference?  We&#8217;re forced to conclude that our morality cannot originate solely from the teachings of scripture and hence the argument crumbles.</p>
<h4>Infamous baby-eating, mass-murdering despots were all atheist</h4>
<p>Let&#8217;s now turn to another facet of the amoral atheist argument, which seeks to substantiate the position by asserting that one or more infamous villains from history was atheist (Hitler, Stalin, Pol Pot, etc.).  This isn&#8217;t even true in most cases. Hitler, for example, <a href="http://en.wikipedia.org/wiki/Adolf_Hitler%27s_religious_beliefs">was not an atheist</a> and most white supremacists, particularly in the US, are most certainly <b>not</b> atheist. Further, many of the cited communist leaders opposed religion not on atheistic grounds but because organized religion was perceived as a threat to the state&#8217;s power monopoly.</p>
<p>Leaving aside the factual uncertainty over the religious beliefs of the specified villain, this is a simple logical fallacy &#8211; correlation does not imply causation.  That&#8217;s like asserting that because cost serial killers are white, most white people are potential serial killers!  Trait based generalizations are almost guaranteed to be flawed.  Besides, even if one of these historical villains were atheist, they were not carrying out their heinous deeds in the name of atheism (unlike, I might point out, some atrocities carried out under the banner of religion).</p>
<h4>Atheism is unrelated to morality</h4>
<p>In conclusion, the argument that atheism engenders immorality is founded on entirely groundless assumptions and a number of logical fallacies.  It really carries no intellectual weight whatsoever.  I propose that this argument is so popular simply because it aligns with the proponents world view and hence confirmation bias prevents them from questioning it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jimmo.org/mind/?feed=rss2&amp;p=315</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Identifying installed floppy drives</title>
		<link>http://www.jimmo.org/mind/?p=265</link>
		<comments>http://www.jimmo.org/mind/?p=265#comments</comments>
		<pubDate>Fri, 04 Sep 2009 15:28:55 +0000</pubDate>
		<dc:creator>Jimmo</dc:creator>
				<category><![CDATA[floppy]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[OS development]]></category>

		<guid isPermaLink="false">http://www.jimmo.org/mind/?p=265</guid>
		<description><![CDATA[If you&#8217;re implementing support for floppy drive controllers in your hobby OS kernel, then one of your first tasks is to identify what floppy drives are installed in the system. This is pretty easy to do, as we can interrogate the system configuration to find...]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.jimmo.org/mind/wp-content/uploads/2009/09/fdident.png" alt="" title="fdident" width="700" height="300" class="alignleft size-full wp-image-266" /><br />
If you&#8217;re implementing support for floppy drive controllers in your hobby OS kernel, then one of your first tasks is to identify what floppy drives are installed in the system.  This is pretty easy to do, as we can interrogate the system configuration to find out.</p>
<p>The PC architecture has a little battery-backed memory chip called the CMOS (which stands for &#8220;Complimentary Metal Oxide Semiconductor&#8221; if you really want to know). This old bit of kit was originally only used as a bit of clock/calendar logic but had extra space which subsequently got used for storing system configuration information&#8230;and so it remains today. Part of the information retained in the CMOS are the floppy drive types of the first two drives (if they&#8217;re installed) and this is located at offset <code>0x10</code> of the CMOS memory space.</p>
<div class="codediv" style="font-size:75%"><strong>Digression:</strong></p>
<p><em>In fact, there&#8217;s an &#8220;equipment&#8221; byte at offset <code>0x14</code> which includes a bit field for representing the existence (but not type) of up to 4 floppy drives.  However, the equipment byte wasn&#8217;t universally used the same way by all manufacturers.  Besides, we&#8217;d still need to know what <strong>type</strong> they are, so just knowing they are there is not sufficient.  In reality, particularly these days, it&#8217;s extremely unlikely that there&#8217;ll be more than two so that&#8217;s all I&#8217;m going to bother supporting here.</em></div>
<p>To read the CMOS, we write the CMOS byte address into I/O port <code>0x70</code> and read the result byte back from I/O port <code>0x71</code>.  This means we can get the floppy drive type codes from the CMOS as follows&#8230;</p>
<div class="codediv">uint8_t b;</p>
<p>outportb(0&#215;70, 0&#215;10);<br />
b = inportb(0&#215;71);</p></div>
<p>The resultant byte is encoded in two identical halves.  The upper 4 bits identify the first drive (drive 0) and the lower 4 bits identify the second drive (drive 1).  Here&#8217;s a diagram showing how these two 4-bit fields are encoded:</p>
<div align="center"><img src="/mind/wp-content/uploads/2009/09/cmosfd.png"></div>
<p>We can use the bit-encoding to help us determine important parameters that our floppy driver will use, for example the number of tracks, the time it takes to spin up and spin down the disk, and so on.</p>
<h4>Example code</h4>
<p>In my own kernel, I don&#8217;t even bother trying to support anything except a 3.5&#8243; 1.44 MB floppy as the others are so rare or obsolete that I just don&#8217;t care.  This keeps the identification code in my floppy driver simpler.  Below is the corresponding code extract from my floppy driver.  My kernel&#8217;s initialization routine calls <code>probe_floppy()</code> if the BIOS parameter block says there are one or more floppy drives in the system.  This function then calls <code>fd_identify()</code> for each of the drives it finds in the CMOS. </p>
<div class="codediv">
<pre>
/*
 * fill in this floppy drive instance's specification based
 * on the drive type obtained from CMOS
 */
static int
fd_identify(fdrive_t *fp, uint8_t type)
{
	memset(fp, 0, sizeof (fdrive_t));
	switch (type) {
	case 0:
		/* shouldn't happen - no drive! */
		error(E_WARN, "fd_identify called with type = 0\n");
		return (DEV_FAIL);

	case 1:
		/* 5.25" 360 KB floppy - obsolete */

	case 2:
		/* 5.25" 1.2 MB floppy - obsolete */
	case 3:
		/* 3.5" 720 KB floppy - obsolete */
	case 5:
		/* 3.5" 2.88 MB floppy - obsolete */
		error(E_WARN, "Obsolete %s floppy drive detected\n",
		    fdtypes[type]);
		return (DEV_FAIL);

	default:
		/* unknown type - assume it's the ubiquitous 3.5" 1.44MB */
	case 4:
		fp->ident = "3.5\" 1.44MB";
		fp->data_rate = 500;
		fp->hlt = 8;
		fp->spt = 18;
		fp->srt_hut = 0xcf;
		/*
		 * set the spin_up and spin_down times by clock ticks,
		 * which occur at 100 HZ.
		 */
		fp->spin_up = 40;	/* 0.4 seconds */
		fp->spin_down = 300;	/* 3 seconds */
		fp->tracks = 80;
		fp->heads = 2;
		fp->gap3 = 0x1b;
		fp->gap3fmt = 0x6c;
		break;
	}

	/*
	 * at the moment, we only support 2 floppy drives from a single
	 * (primary) floppy disk controller, so we set the base address
	 * directly here.
	 */
	fp->base = FDC_BASEADDR;
	fp->did = ndrives;

	/* create the floppy device node name */
	sprintf(fp->name, "fd%d", ndrives);

	if ((fp->devp = mem_alloc(sizeof (device_t))) == NULL) {
		error(E_WARN,
		    "cannot allocate memory for floppy device\n");
		return (DEV_FAIL);
	}

	memset(fp->devp, 0, sizeof (device_t));
	fp->devp->ops = &#038;fd_devops;
	fp->devp->name = fp->name;
	fp->devp->data = fp;

	printf("fd%d  : %s floppy drive\n", ndrives, fp->ident);

	return (DEV_OK);
}

/*
 * we "probe" to see what floppy drives exist in the system. At the moment,
 * this is done by reading from the CMOS, which is pretty machine specific!
 * We also assume a maximum of two floppy drives, which is almost certainly
 * a reasonable assumption these days as most 80x86 don't have any!
 */
void
probe_floppy()
{
	uint8_t b, n;
	int attached = 0;

	/* find out what floppy drives exist from the CMOS */
	outportb(0x70, 0x10);
	b = inportb(0x71);

	/* check for drive 0 */
	if ((n = b >> 4) != 0) {
		if (fd_identify(&#038;floppy[0], n) == 0) {
			ndrives = 1;
			attached++;
		}
	}

	if ((n = b &#038; 0xf) != 0) {
		if (fd_identify(&#038;floppy[1], n) == 0) {
			ndrives++;
			attached++;
		}
	}

	/* if we didn't find any drives, there's nothing more to do */
	if (ndrives == 0)
		return;

	if (attached &#038;&#038; (fd_attach() != DEV_OK)) {
		error(E_WARN, "failed to attach floppy driver\n");
		return;
	}

	if (floppy[0].devp) {
		if (device_register(floppy[0].devp) != DEV_OK)
			error(E_WARN, "failed to register floppy "
			    "device 0\n");
		else
		if (sys_mkdev(NULL, "/dev/fd0", floppy[0].devp->id, 0) != 0)
			error(E_WARN, "cannot create /dev/fd0 node\n");
	}

	if (floppy[1].devp) {
		if (device_register(floppy[1].devp) != DEV_OK)
			error(E_WARN, "failed to register floppy "
			    "device 1\n");
		else
		if (sys_mkdev(NULL, "/dev/fd1", floppy[1].devp->id, 1) != 0)
			error(E_WARN, "cannot create /dev/fd1 node\n");
	}

	atom_init(&#038;fdio_atom);
}
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.jimmo.org/mind/?feed=rss2&amp;p=265</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Russian Knights of Spamalot!</title>
		<link>http://www.jimmo.org/mind/?p=244</link>
		<comments>http://www.jimmo.org/mind/?p=244#comments</comments>
		<pubDate>Fri, 04 Sep 2009 08:43:02 +0000</pubDate>
		<dc:creator>Jimmo</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Stupid Computer]]></category>

		<guid isPermaLink="false">http://www.jimmo.org/mind/?p=244</guid>
		<description><![CDATA[There seems to be a surge of &#8220;Russian&#8221; spamming these days. I&#8217;m getting daily &#8220;comments&#8221; from spammers linking to &#8220;somesite.ru&#8221; and customers with HTML forms, especially the &#8220;contact us&#8221; variety, are getting inundated. The customers complain that they&#8217;re getting a lot of spam via their...]]></description>
			<content:encoded><![CDATA[<p>There seems to be a surge of &#8220;Russian&#8221; spamming these days. I&#8217;m getting daily &#8220;comments&#8221; from spammers linking to &#8220;somesite.ru&#8221; and customers with HTML forms, especially the &#8220;contact us&#8221; variety, are getting inundated.</p>
<p>The customers complain that they&#8217;re getting a lot of spam via their web site and unfortunately, the only way to try and counteract this is to try and put more intelligence in the CGI code that processes the contact form data and pipes it into a mail to the website owner.  Unfortunately, we have to make a trade-off here because no business website wants to deter potential customers by making them go through a load of &#8220;prove you&#8217;re a human&#8221; filters and tests.</p>
<p>Not only are the spam-sending robots become much more sophisticated at managing anti-spam measures in web forms, we&#8217;re also starting to see the phenomenon of actual human spam sweat-shops!  Organized spammers are realizing that, in some cases, it&#8217;s actually more profitable to pay a few cents to some impoverished workers in a developing country to manually spam sites (at least for a while, to figure out reliable ways to defeat the countermeasures).</p>
<p>Currently, most of the HTML form spam has had links and some &#8220;pseudo-English&#8221; comments but the rest of the fields have been filled with garbage, so tighter form field verification has temporarily slowed that down.  However, it won&#8217;t be long before the robots are modified to complete fields with apparently rational values and this measure will be swiftly defeated.</p>
<p>The biggest problem with spam is the very reason it exists in the first place &#8211; because it works! Believe it or not, a tiny percentage of spam recipients actually respond.  True, the response rate is miniscule &#8211; a tiny fraction of 1% (something in the region of 1 response per 1.25 million spams).  In a normal cold marketing campaign, like a mail shot, this would be ridiculously uneconomical because the cost of conducting the campaign massively outweighs the return.  </p>
<p>However, spammers don&#8217;t pay to send spam &#8211; they rely on &#8220;botnets&#8221; of compromised, infected computers to do it for them.  This means that the average hapless Joe who doesn&#8217;t realize his PC is riddled with virii could well be cheerfully pumping spam down his ADSL line without even realizing it.</p>
<h3>How to defeat spam once and for all!</h3>
<p>It&#8217;s really simple in principle, just damned hard to do in practice:</p>
<div id="plist">
<ol>
<li><b>Keep your PC infection free!</b> Run anti-virus software, scan for spyware, etc.. If you really can&#8217;t cough up for a commercial solution, there are free alternatives like <a href="http://free.avg.com/">AVG Free</a>.
<li><b>DON&#8217;T respond to spam!</b>  Frankly, the people that pay the spammers are almost as irritating as the spammers themselves.  I realize that not every internet user is a technophile but pretty much <i>every</i> internet user soon experiences spam first hand.  Getting fooled into feeding the spam-beast as a neophyte is one thing but only the spectacularly dimwitted should be doing so on an ongoing basis.
</ol>
</div>
<p>In summary, you can only slay the spam trolls by starving it to death!  Naturally, coordinating the masses to do this is a daunting, if not impossible, task.  There&#8217;s probably a minority of losers who would think it terribly funny to deliberately feed the spam trolls anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jimmo.org/mind/?feed=rss2&amp;p=244</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Migrating my web presence to this site</title>
		<link>http://www.jimmo.org/mind/?p=193</link>
		<comments>http://www.jimmo.org/mind/?p=193#comments</comments>
		<pubDate>Wed, 02 Sep 2009 06:46:58 +0000</pubDate>
		<dc:creator>Jimmo</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.jimmo.org/mind/?p=193</guid>
		<description><![CDATA[Maintaining a blog is not something I find easy to do, not least of all because it can be difficult to know what to write. After all, who is really that interested in the mundane aspects of my life? And as for the juicier bits,...]]></description>
			<content:encoded><![CDATA[<p>Maintaining a blog is not something I find easy to do, not least of all because it can be difficult to know what to write. After all, who is really that interested in the mundane aspects of my life?  And as for the juicier bits, well&#8230;I&#8217;m not sure I want to sacrifice privacy and discretion for the sake of a blog post!</p>
<p>Previously I have had a blog on my company page, which was constrained to company specific topics, and a forum linked from my music pages within which I would post the occasional update.  The forum died as a community some time ago when a disruptive user polarized the population; one faction wanted the user expelled prior to the investigation being concluded and stormed out when I insisted on due diligence, the other faction stormed out over the actions of the first group.  This left just a couple of folks and myself left thinking &#8220;WTF just happened?&#8221;</p>
<p>It&#8217;s a good lesson in online communities because normally a forum retains members because they have a vested interest in the forum itself (especially in cases where the forum is devoted to a particular topic or theme).  In my case, there was nothing inherently interesting about my forum per se, it was just a place where a group of folks were hanging out&#8230;and hang outs are easy to establish.  So when dissent arose, people could &#8211; and did &#8211; move on.</p>
<p>Anyway, as the forum is now a rather forlorn ghost town, it seems sensible to close it down and migrate my posts, articles and blog entries over here.  Henceforth, you will be finding my updates and news on this site! <img src='http://www.jimmo.org/mind/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jimmo.org/mind/?feed=rss2&amp;p=193</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The importance of experimental observation</title>
		<link>http://www.jimmo.org/mind/?p=190</link>
		<comments>http://www.jimmo.org/mind/?p=190#comments</comments>
		<pubDate>Mon, 31 Aug 2009 13:32:20 +0000</pubDate>
		<dc:creator>Jimmo</dc:creator>
				<category><![CDATA[Atheism]]></category>
		<category><![CDATA[falsifiability]]></category>
		<category><![CDATA[observation]]></category>
		<category><![CDATA[scientific method]]></category>

		<guid isPermaLink="false">http://www.jimmo.org/mind/?p=190</guid>
		<description><![CDATA[There are a plethora of different theories and hypotheses put forward for pretty much every field of intellectual inquiry which includes the philosophical and metaphysical in addition to objective scientific study. It&#8217;s impractical to investigate them all simultaneously, as there are simply too many of...]]></description>
			<content:encoded><![CDATA[<p>There are a plethora of different theories and hypotheses put forward for pretty much every field of intellectual inquiry which includes the philosophical and metaphysical in addition to objective scientific study.  It&#8217;s impractical to investigate them all simultaneously, as there are simply too many of them. We need to be critically discerning about which theories or hypotheses warrant further consideration.</p>
<p>In order to take a hypothesis beyond an initial postulate, it needs to be falsifiable &#8211; or at least testable.  This means that the hypothesis must be capable of being verified against repeatable experimentation and observation that can <i>contradict</i> the hypothesis.</p>
<p>If the predictions of a hypothesis correspond to observation without contradiction, then that lends weight to the hypothesis.  A sustained track record of being consistent with observation is one of the primary criteria for promoting a hypothesis to a <b>theory</b>. If a hypothesis can be contradicted by experimental observation, then that hypothesis is flawed.  This forms the basis of the <a href="http://en.wikipedia.org/wiki/Scientific_method">scientific method</a>.</p>
<p>One criticism levelled at the scientific method arises from the philosophical debate between materialism and dualism.  Materialism asserts that there is an objective, physical reality that exists independently of any observer.  For example, if a tree falls in a forest and there&#8217;s nobody there, it still makes a noise (or at least pressure waves in the air that would be perceived as a noise). </p>
<p>Dualism, on the other hand, states that there is another psychic, spiritual or otherwise &#8220;supernatural&#8221; (beyond physics) reality.  Immanuel Kant pointed out that all our observations are ultimately drawn via our subjective perceptions and therefore we never actually observe an object noumenally.  Under this model, if you look at a rock, you&#8217;re actually experiencing the various phenomena of light, colour and texture which you&#8217;re subjectively interpreting as a rock&#8230;but not actually experiencing the noumenal rock &#8220;in and of itself&#8221;.</p>
<p>This gave rise to the <a href="http://www.jimmo.org/mind/?p=30">brain in the jar</a> argument, which uses this position to assert that there&#8217;s no such thing as an empirical observation.  This was also the basis for the movie <b><i>&#8220;The Matrix</i></b>.  Naturally, this can cause a problem for the scientific method which relies on experimental observation to evaluate a hypothesis.</p>
<p>As a result, dualism is often hijacked by proponents of supernatural hypotheses in an attempt to legitimize their hypothesis and excuse it from examination by the scientific method.  This is somewhat disingenuous, as dualism really only exposes the weaknesses inherent to purely materialist reasoning.  It does <b>does not</b> logically invert those weaknesses into supporting evidence for the supernatural.</p>
<p>This one of the primary difficulties we encounter when debating the existence of God, as most &#8220;God theories&#8221; invariably define themselves to be non-falsifiable. They plant a flag in the epistomological gap afforded by dualism and insist that, as their hypothesis cannot be logically disproven, it must carry equal intellectual weight <i>despite a complete absence of any supporting evidence</i>.</p>
<p>However, this is in itself a logical fallacy &#8211; specifically the <a href="http://en.wikipedia.org/wiki/Argument_from_ignorance">&#8220;negative proof&#8221; argument</a> which tries to assert that a premise must be considered true as it cannot be proven false.</p>
<p>Bertrand Russell coined the <b>&#8220;Celestial Teapot&#8221;</b> analogy to try and illustrate the flaw in this approach&#8230;</p>
<blockquote><p><i><br />
&#8220;If I were to suggest that between the Earth and Mars there is a china teapot revolving about the sun in an elliptical orbit, nobody would be able to disprove my assertion provided I were careful to add that the teapot is too small to be revealed even by our most powerful telescopes. But if I were to go on to say that, since my assertion cannot be disproved, it is an intolerable presumption on the part of human reason to doubt it, I should rightly be thought to be talking nonsense. If, however, the existence of such a teapot were affirmed in ancient books, taught as the sacred truth every Sunday, and instilled into the minds of children at school, hesitation to believe in its existence would become a mark of eccentricity and entitle the doubter to the attentions of the psychiatrist in an enlightened age or of the Inquisitor in an earlier time.&#8221;<br />
</i></p></blockquote>
<p>One counter to Russell&#8217;s argument is that the existence of the teapot is still theoretically verifiable, even if it&#8217;s unverifiable in any realistic, practical or technological sense &#8211; in other words that the laws of physics do not preclude us from verifying the theory. The counter argument asserts that God resides so entirely outside the sphere of human inquiry such that there is no theoretical basis for falsifiability &#8211; God is entirely metaphysical.</p>
<p>This counter-argument, of course, simply runs into difficulties of its own making.  First, it assumes the &#8220;negative proof&#8221; fallacy as an inherent characteristic with a circular justification.  God is non-falsifiable because God is non-falsifiable (and, of course, this defines the assertion itself to be non-falsifiable).</p>
<p>Secondly, it raises the question over the origins of God in the first place. Because the counter-argument defines God to be beyond all observation, indeed beyond the laws of physics, it must follow that it is impossible for us to perceive God.  So how on earth did we get the idea that a God might exist in the first place?  Well, there are really only two possibilities.</p>
<ol>
<li>The notion of God was a construct of human imagination.
<li>God, being metaphysical, used magic to bridge the laws of physics and be perceptible to us.  He then interacted with us and told us of his existence.
</ol>
<p>Religious tradition implies the latter.  Indeed, the apocryphal &#8220;burning bush&#8221; falls into this category. The problem is that we&#8217;re required to take all this on trust.  If you were to encounter a burning bush and a booming voice declaring &#8220;I AM GOD&#8221; wouldn&#8217;t you be at least the tiniest bit skeptical?  Of course you would.</p>
<p>However, the metaphysical argument implies that we have nothing but trust and incredulity on which to base belief in God&#8230;in which case, how do you decide between competing faith based positions?  Maybe the scientologists are right after all (shudder)?</p>
<p>Ultimately, this is why the debate inexorably draws back to falsifiability and experimental observation.  There simply is no other way to differentiate between the plausible and the implausible&#8230;and if one accepts the implausible when it&#8217;s friendly to ones viscerally held religious beliefs, then one will struggle to legitimately dismiss all the competing implausible theories that are grounded on similarly tenuous premises.  In short, it&#8217;s hard to believe in one god and be atheist about the rest! <img src='http://www.jimmo.org/mind/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>In summary, feel free to postulate any hypotheses you wish &#8211; just don&#8217;t expect them to carry equal weight with well-tested theories unless you&#8217;re willing to expose your hypotheses to equal rigour.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jimmo.org/mind/?feed=rss2&amp;p=190</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
