<?xml version="1.0" encoding="UTF-8" ?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
			<title>Archeia Feed</title>
			<link>http://www.archeia.com/rss_feed.html</link>
			<description></description>
			<language>en</language>
			<copyright>Copyright (C) 2008 Luke A. Guest</copyright>
			<ttl>120</ttl><item>  <title>Developing a content management system Part 2</title>  <link>http://www.archeia.com/developing-a-content-management-system-part-2.html</link>  <description><![CDATA[ <h2>Developing a content management system Part 2</h2>

<h3>System structure</h3>

<p>In this part I shall look at the overall system structure of the CMS and what each part is supposed to do. I won't go into too much detail at this point, I just
want to get an overview.</p>

<img src="assets/images/cms_design/part2/system_structure.png" alt="">

<p>Again, the <em>client</em> sends a request to the CMS, this is handled by the <em>SCGI Handler</em> which will be a queue of tasks that does the work. We uses tasking
here so we can ultimately have a number of simultaneous requests being handled at any one time which is more efficient.</p>

<p>On each request the CMS needs to know if the user has permission to do whatever they are requesting. e.g. a normal user cannot access the admin pages of any
of the Documents, Fields or API's but a normal user can view content created by a document and it's fields.</p>

<p>The CMS also needs to know what to do exactly, i.e. has the user filled in a form and sent it back to the server or has the user just selected a link to view some content?</p>

<p>The <em>Response Builder</em> utilises the various elements of the CMS (i.e. Documents, Fields, API's, etc.) to build up the page from it's various parts, send it through
the <em>template parser</em> and then pass it back to the <em>SCGI Handler</em> and thus back to the client.</p>

<p>The various elements in the CMS such as Documents, Users, Fields, etc. all access the database and thus is implied, there the database is not shown on the diagram.</p>

<p>If you have any comments or any ideas that I've missed out, please use the form below.</p>


<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>







 ]]></description>  <pubDate>Wed, 15 Feb 2012 16:10:06 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/developing-a-content-management-system-part-2.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>Developing a content management system Part 1</title>  <link>http://www.archeia.com/developing-a-content-management-system-part1.html</link>  <description><![CDATA[ <h2>Developing a content management system Part 1</h2>

    <h3>Introduction</h3>
    
    <p>This site is currently implemented using <a href="http://www.modx.com" alt="MODX, a content management system">MODX</a>, and not very well on my end as I wanted something fast. It is
      also residing on a basic <a href="http://www.linode.com" alt="Virtual Linux hosting service">Linode</a> running Debian Linux. I was always intending on creating a new site, but was most likely going to
      use an existing CMS, like <a href="http://www.drupal.org" alt="Drupal, a conent management system">Drupal</a>.</p>

    <p>I'm not a fan of PHP and have starting wanting to redevelop this site using Ada, Linode lets me rexecute binaries directly as it is a virtual system. I could use the Common Gateway
      Interface, but this is old technology and every invocation of an URL would mean that an application will have to be spawned from the web server, this is rather slow. Enhancements to
      CGI are <a href="http://en.wikipedia.org/wiki/SCGI" alt="An alternative to CGI">Simple Common Gateway Interface (SCGI)</a> and
      <a href="http://en.wikipedia.org/wiki/Fastcgi" alt="a more complex alternative to CGI and SCGI">FastCGI</a>; the former is simple to implement (hence the name), the other is
      actually quite difficult. I had previously implemented code to handle the SCGI protocol for Jesse Lang's Solid framework, so I'll use this.</p>

    <p>I'll also require a Unicode library, so I'll utilise the League library in Vadim Godunko's <a href="http://forge.ada-ru.org/matreshka" alt="Ada framework">Matreshka</a> framework.
      This does have a FastCGI implementation, but I won't be using that.</p>

    <p>Also required is template parsing, so that the document style can be replaced easily. There is a template parser library in the
      <a href="http://libre.adacore.com/libre/tools/aws/" alt="Ada Web Server">AWS</a> project I can use for this.</p>

    <h3>Key concepts</h3>

    <p>The design of this CMS is fulfill the following requirements.</p>

    <ul>
      <li>Web standards compliance</li>
      <li>Document revisions</li>
      <li>Extensibility</li>
      <li>User roles/permissions</li>
      <li>Users</li>
      <li>Internationalisation</li>
    </ul>
    
    <h3>High level design</h3>

    <p>First we need to think about how this CMS is going to be structured at a high-level, the following diagram shows this using the client-server model.</p>  

    <img src="assets/images/cms_design/part1/structure1.png" width="500" height="235" alt="High level structure of the CMS">

    <p>The CMS runs as a daemon process in the background on the operating system, the HTTPD (the web server) will be configured to send certain requests over sockets to the CMS server, the CMS will then send
      a response which in turn gets passed back to the client that requested it.</p>

    <p>You'll notice in the diagram that there is an <em>External</em> box. This basically means that there could be other servers that the CMS daemon needs to access.</p>

    <h3>System structure</h3>

    <p>The next diagram shows how the CMS fits in with the operating system. The CMS communicates with the web server via SCGI, it also interfaces to a database server and the filesystem. Very few OS
      specifics will be required:</p>

    <ol>
      <li>running the CMS as a daemon, and</li>
      <li>modules architecture.</li>
    </ol>

    <img src="assets/images/cms_design/part1/structure2.png" width="391" height="320" alt="System structure of the CMS and the OS">

    <p>I have chosen <a href="http://www.postgresql.org/" alt="An object-oriented database server">PostgreSQL</a> as the Database for storage of the various content within the CMS. I have heard very good things
      about the quality of this software from other Ada developers. There exists a number of bindings to libpq, I shall try the one in Matreshka as it also provides a common abstraction over other databases.</p>

    <h3>Abstractions</h3>

    <p>The following diagram shows the general abstractions that will be included in the CMS.</p>
    
    <img src="assets/images/cms_design/part1/structure3.png" width="409" height="332" alt="Abstractions required for the CMS">

    <ul>
      <li>Documents, Fields and API's are the basic content creation constructs.</li>
      <li>Users, Roles and Permissions are used to give the various human users of a site abilities and determine what they are allowed to do within the CMS.</li>
      <li>Modules, Cache and Database expose the CMS to the OS.</li>
    </ul>
  
    <h4>Documents</h4>

    <p>Documents are what the CMS is managing. Documents can be extended to create new types of documents, for example a site could have a blog document, an article document, a product document.</p>

    <p>Each document has a number of fields that the user can complete when entering the content:</p>

    <ul>
      <li>Title</li>
      <li>Summary</li>
      <li>Body text</li>
    </ul>

    <p>But the administrator can add new fields to the document type to give it more structure. For example, a site for a newspaper could add a photo field to a story document which could be
      shown at the top of the page and have it float to the right so the text flows around it.</p>

    <p>As stated in the key concepts from the beginning of this article, each document has revision information. The database will essentially store a new version as new
      revision of the document, unless explicitly set by the user. It should be possible to roll back to a previous revision, thus deleting any subsequent revisions.</p>

    <h4>Fields</h4>

    <p>As mentioned in the previous section, Fields provide a mechanism for adding fields to the input forms on the documents. These fields can be anything and will provide
      extra features that an administrator wants to add to a site.</p>

    <h4>API's</h4>
    
    <p>API's are added to the system and can be used by other modules to build extra features or content. These API's can provide admin interfaces if one is required.</p>

    <h4>Users</h4>

    <p>These are the human's who use the site built with the CMS. Usernames and passwords, profile information can be built up separately.</p>

    <h4>Roles</h4>

    <p>Roles are given to specific users, such as Administrator, Editor, Writer, etc.</p>

    <h4>Permissions</h4>

    <p>Permissions define what a user's role can do within the CMS, e.g. deleting content.</p>

    <h4>Modules</h4>

    <p>Modules provide a mechanism to extend the CMS with new Documents, Fields or API's to enhance the CMS. An example could be an online shopping system.</p>

    <h4>Cache</h4>

    <p>The cache is where pages are stored after they've been taken from the database, parsed, tuck together with the other template fragments and sent back to the client.</p>

    <p><em>N.B:</em> I have just had a thought about this, say you have advertising on a page, this could end up getting stuck with the same ad on every page request.</p>

    <h4>Database</h4>

    <p>The database is where the content is stored.</p>

