<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<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/"
	>

<channel>
	<title>Michael Clarke</title>
	<link>http://www.michael-clarke-blog.com</link>
	<description>Me, Operating Systems, Technology, Sun Microsystems and Stuff!</description>
	<pubDate>Tue, 07 Jul 2009 22:34:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
			<item>
		<title>I&#8217;ve Finally Started!</title>
		<link>http://www.michael-clarke-blog.com/2009/07/07/ive-finall-started/</link>
		<comments>http://www.michael-clarke-blog.com/2009/07/07/ive-finall-started/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 21:04:59 +0000</pubDate>
		<dc:creator>Michael Clarke</dc:creator>
		
		<category><![CDATA[Aberystwyth University]]></category>

		<category><![CDATA[Major Project]]></category>

		<category><![CDATA[Operating Systems]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.michael-clarke-blog.com/2009/07/07/ive-finall-started/</guid>
		<description><![CDATA[At last! I&#8217;ve finally started doing some work on my major project. I&#8217;ve spent a brief amount of time yesterday getting my new Trac installation working. You can get to the Trac install here, and unlike last time everything is restricted to read-only for various reasons:

It&#8217;s supposed to all be my own work!
Last time I [...]]]></description>
			<content:encoded><![CDATA[<p>At last! I&#8217;ve finally started doing some work on my major project. I&#8217;ve spent a brief amount of time yesterday getting my new Trac installation working. You can get to the Trac install <a href="http://www.mymajorproject.co.uk/trac/michael" title="Trac Install" target="_blank">here</a>, and unlike last time everything is restricted to read-only for various reasons:</p>
<ul>
<li>It&#8217;s supposed to all be my own work!</li>
<li>Last time I put a link to a Trac install I got thousands of tickets which suggested I buy Viagra.</li>
</ul>
<p>Anyway, having installed Trac I then set about creating some components, milestones, versions etc. I also started writing some documentation about the OS, the coding standards to be used, the goals, and all that sort of stuff. As I figure out more completely the requirements of the project the Wiki will be improved with more information and documentation. My hope is that when it comes to the final report I&#8217;ll be able to grab a lot of the stuff off the Wiki.</p>
<p>You may be thinking to yourself - this is all well and good, but this isn&#8217;t actually a start - it&#8217;s just a &#8220;time wasting exercise to make you think you&#8217;ve started.&#8221; But this is where you&#8217;d be wrong. In addition to all the above I created the first ticket - the boot loader task, and then promptly proceeded to write the boot loader. Although I&#8217;ve not tested it yet, it&#8217;s so simple stuff I don&#8217;t have any concerns. Obviously that won&#8217;t do when it comes to writing my report and all that palava - so I will have to come up with a way of testing a boot loader, but for the moment I&#8217;m just assuming it will work - it compiles.</p>
<p>As with MouthOS, the boot loader for my project uses GRUB, but this time it makes much more effort to use the features provided, such as GRUB&#8217;s own memory map etc. This is actually a very simple task:</p>
<p><strong><code>kernel:</code></strong></p>
<p><code><strong>extern main</strong></code><br />
<code><br />
; Push the address of the GRUB memory info onto the stack so that<br />
; the kernel can get to them.<br />
<strong>push eax;<br />
push ebx;</strong></code></p>
<p><code>; Call the main kernel. Notice that we should NEVER EVER return<br />
; from main, but if we do we end up in an infinite loop. At<br />
; some point (once system calls are working) that should change<br />
; to panic!<br />
<strong>call main<br />
jmp $</strong></code></p>
<p>Easy eh? Well, there is actually a little more code than that in order to setup a basic 8K stack, BSS etc. However, that is the gist of the boot loader! You&#8217;ve gotta love GRUB. Obviously there are a number of things that still need doing such as enabling interrupts, setting up the Global Descriptor Table and Local Descriptor Tables etc. These are things that GRUB does, but only to a very simple extent - for example, as my comments in the code say:<code></code></p>
<p><code><br />
; cs  = A read/execute segment, offset: 0, limit: 0xFFFFFFFF (32 bit)<br />
;<br />
; ds, es, fs, gs, ss<br />
; A read/write segment, offset 0, limit: 0xFFFFFFFF (32 bit)<br />
</code></p>
<p>You can very quickly see that the entire of the memory is read/write/execute - no matter if it is a stack, code segment, data segment etc. In other words GRUB would seem to be pretty lazy in this regard. But I suppose that is because no matter what you&#8217;re going to want to change it anyway. So my next task really is to write the rest of the boot loader including the code to sort out the GDT and LDTs. Oh, and I&#8217;ve added about 25 tickets now of things that I need to do for the first release of the project. Looks like I&#8217;ve got a lot of work to be doing.</p>
<p>So, apart from my progress with the major project, what else have I been doing? I&#8217;ve started going swimming and last Thursday I managed to do 90 lengths (approximately two a half Km) - perhaps not fantastic for some, and a real shame that it&#8217;s not 100, but for me that is pretty good going. Today I also managed to re-create this achievement. Hopefully next time I&#8217;ll manage the 100 - but by 90 I&#8217;m exhausted!</p>
<p>So right now I&#8217;m off to get a cup of coffee and then I&#8217;m going to watch the latest episode of Tourchwood on iplayer, and then tomorrow I&#8217;ve got guitar lesson <img src='http://www.michael-clarke-blog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.michael-clarke-blog.com/2009/07/07/ive-finall-started/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New Guitar</title>
		<link>http://www.michael-clarke-blog.com/2009/06/28/new-guitar/</link>
		<comments>http://www.michael-clarke-blog.com/2009/06/28/new-guitar/#comments</comments>
		<pubDate>Sun, 28 Jun 2009 22:07:14 +0000</pubDate>
		<dc:creator>Michael Clarke</dc:creator>
		
		<category><![CDATA[Cars]]></category>

		<category><![CDATA[Guitar]]></category>

		<category><![CDATA[Home]]></category>

		<category><![CDATA[Sun Microsystems]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.michael-clarke-blog.com/2009/06/28/new-guitar/</guid>
		<description><![CDATA[When I was about 7 or 8 I remember wanting desperately to have guitar lessons. My parents, being the very kind folk that they are, bought me a guitar and I started having lessons. I remember my guitar teacher having an arrangement with the school, and so once a week I&#8217;d get to skip &#8216;real [...]]]></description>
			<content:encoded><![CDATA[<p>When I was about 7 or 8 I remember wanting desperately to have guitar lessons. My parents, being the very kind folk that they are, bought me a guitar and I started having lessons. I remember my guitar teacher having an arrangement with the school, and so once a week I&#8217;d get to skip &#8216;real lessons&#8217; to have my guitar lesson - along with two other people who were also learning the guitar. However, at this age I found it incredibly boring playing Jingle Bells over and over and over again to the point where I can now pick up a guitar and play, from memory after all these years, that damn song. All I wanted to do was <em>play real songs</em>, I wanted to learn strumming - non of that picking nonsense. After a not so long while, for better or worse - but definitely due to boredom, I gave up my guitar lessons.</p>
<p>Around January this year I decided that I wanted to play again, but this time I wanted to learn &#8216;properly&#8217;. This time I was uninterested in songs, or strumming&#8230; I wanted to know the techniques, the picking patterns, the reason why an A chord is the shape that it is - I wanted to know everything there is to know about guitars. I stole (or rather borrowed) my brothers guitar - he never uses it anyway and began with a few online tutorials piecing things together with the help of one of my house mates (Mike) who was always willing to give me some advice on my playing, or teach me a new scale or some other trick. However, I quickly realised that although I was getting to the stage where I could play simple songs - I wasn&#8217;t  really learning everything I wanted to. So, knowing that one of my mum&#8217;s friends used to teach guitar, I arranged for lessons.</p>
<p>I&#8217;ve now been at it for just over 6 months and, as I approach my 22nd birthday (16th July), I decided it was time to stop borrowing my brothers guitar and get one of my own, and so, although a little early for my birthday, my <a href="http://www.adamblackguitarcompany.co.uk/acoustic/o-series/o7ce.html">Adam Black O-7CE guitar</a> arrived this weekend. It sounds (and looks) beautiful and I have to admit that I&#8217;ve hardly put it down today.</p>
<p align="center"><a href="http://www.michael-clarke-blog.com/images/guitar1.jpg"><img src="http://www.michael-clarke-blog.com/images/guitar1.jpg" alt="My new guitar with my muddy foot prints on the floor - oops!" width="204" height="155" /></a>  <a href="http://www.michael-clarke-blog.com/images/guitar2.jpg"><img src="http://www.michael-clarke-blog.com/images/guitar2.jpg" alt="My new guitar!" width="204" height="155" /></a> <a href="http://www.michael-clarke-blog.com/images/guitar3.jpg"><img src="http://www.michael-clarke-blog.com/images/guitar3.jpg" alt="Ooooo, shiny!" width="204" height="155" /></a><br />
(Click on the ol&#8217; images to get full sized ones what not!)</p>
<p align="left">So, apart from playing my new guitar, what else have I been up to? Well first of all, although I had amazing and cunning plans to have finished my dissertation for next year by now (okay, a slight exaggeration) I have yet to do any work on that yet.  However, I have not been lazy (much). I&#8217;ve been busy working for Sun sorting out the campus ambassador program for next year - it&#8217;s good to have finally sorted that out as it has taken quite a large chunk of time this last couple of weeks.</p>
<p align="left">I&#8217;ve also been pretty busy doing bits and pieces for the move in August - and that is something I ought to mention too. We were moving in July, the 11th to be exact. We then put the date back to the 20th July due to numerous reasons, work being done on the house, removal firms, packing etc. However, we&#8217;ve now pushed the moving date back further and it is now the 21st August. But it&#8217;s all good as we&#8217;re getting a complete new kitchen and right now (or well, not <em>right now</em>, but this week) we&#8217;ve got electricians in re-wiring the whole place and all that good stuff. Then I&#8217;ll be able to move in all the networking and TV gear and wire the house up. I managed to get really cheap back plates for network sockets from Wilkinson&#8217;s of all places - I&#8217;ve found them to be one of the best places to go for odd things you might need - for example I always get my windscreen wipers for the car from there - £1.49 per wiper and it literally takes me ten seconds to fit them, in a car-park with no tools, at that price you simply can&#8217;t go wrong!</p>
<p align="left">Anyway, I&#8217;ve now pontificated for long enough. So, until my next exciting and invigorating update (even if I do say so myself).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michael-clarke-blog.com/2009/06/28/new-guitar/feed/</wfw:commentRss>
		</item>
		<item>
		<title>And off we go&#8230;</title>
		<link>http://www.michael-clarke-blog.com/2009/06/05/and-off-we-go/</link>
		<comments>http://www.michael-clarke-blog.com/2009/06/05/and-off-we-go/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 18:54:39 +0000</pubDate>
		<dc:creator>Michael Clarke</dc:creator>
		
		<category><![CDATA[Major Project]]></category>

		<guid isPermaLink="false">http://www.michael-clarke-blog.com/2009/06/05/and-off-we-go/</guid>
		<description><![CDATA[So, it has nearly been a year since my last post - so much for the &#8216;my new Sun blog doesn&#8217;t mean I won&#8217;t be posting here&#8217;. Not very much has really happened during the year. A lot of course work for university and generally just work for Sun managing the Campus Ambassadors in the [...]]]></description>
			<content:encoded><![CDATA[<p>So, it has nearly been a year since my last post - so much for the &#8216;my new Sun blog doesn&#8217;t mean I won&#8217;t be posting here&#8217;. Not very much has really happened during the year. A lot of course work for university and generally just work for Sun managing the Campus Ambassadors in the UK. However, my exams are all finished and the summer holidays have begun!</p>
<p>So, as I approach my final year at Aberystwyth University (those last 4 years have gone pretty fast) I reach the important decision as to what I should do for my final year project. This project is a Masters level 60 credit module. As each year is 120 credits, that is half of the whole year. As you can imagine, the project has a major effect on the final mark I will get for my degree. So, it&#8217;s a big decision to make.</p>
<p>Those of you who are (or at least, were) avid readers of this blog would probably jump to suggest that I would be doing MouthOS for my final year project. You would be half correct. After much thought and investigation I have decided to produce a real-time operating system kernel for a chip known as the Propeller. It is a fantastic 32bit micro-controller produced by Parallax and has 8 cores (each core is 10MHz) and a whopping 32KBs of RAM. You can read all about the chip <a href="http://www.parallax.com/propeller/">here</a>. As far as I have been able to ascertain so far there is no Operating System as such for this chip at the moment, and so this is a perfect option for a masters level project - it has to provide something unique or some slant that makes the project worth while.</p>
<p>I decided some time ago that it would be a good idea to blog about the progress of my project - both so I have a record for when it comes to writing my dissertation, and for others who are interested in such things. It is for this reason that I am writing this post which I hope will be the first of many more.</p>
<p>Now that it is the summer holidays my first task is to start reading some books on the subject of real-time systems and the like, not to mention continued reading and research into Operating Systems and Kernels. As such I&#8217;ve been to the university library and got myself quite a little collection of books to read:</p>
<ul>
<li><a href="http://www.amazon.co.uk/Safety-Critical-Computer-Systems-Storey/dp/0201427877">Safety Critical Computer Systems by Neil Story</a></li>
<li><a href="http://www.amazon.com/Real-Time-Systems-Development-Rob-Williams/dp/0750664711">Real-Time System Development by Rob Williams</a></li>
<li>Operating Systems by H.M.Deitel (Out of Print, ISBN: 0-201-50939-3)</li>
<li><a href="http://www.amazon.co.uk/Operating-Systems-Implementation-Andrew-Tanenbaum/dp/0136386776">Operating Systems: Design and Implementation by A. S. Tanenbaum and A. S. Woodhull</a></li>
</ul>
<p>This is not to mention the books I already have on Linux, Solaris etc. Further the next few weeks will be spent reading and playing around with existing real-time operating systems. Things like RTOS come to mind. After that my next task is to familuarise myself more with the Propeller chip. I currently have the use of a integrated Propeller solution, designed for writing games, called the &#8216;<a href="http://www.parallax.com/Store/Microcontrollers/PropellerProgrammingKits/tabid/144/ProductID/467/List/1/Default.aspx?SortField=ProductName,ProductName">Hydra</a>&#8216;. It is my aim to use this as the base for the development work and testing as it is known to work so there (hopefully) won&#8217;t be any hardware issues to slow the progress or cause trouble. However, we all know there will be!</p>
<p>So, what else have I got to do during the holidays? I have agreed with one lecturer to run a couple of lectures next year. As such I will be giving three lectures for the CS101 module (Introduction to Computer Hardware and Software). Specifically my three lectures will cover two topics: &#8216;File Systems&#8217; and &#8216;Processes and Threads&#8217;. So, at some point I need to write the slides for that too as the current slides are out of date and don&#8217;t go in as much depth as I want to. On the file system side the slides currently cover things such as what file systems are out there and what they do, but not really how they do it. My aim is to bring a bit more of the gritty detail into the lectures - so we&#8217;ll be covering things such as LBA (logical block addressing) and how it relates to CHS (cylinder, head, sector) etc, as well as how inodes come into play in Linux and UNIX variants etc. I&#8217;m also hoping to bring the slides up to date so we cover thing such as ZFS and etx4. As far as Processes and Threads go I hope to bring more detail as to what the differences really mean - i.e. that processes have their own address spaces whilst threads (or perhaps LWPs - depending on the OS you&#8217;re using etc)  are generally &#8216;light-weight&#8217; that is they share a processes address space etc. I also want to bring into this the idea of how scheduling works, and explain what is really involved in a task switch on a processor (the storing of the stack, the changing of the program counter etc etc). This kind of information is not covered in much depth at the moment. At the same time I&#8217;ve got to keep it to a level that 1st year computer science students will be able to cope with (but still tax them a bit), and obviously a whole course could be taken on one of these subjects alone, so three lectures isn&#8217;t very much time!</p>
<p>So, as if this isn&#8217;t enough already we&#8217;re also moving on the 11th July. This means copious amounts of packing and indeed also the wiring of the &#8216;new house&#8217; with network, phone, TV etc.  Then to top it all off, I&#8217;m still working for Sun (soon to be Oracle) and right now that means recruiting ambassadors and working out what the ambassador program will be all about in September. So, all in all, a pretty busy summer. I think the main thing to gather from all this is that I will now (hopefully) be blogging more regularly about the progress of my final year project.</p>
<p>So, until my next update.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michael-clarke-blog.com/2009/06/05/and-off-we-go/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Hmmm</title>
		<link>http://www.michael-clarke-blog.com/2008/06/25/hmmm/</link>
		<comments>http://www.michael-clarke-blog.com/2008/06/25/hmmm/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 14:35:00 +0000</pubDate>
		<dc:creator>Michael Clarke</dc:creator>
		
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.michael-clarke-blog.com/2008/06/25/hmmm/</guid>
		<description><![CDATA[I don&#8217;t think this needs words&#8230;
&#160;

&#160;
]]></description>
			<content:encoded><![CDATA[<p align="left">I don&#8217;t think this needs words&#8230;</p>
<p align="center">&nbsp;</p>
<p align="center"><a href="http://http://www.flickr.com/photos/trxuk/2610783380/sizes/l/"><img src="http://farm4.static.flickr.com/3262/2610783380_8fe2182261.jpg" height="375" width="500" /></a></p>
<p align="center">&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michael-clarke-blog.com/2008/06/25/hmmm/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bugs that produce oil&#8230;</title>
		<link>http://www.michael-clarke-blog.com/2008/06/18/bugs-that-produce-oil/</link>
		<comments>http://www.michael-clarke-blog.com/2008/06/18/bugs-that-produce-oil/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 21:39:23 +0000</pubDate>
		<dc:creator>Michael Clarke</dc:creator>
		
		<category><![CDATA[Science]]></category>

		<guid isPermaLink="false">http://www.michael-clarke-blog.com/2008/06/18/bugs-that-produce-oil/</guid>
		<description><![CDATA[I was reading a friends blog today and I saw he&#8217;s linked to a truly fascinating news article about Scientists who have managed to genetically modify bugs in such a way that they consume waste and produce crude oil.
I&#8217;m of two minds regarding this &#8216;discovery&#8217;. On the one hand it&#8217;s great knowing that there could [...]]]></description>
			<content:encoded><![CDATA[<p>I was reading a friends blog today and I saw he&#8217;s linked to a truly <a href="http://www.timesonline.co.uk/tol/news/environment/article4133668.ece">fascinating news article</a> about Scientists who have managed to genetically modify bugs in such a way that they consume waste and produce crude oil.</p>
<p>I&#8217;m of two minds regarding this &#8216;discovery&#8217;. On the one hand it&#8217;s great knowing that there could effectively be an unlimited supply of crude oil in the world - could this be the start of the road to free energy? Could this possibly mean an end to wars and and rivalry over oil rich countries?</p>
<p>However, I do have my concerns. Is this really the best thing for the environment - yes, it&#8217;s a way of recycling our waste. It&#8217;s also a means of gaining oil without the hassle of drilling and pumping and who knows whatever else - but is it sustainable for the environment and planet - do we really want to continue to have cars that pump out masses of CO2 or, would we prefer to find alternatives such as hydrogen power etc? Another interesting question - how much oil can these bugs really produce - too little, or as one critique on the news article says &#8220;Suppose some of these bugs mysteriously got out of the laboratory and into the environment. Would they not continue to behave in a similar fashion outside the petrie dish? So now everything around them would slowly be converted to oil. How is this scenario &#8220;environmentally friendly&#8221;?&#8221;. Then there are the moral grounds - is it right to genetically modify bugs for such things? Should we be playing God?</p>
<p>Overall I think it&#8217;s an interesting step, and it may even be a step in the right direction towards sustainable, environmentally friendly fuel - but I still think we&#8217;ve got a long way to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michael-clarke-blog.com/2008/06/18/bugs-that-produce-oil/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MouthOS gets kmem_alloc()&#8230;</title>
		<link>http://www.michael-clarke-blog.com/2008/06/08/mouthos-gets-kmem_alloc/</link>
		<comments>http://www.michael-clarke-blog.com/2008/06/08/mouthos-gets-kmem_alloc/#comments</comments>
		<pubDate>Sun, 08 Jun 2008 20:19:11 +0000</pubDate>
		<dc:creator>Michael Clarke</dc:creator>
		
		<category><![CDATA[MouthOS]]></category>

		<category><![CDATA[Operating Systems]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.michael-clarke-blog.com/2008/06/08/mouthos-gets-kmem_alloc/</guid>
		<description><![CDATA[At last it has happened! I have been putting off writing my memory allocator for MouthOS for some time. Up to now I&#8217;ve been able to survive without one by simply not having any &#8216;undefined&#8217; data structures - everything in the kernel was a known, static size.
So after a interesting Solaris Advanced Crash Dump Analysis [...]]]></description>
			<content:encoded><![CDATA[<p>At last it has happened! I have been putting off writing my memory allocator for MouthOS for some time. Up to now I&#8217;ve been able to survive without one by simply not having any &#8216;undefined&#8217; data structures - everything in the kernel was a known, static size.</p>
<p>So after a interesting Solaris Advanced Crash Dump Analysis course last week (which has really put me back into my OS development mood) I decided it was time to make a move and I spent a large portion of Friday night working out how to allocate memory without overwriting the existing kernel, and at last by about 2am in the morning having messed around with the linker and some cleverly placed assembly labels I finally was able to kmem_alloc() some memory.</p>
<p>At this point I decided I was finished and went to bed. The next morning I awoke, pleased to have kmem_alloc() working, or so I thought. However, as the day progressed and I allocated more and more pages of memory I started to see some strange things happening. Why did that character on screen just go red? I never put a start on the screen&#8230;</p>
<p>After a fair amount of time debugging the issue I managed to isolate the problem. My array of free_pages_t structures were located, not at the end of the kernel stack as I thought (which is currently 8K), but in the last 1K of the stack. Ultimately the problem was a off by one (er, or 1024 depending on how you look at it) error in my programming. At last I was able to kmem_alloc() pretty much as much memory as  I wanted - but how to free.</p>
<p>This proved to be very easy. I simply modified my page_map_t structure to contain a grouping id. As such, when we call kmem_free(void *) we do the following to first make sure that the address we got was on a page boundary.</p>
<pre>	while ( (addr % (PAGE_SIZE * 1024) != 0 )
		addr--;</pre>
<pre>	while ( page-&gt;addr != addr )
		page = page-&gt;next;</pre>
<p>Now we&#8217;re on a page boundary we can just loop through the pages whilst the alloc_id&#8217;s are equal and set the flags to PAGE_FREE&#8230;</p>
<pre>	int alloc_id = page-&gt;alloc_id;

	while ( page-&gt;alloc_id == alloc_id ) {
		page-&gt;alloc_id = 0;
		page-&gt;flags &amp;= PAGE_FREE;
		page = page-&gt;next;
	}</pre>
<p>With that working I then spent a bit more time perfecting and tweaking and now MouthOS is pretty good at allocating and freeing memory - at least, I think it is anyway. In the end it turned out not to be so difficult - you just have to get your head around the whole idea of allocating memory, before you have an allocator. When I thought about it this ended up not to be such an issue after-all&#8230;.  Here is how we can do it.</p>
<ol>
<li>You know the point where your kernel loads.</li>
<li>You can work out where your kernel ends by putting a label in its own section, and then using the linker to put that section at the end of the kernel.</li>
<li>You now know (from the placed label) where a safe place in the memory is to write without overwriting the existing kernel, so write all your required memory structures, of which you can calculate how many you need from the amount of memory in the system.</li>
<li>Finally,go back to your memory structures that you&#8217;ve just written and mark all the kernel space as allocated, including the space the memory structures take - which you know as you know the size of a memory struct, you know where it starts, and you know how many you&#8217;ve got.</li>
</ol>
<p>Easy <img src='http://www.michael-clarke-blog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> You can find the code for the new MouthOS memory allocator at: <a href="http://www.michael-clarke-blog.com/trac/MouthOS">http://www.michael-clarke-blog.com/trac/MouthOS</a>  -  if you&#8217;re remotely interested :p</p>
<p>Until next time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michael-clarke-blog.com/2008/06/08/mouthos-gets-kmem_alloc/feed/</wfw:commentRss>
		</item>
		<item>
		<title>blogs.sun.com&#8230;.</title>
		<link>http://www.michael-clarke-blog.com/2008/06/01/blogssuncom/</link>
		<comments>http://www.michael-clarke-blog.com/2008/06/01/blogssuncom/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 09:43:52 +0000</pubDate>
		<dc:creator>Michael Clarke</dc:creator>
		
		<category><![CDATA[Sun Microsystems]]></category>

		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.michael-clarke-blog.com/2008/06/01/blogssuncom/</guid>
		<description><![CDATA[Last night I started my new Sun blog at blogs.sun.com - http://blogs.sun.com/michaelfclarke. So, what does this mean for this blog? Well, nothing really. I&#8217;ll continue to update this blog as I have been doing, putting personal projects and the like up. What this does mean however is that you&#8217;ll now be able to track my [...]]]></description>
			<content:encoded><![CDATA[<p>Last night I started my new Sun blog at blogs.sun.com - <a href="http://blogs.sun.com/michaelfclarke">http://blogs.sun.com/michaelfclarke</a>. So, what does this mean for this blog? Well, nothing really. I&#8217;ll continue to update this blog as I have been doing, putting personal projects and the like up. What this does mean however is that you&#8217;ll now be able to track my progress as a Campus Ambassador Co-ordinator for the UK.</p>
<p>As some of you will know, I was going to be the Campus Ambassador for Aberystwyth University. However, recently Kim Austin (who is in charge of the Campus Ambassador program in the UK) asked if I&#8217;d like to be the Campus Ambassador Co-ordinator instead.   This job basically involves supporting the student ambassadors out in the field with their technical demos and day to day job requirements. Having worked for Sun for a year in the UK head offices I understand what Sun wants from the campus ambassadors, and being a student myself I also understand what students want from the campus ambassador program. It is my job to make sure that both parties get what they want.</p>
<p>So, why the new blog? I thought it would be nice to have an official blog for the Campus Ambassador work so that those who aren&#8217;t interested in MouthOS, or  that my bike tire still hasn&#8217;t been fixed (I&#8217;m waiting for the inner tube, honest&#8230; I&#8217;m not that lazy!) can keep a track of all the stuff that is going on in the world of campus ambassadors.</p>
<p>At the moment I&#8217;ve not got much on my new blog at the moment, but you should check it out for all the latest Campus Ambassador news in the UK.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michael-clarke-blog.com/2008/06/01/blogssuncom/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MouthOS Trac Website</title>
		<link>http://www.michael-clarke-blog.com/2008/05/16/mouthos-trac-website/</link>
		<comments>http://www.michael-clarke-blog.com/2008/05/16/mouthos-trac-website/#comments</comments>
		<pubDate>Fri, 16 May 2008 21:04:18 +0000</pubDate>
		<dc:creator>Michael Clarke</dc:creator>
		
		<category><![CDATA[MouthOS]]></category>

		<category><![CDATA[Operating Systems]]></category>

		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.michael-clarke-blog.com/2008/05/16/mouthos-trac-website/</guid>
		<description><![CDATA[It&#8217;s taken me some time to gather the enthusiasm to do this - but I&#8217;ve finally moved my MouthOS source over to my web server and installed trac. So, you can view the MouthOS wiki and source at:
http://www.michael-clarke-blog.com/trac/MouthOS
The older versions are in /proto. Kernel version 0.0.1, 0.0.2 and 0.0.3 are broken with some pretty big [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s taken me some time to gather the enthusiasm to do this - but I&#8217;ve finally moved my MouthOS source over to my web server and installed trac. So, you can view the MouthOS wiki and source at:</p>
<p><a href="http://www.michael-clarke-blog.com/trac/MouthOS">http://www.michael-clarke-blog.com/trac/MouthOS</a></p>
<p>The older versions are in /proto. Kernel version 0.0.1, 0.0.2 and 0.0.3 are broken with some pretty big bugs (for such small programs) such as triple faults and Kernel panics.</p>
<p>The most stable version at the moment is version 0.0.03 in <strong><em>/releases</em></strong>.</p>
<p>The stuff in /trunk is the current development with all the new HAL (Hardware Abstraction Layer) stuff. I&#8217;m still in the process of porting a lot of the proto-0.0.3 and releases-0.0.3 stuff to /trunk - so this is pretty useless at the moment <img src='http://www.michael-clarke-blog.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> But you&#8217;ll get the general idea as to where the project is heading from /trunk in terms of the HAL, Memory Management etc.</p>
<p>At some point I&#8217;m also going to add anonymous svn access so you&#8217;ll all be able to checkout the source code and have a play - but at least for the moment you can view the code, the wiki etc.</p>
<p>For the moment - enjoy <img src='http://www.michael-clarke-blog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.michael-clarke-blog.com/2008/05/16/mouthos-trac-website/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A bike ride that went wrong&#8230;</title>
		<link>http://www.michael-clarke-blog.com/2008/05/11/a-bike-ride-that-went-wrong/</link>
		<comments>http://www.michael-clarke-blog.com/2008/05/11/a-bike-ride-that-went-wrong/#comments</comments>
		<pubDate>Sun, 11 May 2008 08:24:33 +0000</pubDate>
		<dc:creator>Michael Clarke</dc:creator>
		
		<category><![CDATA[Play]]></category>

		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.michael-clarke-blog.com/2008/05/11/a-bike-ride-that-went-wrong/</guid>
		<description><![CDATA[Yesterday I decided that since the weather was so nice it&#8217;d be a good idea to go for a nice bike ride. One of the guys who works in the  call center, Vlad, showed interest in a bike ride also having been a bit of a keen cyclist before some woman drove over him!
So, [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I decided that since the weather was so nice it&#8217;d be a good idea to go for a nice bike ride. One of the guys who works in the  call center, Vlad, showed interest in a bike ride also having been a bit of a keen cyclist before some woman drove over him!</p>
<p>So, we met at Sun about 3pm with plenty of water and every tool under the sun that we could possible need. The plan was to cycle to Fleet, then around Fleet lake and perhaps pop into The Heron on the Lake for a quick pint before cycling back - no too bad at all.</p>
<p>Things were going excellently - we arrived at fleet and got about 1/2 way around the lake when Vlad pulled up and said  -  &#8220;your back tyre is looking a little low&#8221;. No problem we thought - we&#8217;ll just pump it up a bit and off we go. No such luck - the inner tube had rotated slightly in the tire resulting in the valve being at such a funny angle that no pump would attach to it. No matter what we tried we couldn&#8217;t move the inner tube around so in the end we figured we&#8217;d just have to let the whole tyre down, move the inner tube around, and then pump it up again.</p>
<p>We were soon pumping the tyre up again - but every time we stopped there was a loud hissing - puncture. Unfortunately the puncture turned out to be right on the valve - probably because the inner tube had pinched&#8230; No puncture repair kit was going to fix that and the only inner tube we had was too big for my tyre.</p>
<p>After some debating I decided the best thing to do was to leave my bike nice and hidden in the bushes. Walk home (about 1 1/2 hours), pick up the car and then drive back to pick up my bike. The only problem with this truly cunning plan was that Vlad and I weren&#8217;t entirely sure where we were&#8230; all we knew is we were approximately 1/2 way around the lake (though it later turned out to be 3/4 way around the lake - throwing our directions off slightly).</p>
<p>However, all was not lost. Vlad&#8217;s mobile had GPS on it and so we were able to walk roughly in the direction of home. At one point we slightly overshot our turning and the distance started increasing so I decided to take a shortcut through some woods rather than following the path.  This seemed quite productive until we hit a locked gate next to a road&#8230; wondering why the gate onto the woods we&#8217;d just walked through was closed we climbed over and then saw the &#8216;DANGER! Army Training Grounds. DO NOT ENTER&#8221; signs in bright red coupled with the &#8216;Do NOT pickup suspicious objects&#8221; with a delightful picture of an explosion - oops.</p>
<p>Anyway&#8230; this is basically where the excitement ended. From here on we walked home, got the car, picked up the bike and then decided a BBQ was an excellent idea&#8230; the only think I&#8217;m regretting about the whole experience is that our chosen location for our attempted repairs on my bike was riddled with midgies - I now have rather red, bumpy and itchy legs <img src='http://www.michael-clarke-blog.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> I count approximately 16 bites on one leg and 44 on the other&#8230; time to go to the super market and pick up some cream for insect bites me thinks&#8230;</p>
<p>On a lighter note it turns out that Friday was Fraser&#8217;s (my house mate) birthday. He kept that very quiet - the only reason I found out was because I saw one of his cards&#8230;. As such we bought a cake which we all consumed after the BBQ last night.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.michael-clarke-blog.com/2008/05/11/a-bike-ride-that-went-wrong/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Back to Sunny Wales for the Weekend</title>
		<link>http://www.michael-clarke-blog.com/2008/05/07/back-to-sunny-wales-for-the-weekend/</link>
		<comments>http://www.michael-clarke-blog.com/2008/05/07/back-to-sunny-wales-for-the-weekend/#comments</comments>
		<pubDate>Wed, 07 May 2008 17:02:38 +0000</pubDate>
		<dc:creator>Michael Clarke</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.michael-clarke-blog.com/2008/05/07/back-to-sunny-wales-for-the-weekend/</guid>
		<description><![CDATA[Given how this weekend just passed was a bank holiday weekend I decided to go back home to Sunny Wales. Usually it&#8217;s a bit of a joke - &#8216;Sunny Wales&#8217; - but this weekend it was beautiful weather and so we visited Lake Vyrnwy - about a 15 minute drive from home&#8230;
I&#8217;ve got to admit [...]]]></description>
			<content:encoded><![CDATA[<p>Given how this weekend just passed was a bank holiday weekend I decided to go back home to Sunny Wales. Usually it&#8217;s a bit of a joke - &#8216;Sunny Wales&#8217; - but this weekend it was beautiful weather and so we visited Lake Vyrnwy - about a 15 minute drive from home&#8230;</p>
<p>I&#8217;ve got to admit that being down south in Farnborough for the last year really makes you appriciate the views back home that you normally just take for granted.</p>
<p align="center"><a href="http://michael-clarke-blog.com/images/Image066.jpg"></a></p>
<p style="text-align: center"><a href="http://michael-clarke-blog.com/images/Image066.jpg"><img src="http://michael-clarke-blog.com/images/Image066.jpg" height="287" width="385" /></a></p>
<p align="center"><a href="http://michael-clarke-blog.com/images/Image071.jpg"></a></p>
<p style="text-align: center" align="left"><a href="http://michael-clarke-blog.com/images/Image071.jpg"><img src="http://michael-clarke-blog.com/images/Image071.jpg" height="287" width="385" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.michael-clarke-blog.com/2008/05/07/back-to-sunny-wales-for-the-weekend/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