<p>Skip to <a href="developing-a-content-management-system-part-2.html" alt="developing a content management system part 2">Part 2 of this project</a>.</p>

<p>If you have any comments or any ideas that I've missed out, please use the form below.</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>







 ]]></description>  <pubDate>Tue, 14 Feb 2012 23:44:52 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/developing-a-content-management-system-part1.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>First simple app for ARM</title>  <link>http://www.archeia.com/article-1326289725.html</link>  <description><![CDATA[ <h2>First simple app for ARM</h2>

<p>After managing to update the build scripts for TAMP's compilers, I have managed to build and run a very simple application on an STM32F4DISCOVERY board in Ada. I hacked together a basic version of the initialisation code in Ada (ported directly from C) and also used the existing startup code and linker script. This allows me to set a breakpoint in GDB and catch it when it runs. All very cool!</p>

<p>The app is called bink, even though it doesn't do anything. The code can be found on the <a href="https://github.com/Lucretia/tamp/tree/master/blink" alt="Bare metal application on ARM">TAMP GitHub site</a>.</p>


<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>







 ]]></description>  <pubDate>Wed, 11 Jan 2012 13:48:45 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/article-1326289725.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>Bare metal ARM GNAT compiler built</title>  <link>http://www.archeia.com/bare-metal-arm-gnat-compiler-built.html</link>  <description><![CDATA[ <h2>Bare metal ARM GNAT compiler built</h2>

<p>After a multitude of different builds and a few modifications to the GNAT runtime, I have finally managed to build GCC-4.6.1 C and GNAT compilers for bare metal.</p>

<p>The build utilises Newlib as the libc interface that GNAT's RTS builds upon, I've disabled sockets, files and a few other things we don't need. I've added:</p>

<ol>
  <li>system-bare-armel.ads as the bare metal system package (this can be used for any platform with a few modifications),</li>
  <li>mlib-specific-bare.adb, to enable the building of static libs within the arm-none-eabi-* tools from project files. This has also been tested with my minimal runtime using gnat.gpr, which I was told by <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47717#c6" alt="libgnat.a is special">Arno Charlet that it wouldn't work</a>.</li>
</ol>

<p>This is really good progress and also gives me some insider knowledge of GNAT, which isn't pretty!</p>

<p>I think I will use this new information to also build a GNAT to target the chipKIT Uno32 which is based on a PIC32 (MIPS core).</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>







 ]]></description>  <pubDate>Thu, 29 Sep 2011 15:13:49 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/bare-metal-arm-gnat-compiler-built.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>TAMP: Some success</title>  <link>http://www.archeia.com/tamp-some-success.html</link>  <description><![CDATA[ <h2>TAMP: Some success</h2>

<p>After spending about 2 weeks basically compiling compilers pretty much constantly, I've managed to build gnat for arm-none-eabi with tools and without the runtime system, which is the most important part.</p>

<p>This isn't supported by AdaCore in the FSF release so I've had to hack into the makefiles and configure scripts to enable it. Shame really, would be nice to have this built into the build system already. I suppose I'll just have to wait for John Marino to get it working in his fork.</p>

<p>But for now, here are the files I've copied from GNAT sources to make the zero-footprint (ZFP) runtime building:</p>

<pre class="Bash">
<dfn>Bash code</dfn>
<code>$ ./build-rts.sh beagle
Creating RTS with GCC-svn-trunk for 'beagle' board
arm-none-eabi-gcc -gnatpg -c -gnat2005 -gnatg -O2
  -ffunction-sections -fdata-sections
  --RTS=/home/laguest/src/mine/tamp/thirdparty/../rts/boards/beagle
  -I- -gnatA
  /home/laguest/src/mine/tamp/rts/src/boards/beagle/system.ads
arm-none-eabi-gcc -gnatpg -c -gnat2005 -gnatg -O2
  -ffunction-sections -fdata-sections
  --RTS=/home/laguest/src/mine/tamp/thirdparty/../rts/boards/beagle
  -I- -gnatA
  /home/laguest/src/mine/tamp/rts/src/common/a-unccon.ads
arm-none-eabi-gcc -gnatpg -c -gnat2005 -gnatg -O2
  -ffunction-sections -fdata-sections
  --RTS=/home/laguest/src/mine/tamp/thirdparty/../rts/boards/beagle
  -I- -gnatA
  /home/laguest/src/mine/tamp/rts/src/common/s-maccod.ads
arm-none-eabi-gcc -gnatpg -c -gnat2005 -gnatg -O2
  -ffunction-sections -fdata-sections
  --RTS=/home/laguest/src/mine/tamp/thirdparty/../rts/boards/beagle
  -I- -gnatA
  /home/laguest/src/mine/tamp/rts/src/common/interfac.ads
arm-none-eabi-gcc -c -gnat2005 -gnatg -O2
  -ffunction-sections -fdata-sections
  --RTS=/home/laguest/src/mine/tamp/thirdparty/../rts/boards/beagle
  -I- -gnatA
  /home/laguest/src/mine/tamp/rts/src/common/gnat.ads
arm-none-eabi-gcc -gnatpg -c -gnat2005 -gnatg -O2
  -ffunction-sections -fdata-sections
  --RTS=/home/laguest/src/mine/tamp/thirdparty/../rts/boards/beagle
  -I- -gnatA
  /home/laguest/src/mine/tamp/rts/src/common/a-uncdea.ads
arm-none-eabi-gcc -gnatpg -c -gnat2005 -gnatg -O2
  -ffunction-sections -fdata-sections
  --RTS=/home/laguest/src/mine/tamp/thirdparty/../rts/boards/beagle
  -I- -gnatA
  /home/laguest/src/mine/tamp/rts/src/common/s-stoele.adb
arm-none-eabi-gcc -gnatpg -c -gnat2005 -gnatg -O2
  -ffunction-sections -fdata-sections
  --RTS=/home/laguest/src/mine/tamp/thirdparty/../rts/boards/beagle
  -I- -gnatA
  /home/laguest/src/mine/tamp/rts/src/common/s-atacco.adb
arm-none-eabi-gcc -gnatpg -c -gnat2005 -gnatg -O2
  -ffunction-sections -fdata-sections
  --RTS=/home/laguest/src/mine/tamp/thirdparty/../rts/boards/beagle
  -I- -gnatA
  /home/laguest/src/mine/tamp/rts/src/common/ada.ads
arm-none-eabi-gcc -c -gnat2005 -gnatg -O2
  -ffunction-sections -fdata-sections
  --RTS=/home/laguest/src/mine/tamp/thirdparty/../rts/boards/beagle
  -I- -gnatA
  /home/laguest/src/mine/tamp/rts/src/common/g-souinf.ads
Exception name: SYSTEM.ASSERTIONS.ASSERT_FAILURE
Message: namet.adb:655

arm-none-eabi-gnatmake: INTERNAL ERROR. Please report.
</code>
</pre>

<p>This is so frustrating!</p>

<p>And yes, my script is executing a gnatmake project file to build!</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>







 ]]></description>  <pubDate>Sun, 13 Feb 2011 11:29:49 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/tamp-some-success.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>Tamp started</title>  <link>http://www.archeia.com/tamp-started.html</link>  <description><![CDATA[ <h2>Tamp started</h2>

<p>I have been working on getting the basic toolchain created ready for the development of TAMP. At present there are scripts for building the toolchain, but nothing else.</p>

<p>Due to GNAT being broken and not being able to create a set of cross tools without a runtime, I'm having to hack this using a set of scripts which will look like they were installed by GNAT.</p>

<p>The next stage is the development of the Zero Profile Runtime (ZFP) based on the information found on <a href="http://www2.adacore.com/wp-content/files/auto_update/gnat-hie-docs/html/gnathie_ug_4.html#SEC24" title="Supplement for High-Integrity Editions">AdaCore's GNAT Pro manual</a> in tandem with the development of a hello world style kernel.</p>

<p>You can find the repository at <a href="https://github.com/Lucretia/tamp" title="TAMP GIT repository">GitHub</a>.</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>







 ]]></description>  <pubDate>Wed, 02 Feb 2011 16:55:16 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/tamp-started.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>37 reasons to choose Ada over C</title>  <link>http://www.archeia.com/37-reasons-to-choose-ada-over-c.html</link>  <description><![CDATA[ <h2>37 reasons to choose Ada over C</h2>

<p>I was pointed at a <a href="http://www.ada95.ch/index.php?page=morris" title="C Vs Ada Religious war">link</a> which goes through a number of reasons to choose Ada over C. Although this email is now just over 11 years old, it's strange just how valid it still is.</p>

<p>It's quite a tricky read due to the format of the email.</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>







 ]]></description>  <pubDate>Sun, 02 Jan 2011 19:15:59 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/37-reasons-to-choose-ada-over-c.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>The status of wxAda</title>  <link>http://www.archeia.com/the-status-of-wxada.html</link>  <description><![CDATA[ <h2>The status of wxAda</h2>

<p>After a long break from wxAda, I'm getting back into looking at it. I've decided to start again and generate the bindings automatically using the 2.9.x interface files. Binding is a difficult proces and this could take some time to acheive. I have already started to read in the XML Doxygen output from the wxWidgets interfaces and get get the class name and the member names at the moment, it's a start anyway.</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>







 ]]></description>  <pubDate>Fri, 29 Oct 2010 16:53:38 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/the-status-of-wxada.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>Simple CGI</title>  <link>http://www.archeia.com/simple-cgi.html</link>  <description><![CDATA[ <h2>Simple CGI</h2>

<p>On the 2nd April, I finally got around to completing a SCGI implementation in Ada, which turned out easier than expected. This was sent to <a href="http://jesselang.com/" title="Jesse Lang's home page">Jesse Lang</a> for inclusion in his <a href="http://github.com/jesselang/Solid-Web" title="Solid.Web Ada library on GitHub">Solid</a> framework.</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>







 ]]></description>  <pubDate>Fri, 23 Apr 2010 17:15:18 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/simple-cgi.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>A little update</title>  <link>http://www.archeia.com/a-little-update.html</link>  <description><![CDATA[ <h2>A little update</h2>

<p>Ok, it's been a while, mainly because I didn't like what I ended up with with MODx and also the shared hosting was dog slow. I've now relocated this site onto a <a href="http://www.linode.com" title="Linux Virtual Hosting">Linode</a> using <a href="http://www.lighttpd.net" title="Small, fast HTTP server">Lighttpd</a> as the web hosting server and <a href="http://www.mysql.com" title="MySQL Database server">MySQL</a> as the database; I've only use MySQL as my existing site already used it.</p>

<p>Both the move from Apache2 and from Vexxhost has increased the speed of this site enormously, but this will only get faster later.</p>

<h4>Plans for the future</h4>

<p>Now I have this newer, faster server running, this is what I intend to do with it:</p>

<ul>
  <li>Get the mail server working using Postfix and PostgreSQL as the backend.</li>
  <li>Work on a new site using Simple CGI in Ada, this will be a lot faster than PHP.</li>
</ul>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>







 ]]></description>  <pubDate>Tue, 26 Jan 2010 08:15:32 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/a-little-update.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>Getting the Samsung YP-P2 working with Ubuntu Gutsy</title>  <link>http://www.archeia.com/getting-the-samsung-yp-p2-working-with-ubuntu-gutsy.html</link>  <description><![CDATA[ <h2>Getting the Samsung YP-P2 working with Ubuntu Gutsy</h2>

<p>I have no idea what happened yesterday when I charged it, it charged for only a few minutes then the led turned to green (meaning it's finished) yet there was virtually no charge on the battery indicator.</p>

<p>I charged it last night and it's now at full charge, so I'm happy at the moment.</p>

<p>Ubuntu Gutsy (7.10) provides the right packages to get MTP devices working, just not the right versions for the P2. To get it working somebody has put up a <a href="http://www.anythingbutipod.com/forum/showthread.php?p=213505" title="MTP mode in Ubuntu Gutsy Gibbon">repository of packages with the right versions</a> up, install these as per the instructions. These packages also add the /etc/udev/rules.d/libmtp7.rules file which has the correct line for the P2.</p>

<p>To mount the player in Gutsy, do the following:</p>

<ol>
  <li>Install mtpfs (as in the above link).</li>
  <li>Uncomment the <i>user_allow_other</i> line in the <i>/etc/fuse.conf</i> so that any user can mount the player.</li>
</ol>

<pre class="Bash">
<dfn>Bash code</dfn>
<code>$ mkdir ~/YP-P2
$ mtpfs -o allow_other ~/YP-P2/</code>
</pre>

<p>To unmount the player type:</p>

<pre class="Bash">
<dfn>Bash code</dfn>
<code>$ fusermount -u ~/YP-P2</code>
</pre>

<p>I've noticed that if RhythmBox has been started you can't use mtpfs at the same time.</p>

<h3>Upgrading the firmware</h3>

<p>Samsung have made this is a complete doddle to do, mount the P2, and copy over the 2 firmware files to the root of the device, unmount, remove the USB cable (I don't know if this is really necessary) and then reboot. On the first boot, it'll upgrade one of the files and shut down. Power it back up and it'll upgrade the next one and shut down again. Power on for the third time and all should be upgrded to the new firmware. Mine is now running the new <a href="http://www.advancedmp3players.co.uk/shop/newsdesk_info.php?newsdesk_id=100" title="Bluewave 2 firmware">Bluewave 2 firmware</a>. Or you can see <a href="http://www.yjzone.net/showthread.php?t=1938" title="Upgrading the Samsung YP-P2 firmware">screenshots of the upgrade</a>.</p>

<h3>Getting the cover art to work</h3>

<p>This took me about 2 hours to work out during which I tried all sorts of packages. Easytag doesn't work, it embeds it, but the P2 cannot read it. I couldn't work out Amarok, so that was out. Finally, I tried kid3 and it worked first time! Basically, you select all the files that you want to have the same image, add a new tag (APIC), set the encoding (UTF8), the mimetype (image/jpeg), picture type (front cover) and description (the filename in this case) and import the file into kid3. Select <b>OK</b> and then save all the files to disk. Easy as that!</p>

<h3>Playlists</h3>

<p>My success with these has been patchy really, most of the time I copy a playlist (in m3u format) to the P2 (using mtpfs, as this is supposed to convert to the native playlist format when the file is copied), I can't unmount the player (it says the device is busy). Killing mtpfs works, I can then unmount, but the playlist isn't copied across, the P2 states that it is empty. I've managed to copy a playlist over twice so far, but patchy it is.</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>








 ]]></description>  <pubDate>Wed, 13 Feb 2008 11:47:54 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/getting-the-samsung-yp-p2-working-with-ubuntu-gutsy.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>Deciding on a new MP3 player</title>  <link>http://www.archeia.com/deciding-on-a-new-mp3-player.html</link>  <description><![CDATA[ <h2>Deciding on a new MP3 player</h2>

<p>I've had an Xclef MT-500 for about 5 years now, but it has a number of problems:</p>

<ul>
  <li>The battery life is crap and I have to carry around a number of spares.</li>
  <li>internal memory can corrupt easily.</li>
  <li>There are no more firmware updates, and these can easily go wrong causing a broken player.</li>
</ul>

<p>The things it got right though were:</p>

<ul>
  <li>The provision of an SD card slot, although no-one seems to know what size limit it has.</li>
  <li>Has an FM radio.</li>
</ul>

<p>So, I started to look for a new MP3 player this week. Although the <a href="http://www.paidonresults.net/c/13721/FM39/39/0/shop/product_info.php?products_id=2597" onmouseover="window.status='http://www.advancedmp3players.co.uk/';return true;" title="Apple iPod nano 4GB MP3 Player" onmouseout="window.status=' ';return true;">Apple iPod nano 4GB MP3 Player's</a> are very sexy, they're still too much style over substance in my opinion. So, these have been ruled out.</p>

<p>I would prefer a player I can upgrade the memory of, but given that these things are such a commodity these days, it's very unlikely that I'd find one that was SD card (or similar) only. I did find the <a href="http://www.paidonresults.net/c/13721/FM39/39/0/shop/product_info.php?products_id=2281" title="COWON iAudio D2 Personal Media Player" onmouseover="window.status='http://www.advancedmp3players.co.uk/';return true;" onmouseout="window.status=' ';return true;">iAudio D2 2GB MP3 Player</a> and although it does have the SD card, for the price, I think it's a bit expensive.</p>

<p>I then found the <a href="http://www.paidonresults.net/c/13721/FM39/39/0/shop/product_info.php?products_id=2689" title="Samsung YP-P2 8GB Bluetooth Portable Media Player" onmouseover="window.status='http://www.advancedmp3players.co.uk/';return true;" onmouseout="window.status=' ';return true;">Samsung YP-P2 8GB Bluetooth Portable Media Player</a> which is slightly bigger than an iPOD Nano, but has a radio, plays films too (whether I'll use these features is unknown at this time though). But then, after a bit of searching on the net, I find that there is a 16GB version coming out, when? I've no idea. Also, a possibility of a dock with a mini-SD card slot in it (although a lot of people think it's a fake). So, if these 2 things pan out, I'm probably going to buy one of these.</p>

<p>I've found that this device can be <a href="http://jocohp.hu/?o=user_post&amp;id=58&amp;l=1" title="Using the Samsung YP-P2 on Linux">used on Linux</a>.</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>








 ]]></description>  <pubDate>Sun, 10 Feb 2008 16:35:12 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/deciding-on-a-new-mp3-player.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>The Ada Microkernel Project (or TAMP): The plan</title>  <link>http://www.archeia.com/the-ada-microkernel-project-or-tamp-the-plan.html</link>  <description><![CDATA[ <h2>The Ada Microkernel Project (or TAMP): The plan</h2>

<p>Following on from my <a href="an-ada95-hello-world-style-kernel.html" title="Hello world style kernel">hello world style kernel</a>, I've decided to post a plan for what I intend to accomplish in regards to an OS design.</p>

<p>I've been thinking about OS designs for over 10 years on and off and have wanted to develop one. Originally, I was going to do it in C but as I now use Ada more and more I want to use this language for the implementation (and assembly where necessary). The main thing that has been stopping me from developing an OS is the thought that I didn't really know how to. I pretty much know the basics of the underlying core of an OS, e.g. setting up interrupts, memory management, etc. so that is, at least, a starting point.</p>

<p>So, here's the plan; develop a microkernel based OS using Ada. This <i>OS</i> should provide a microkernel, some basic services and be able to run some applications. I'm not aiming to provide a full OS, just something to learn from. I'm also not going to be trying to implement POSIX, it'll be something else entirely.</p>

<h4>Targets</h4>

<p>I intend for the OS to be portable to other architectures and it should be capable of being compiled for big-endian <i>and</i> little-endian machines. I'll also be aiming to provide versions for both 32-bit and 64-bit architectures.</p>

<p>This might seem a bit excessive, but I believe that the OS designer should start thinking about making their OS cross platform from the outset. Here is a list of the tools I will use:</p>

<ul>
  <li>binutils-2.18</li>
  <li>GCC/GNAT-4.2.2</li>
  <li>NewLib (latest version from CVS)</li>
  <li>GNU Make (standard Ubuntu version is fine)</li>
  <li>QEMU (latest version from CVS)</li>
  <li>GRUB 2 (there's a problem with GRUB 1 segfaulting on my Ubuntu and the GRUB developers are only interesting in talking/helping with GRUB 2)</li>
</ul>

<p>These tools will be available on all Linux and Win32 platforms. I'm not too sure about MacOS X, I'm fairly sure that they have the GNU tools available, they definitely have GNAT. I'll be using Ubuntu Linux and compiling my own toolchain. I'll also be attempting to port a minimal Ada runtime so I can have full GNAT tool support (including ASIS) and I will be showing the build process of each relevant component.</p>

<p>The QEMU emulator provides a number of system targets:</p>

<ul>
  <li>ia32 (PC)
    <ul>
      <li>Little-endian</li>
      <li>32-bit</li>
      <li>Hardware TLB</li>
    </ul>
  </li>
  <li>amd64 (PC)
    <ul>
      <li>Little-endian</li>
      <li>64-bit</li>
      <li>Hardware TLB</li>
    </ul>
  </li>
  <li>MIPS (Malta board)
    <ul>
      <li>Endian switchable by running different emulators. On real hardware this is done when executing the kernel.</li>
      <li>32/64-bit</li>
      <li>Software TLB</li>
    </ul>
  </li>
</ul>

<p>QEMU provides these targets and this should keep me going for a while anyway. Also, by showing how to do memory managment using a software MMU I'll get more experience as will the reader.</p>

<p>I also forgot to mention, that apart from being different hardware, they'll also provide interesting challenges regarding the booting environment.</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>








 ]]></description>  <pubDate>Sun, 13 Jan 2008 10:10:08 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/the-ada-microkernel-project-or-tamp-the-plan.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>Site template enhancements</title>  <link>http://www.archeia.com/site-template-enhancements.html</link>  <description><![CDATA[ <h2>Site template enhancements</h2>

<p>After playing with Google AdSense and Amazon Affiliate code, I found that the size of the template was just wrong, so I've gone through and made it slightly wider. This allows for full size banners and more text in the width of the page, which I think is a bit nicer.</p>

<p>I also found that there were a few problems with IE6 (as per usual) so these have been fixed as far as I can possibly fix them.</p>

<p>Also, you'll note the styling on the tag cloud to the left, this is much nicer design-wise and also the line-height has been increased as IE6 (again) decided to render the text too close together.</p>

<p>Finally, I've added the Amazon e-store. This is a real pain as Amazon in their infinite wisdom only provide:</p>

<ol>
  <li>a direct link to the store on their site, or</li>
  <li>a frameset to embed the store into your own site, or</li>
  <li>an iframe (which is what I've used) to embed the store into you own site.</li>
</ol>

<p>Now because of this, you have to either set the iframe to scroll if it gets too big or make the frame tall enough to handle lots of data. Why can't they provide an API so we can do what we want with it and not use a frame?</p>

<p>Finally, I fixed that damned date problem I was having way back <a href="why-is-modx-showing-the-wrong-date.html" title="MODx date display problem">when</a>.</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>







 ]]></description>  <pubDate>Sat, 12 Jan 2008 15:58:46 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/site-template-enhancements.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>Amazon affiliate scheme</title>  <link>http://www.archeia.com/amazon-affiliate-scheme.html</link>  <description><![CDATA[ <h2>Amazon affiliate scheme</h2>

<p>As you can probably tell, I've been playing with the Amazon Affiliation links and have found that:</p>

<ul>
  <li>Most of them just don't fit on this site because their size.</li>
  <li>They're not customisable in regards to their size like I thought they might be.</li>
  <li>The optimised links don't seem to provide a close enough match to the content of the pages, oh well.</li>
  <li>Ths shop is too bloody wide for this site!</li>
  <li>It'd also be nice to customise the e-store links to a particular category or product as well.</li>
</ul>

<p>So, all in all, I'm not that pleased with it so far, I expected so much more. Looks like I'm going to have to go back into the templates and modify them, which I hate doing.</p>

<p>I'll continue to look into it and see what I can find, maybe I can find some scripting API for it, that might be better.</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>








 ]]></description>  <pubDate>Fri, 11 Jan 2008 14:23:55 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/amazon-affiliate-scheme.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>Samurai programming?</title>  <link>http://www.archeia.com/samurai-programming.html</link>  <description><![CDATA[ <h2>Samurai programming?</h2>

<p>I've just been reading an Ada blog and found a link to <a name="split"></a> <a href="http://www.wilshipley.com/blog/2005/02/free-programming-tips-are-worth-every.html" title="Tips every programmer should know">a number of programming tips</a> which really should be adhered to by all programmers and managers should read it so they don't get on programmer's backs causing more stress.</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>








 ]]></description>  <pubDate>Thu, 10 Jan 2008 16:36:30 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/samurai-programming.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>Professors Slam Java As &quot;Damaging&quot; To Students</title>  <link>http://www.archeia.com/professors-slam-java-as-damaging-to-students.html</link>  <description><![CDATA[ <h2>Professors Slam Java As "Damaging" To Students</h2>

<p>Just posted on SlashDot.com is an article outlining the problems with <a name="split"></a>  <a href="http://developers.slashdot.org/article.pl?sid=08/01/08/0348239&amp;from=rss" title="Teaching Java as a first programming language is damaging the future software engineer">teaching Java as a first language</a> for CS students. I can relate to this as my uni decided to change from Ada95 to Java during the second year, this was interesting at the time, but Java had only just come out and I didn't know anything about the language at the time. I can now see it's problems. In retrospect I think my uni was just jumping on the Java bandwagon. In a way there was some foresight in this as there are now a lot of jobs in industry for Java programmers, mostly banking but even some real-time (I have no idea how well this works).</p>

<p>Let's face it:</p>

<ol>
  <li>You really should have programmed before doing a CS degree anyway, but these courses do actually go through the A-level CS stuff in the first year anyway.</li>
  <li>Teaching Java is a bad idea as a first language as it doesn't touch on pointers and this is necessary for understanding the hardware (later courses will go into this).</li>
  <li>Teaching C or C++ isn't a good idea either considering it teaches really bad programming habits that are hard to get out of later on. Yes, I was a C/C++ programmer before Ada.</li>
  <li>If anyone is thinking about it, don't teach VB as a first language either, cos it's crap, half the time it works, type in the same program and it might just work the second time. This has been my experience!</li>
</ol>

<p>In my CS course they tried to teach Haskell (a functional language) and PROLOG (logic) and they failed miserably. The guy <i>teaching</i> functional programming wasn't a lecturer, didn't like lecturing and lets face it was crap at it. He took a tape recorder into the lecture as back up just in case anyone complained about the course; which they did. The guy taking the PROLOG course was actually the head of department and was Italian, not the best English speaker in the world and didn't like teaching undergraduates. PROLOG isn't the easiest language to get to grips with, but if the lecturer can't speak English that well, he's got no chance.</p>

<p>Also that article mentions formal methods, they taught us discrete maths and Z, I got to the point where I could read Z (ish), but couldn't write a spec in it to save my life. Also, the formal methods used later were an extension of this but without the Z notation (just set theory really) and relating this to actual programming practice is difficult. Let's just say, I didn't really find it easy and subsequently never used it. In industry, it's unlikely students will ever use it either.</p>

<p>Now, unfortunately, having been out of programming for a few years after total burn out I can't say my maths is the best and I've no idea if I'll ever get back to where I was when I was at uni, so I can't say if I'll ever touch a functional language again or even formal methods. Oh well.</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>








 ]]></description>  <pubDate>Wed, 09 Jan 2008 16:34:04 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/professors-slam-java-as-damaging-to-students.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>An Ada95 &quot;hello world&quot; style kernel</title>  <link>http://www.archeia.com/an-ada95-hello-world-style-kernel.html</link>  <description><![CDATA[ <h2>An Ada95 "hello world" style kernel</h2>

<p>Conversations on #Ada keep coming back to operating systems and their kernels so I decided to dig out some code I wrote in 2000 and get it working again. I intended this code to be the basis of <a href="an-operating-system-design.html" title="a microkernel written in Ada">a microkernel written in Ada</a>. The code presented here is a second attempt at using the latest version of GNAT (4.2.2) and binutils (2.18) as the first time I just couldn't get it working properly.</p>

<p>Unlike other OSes that have been written in Ada like MarteOS, RTEMS, AdaExpOS (a more full featured test kernel), I wanted to get it working using no Ada runtime, which is quite tricky. These other compilers seem to have a full runtime as they use the host's native port of the compiler and just add the <i>-nostdlib</i> flag when compiling. This isn't exactly the best way forward as you won't actually have this when targeting bare hardware.</p>

<p>Also, I didn't want to go the route of porting the Ada runtime to bare hardware - this is what other Ada OS developers do, which makes sense for specific targets, i.e. a robot in a manufacturing plant or a guided missile, but not for a general purpose OS.</p>

<p>It is possible to build GNAT so that there is no runtime installed. This is called the "Zero Foot Print" runtime which has to be configured from the <b>system.ads</b> package which needs to be modified. The configuration options that are in the private part of the system.ads package are documented in the <b>targparm.ads</b> package in the GNAT distribution.</p>

<p>Further to modifying the system package, we need to provide restrictions in the <b>gnat.adc</b> file. These restrictions are supplied using the Ada 2005 <i>pragma Restrictions</i> directive. There used to be <i>pragma No_Run_Time</i> but this is deprecated now, although I've heard it still works. So, even though the source provided is Ada95 it should be possible to compile it using an Ada95 compiler and using a different <b>gnat.adc</b> file.</p>

<p>The following commands will configure a basic compiler and other tools required.</p>

<pre class="Bash">
<dfn>Bash code</dfn>
<code>$ cd &lt;to somewhere on disk&gt;
$ mkdir -p build-binutils-2.18 build-gcc-4.2.2
$ tar -xjvpf binutils-2.18.bz2
$ tar -xjvpf gcc-core-4.2.2.bz2
$ tar -xjvpf gcc-ada-4.2.2.bz2
$ cd build-binutils-2.18
$ ../binutils-2.18/configure --prefix=$HOME/opt/cross-gcc \
    --target=i386-elf --host=x86_64-pc-linux \
    --build=x86_64-pc-linux --disable-nls \
    2>&amp;1|tee config.log
$ make
$ make install
$ export PATH=$HOME/opt/cross-gcc/bin:$PATH
$ cd ../build-gcc-4.2.2
$ ../gcc-4.2.2/configure --prefix=$HOME/opt/cross-gcc \
    --target=i386-elf --host=x86_64-pc-linux \
    --build=x86_64-pc-linux --disable-nls \
    --enable-languages=c,ada --without-headers \
    2>&amp;1|tee config.log
$ make all-gcc
$ make install-gcc</code>
</pre>

<p>You may need to change your <i>--host</i> and <i>--build</i> options to reflect what your host machine is, you may not even need them. I've added them as Ubuntu doesn't define the platform properly.</p>

<p>Now you have the compiler and tools installed you can build my test kernel by downloading it from below and extracting it somewhere, just type the following:</p>

<pre class="Bash">
<dfn>Bash code</dfn>
<code>$ tar -xzvpf multiboot.tgz
$ cd multiboot
$ make qemu</code>
</pre>

<p>As long as you have qemu installed somewhere, this will build a boot floppy and boot into GRUB. For some reason, it doesn't pick up the menu, so when booted type the following to get the menu:</p>

<pre class="Bash">
<dfn>GRUB commands</dfn>
<code>$ configfile /boot/grub/menu.lst</code>
</pre>

<p>As it stands, I'm not sure that restricting the runtime to zero footprint is the right approach. I think that providing a very limited runtime is the best way forward. This way, the kernel developer has access to aggregates, 'Image attribute (useful for debugging) and other features. Obviously it makes no sense to allow tasking or even exceptions (as far as I can see).</p>

<p><a href="assets/files/os/tutorials/multiboot.tgz" title="Download the source to my simple kernel">Download multiboot.tgz</a></p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>








 ]]></description>  <pubDate>Fri, 04 Jan 2008 11:07:39 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/an-ada95-hello-world-style-kernel.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>Persistence makes you capable</title>  <link>http://www.archeia.com/persistence-makes-you-capable.html</link>  <description><![CDATA[ <h2>Persistence makes you capable</h2>

<p>During my research of operating systems kernels, I got side tracked towards security mechanisms in operating systems and their kernels. Obviously, I'd heard of the usual 2:</p>

<ol>
  <li>Access Control Lists (ACL's), and</li>
  <li>Capabilities.</li>
</ol>

<p>ACL's are used in most OSes due to being easy to implement, and I had no idea how to implement capabilities, so I thought I'd try and research them. Seems they're incredibly hard to understand unless you're one of these research type people who spend their days writing in bizarre mathematical notation and dream in <a href="http://en.wikipedia.org/wiki/Z_notation" title="A formal mathematical language for defining software">Z</a>!</p>

<p>Whilst on IRC, I did go into the <a href="http://www.freenode.net" title="An IRC network">#erights channel on Freenode</a> and talk to the guys there who did essentially say that an object-oriented OS is basically a capability OS. They were saying that by holding onto a capability, a process has the right to access whatever that capability points to.</p>

<p>Now, from what I understand, the kernels like <a href="http://www.eros-os.org" title="An Object-Oriented persistent microkernel">EROS</a> and <a href="http://www.coyotos.org" title="Another Object-Oriented persistent microkernel written by the same guys behind EROS">Coyotos</a> define a set of objects (like a class in OOP) that are defined in the kernel. Each of these objects have a bunch of capabilities associated with them, these capabilities are like the method calls of an OOP language so that other programs can call them. So, these capabilities are essentially syscalls into the kernel via Inter-Process Communication (IPC) mechanisms.</p>

<p>Another part of my research into other security mechanisms lead me to <a href="http://www.scs.stanford.edu/histar/" title="A research operating system with an alternative to capabilities">HiStar</a>, which is a kernel based on <a href="http://en.wikipedia.org/wiki/Pi-calculus" title="A formal notation in a similar vein to Z">&Pi;-Calculus</a>, no me neither! This stuff is even harder to understand than the capability papers, maybe I should try reading them for longer rather than skimming?</p>

<h4>Persistence</h4>

<p>Another area of capability based OSes is that they tend to use persistence. This it seems, is due to:</p>

<ol>
  <li>The capabilities being managed by the kernel, and</li>
  <li>Not knowing what configuration capabilities should be in when the machine is rebooted.</li>
</ol>

<p>So, how was the <a href="http://www.gnu.org/software/hurd/hurd-l4.html" title="The GNU Foundation's long running attempt to reimplement a free UNIX operating system">HURD</a> going to do it using user-space capabilities?</p>

<p>Now, the idea of orthogonal persistence is a fine one:</p>

<ul>
  <li>You don't have to worry about saving any documents, images, etc. whilst using the OS as the checkpointing mechanism will save your data at regular intervals, i.e. at, say every 5 mins, the system will take a snapshot of the current state of the OS and save this to disk.</li>
  <li>If somebody pulls out the mains cable by accident (or to turn on a hoover), you won't have lost everything you've been working on (you might have lost something between checkpoints though), so when you restart the machine, everything (mostly) will still be present in your session.</li>
</ul>

<p>Persistence basically maps RAM onto disk. RAM is managed in page sized chunks (usually 4KB), so each page in RAM has a page on disk. When a program opens a file from disk, the OS will just memory map (mmap) the page from disk into RAM, now if the file is small (say, less than a page in size) and you also have quite a few small files open at any one time, you are essentially not utilising RAM efficiently.</p>

<h4>Conclusion</h4>

<ol>
  <li>Nobody knows how an OS based on capabilities is to present itself to the user as it's never really been done. Most capability based OSes are research projects and tend to get shelved when the research has completed and it hardly ever gets released to the public.</li>
  <li>Most of it is research and can be found in (sometimes) hard to read papers.</li>
  <li>Placing capabilities in the kernel seems to tie the <b>filesystem</b> to the kernel as well, this goes against the concept of a <i>&mu;-kernel</i>.</li>
  <li>With persistence, small files (less than the page size) can cause memory to just be eaten up really quickly.</li>
</ol>

<p>I've already set myself quite a task in using Ada as the implementation language for an OS kernel, so I think that rather than try to cram in all these extra features, I should concentrate on just getting a portable  &mu;-kernel developed</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>








 ]]></description>  <pubDate>Sun, 02 Dec 2007 13:06:28 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/persistence-makes-you-capable.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
<item>  <title>An operating system design</title>  <link>http://www.archeia.com/an-operating-system-design.html</link>  <description><![CDATA[ <h2>An operating system design</h2>

<p>Conversations in #Ada on IRC yesterday turned back to developing an OS in Ada, this has actually been a goal of mine for some time. I had written a demo <b>hello world</b> style kernel in Ada a few years ago, so I thought I'd try to recompile it using the newest version of FSF GNAT; this failed to build.</p>

<p>After looking through the manuals and finding <b>pragma Restrictions</b>, I stripped out all the other pragmas I had in there to reduce the runtime and tried it out using these <b>pragma restrictions</b>; all compiled ok and it even booted on QEMU!</p>

<p>So, I decided to try and put together a <a href="assets/files/os/highlevel.pdf" title="Download my operating system high level design document">high level design document</a> based on thoughts that I've had over the last 10 years or so, which outlines what I want in an OS. I may even get started on this thing!</p>

<div class="center article_banner">
<script type="text/javascript"><!--
google_ad_client = "pub-1197956670848234";
//468x60 - image full banner - articles
google_ad_slot = "3640510725";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>


<a name="comments"></a>








 ]]></description>  <pubDate>Sun, 25 Nov 2007 14:42:59 +0000</pubDate>  <guid isPermaLink="false">http://www.archeia.com/an-operating-system-design.html</guid>  <dc:creator>Archeia</dc:creator>   </item> 
	</channel>
</rss>

