<?xml version="1.0"?><rss version="2.0">
<channel>
  <title>Alan&#039;s Ramblings - Solaris category</title>
  <link>http://bleaklow.com:80/categories/tech/solaris/</link>
  <description>My opinions may be incorrect, but they are my own</description>
  <language>en</language>
  <copyright>Alan Burlison</copyright>
  <lastBuildDate>Sun, 05 Sep 2010 20:50:00 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  <item>
    <title>A Makefile for Arduino Sketches</title>
    <link>http://bleaklow.com:80/2010/06/04/a_makefile_for_arduino_sketches.html</link>
    <description>
          When I started tinkering with &lt;a href=&#034;http://arduino.cc&#034;&gt;Arduinos&lt;/a&gt; I started out with the standard &lt;a href=&#034;http://arduino.cc/en/uploads/Guide/Arduino0018Blink.png&#034;&gt;Arduino IDE&lt;/a&gt;.  It&#039;s great for &lt;a href=&#034;http://arduino.cc/en/Guide/Environment&#034;&gt;getting started quickly&lt;/a&gt; but for more complex work, such as those involving libraries shared between Sketches, it quickly becomes limiting.  What I wanted was to continue using the standard Arduino &lt;a href=&#034;http://arduino.cc/en/Reference/Extended&#034;&gt;libraries&lt;/a&gt; but to switch to a more capable IDE.  I already use &lt;a href=&#034;http://netbeans.org/&#034;&gt;NetBeans&lt;/a&gt; so I wanted to try to use that if possible.  The first step was to come up with a way of building Arduino Sketches from outside the Arduino IDE.  The Arduino distribution includes a number of old, deprecated Makefiles, but nothing that was really usable.  I therefore set to and wrote my own.  I&#039;ve followed the standard layout we use at work, with a &#039;master&#039; Makefile that contains most of the logic, which is then included into a per-project Makefile that sets up the required configuration for the rules in the master Makefile.  It is available &lt;a href=&#034;http://bleaklow.com/files/2010/Makefile.master&#034;&gt;here&lt;/a&gt;.  An example project Makefile looks like this:
&lt;/p&gt;
&lt;pre&gt;BOARD = atmega328
PORT = /dev/term/0
LIB_DIRS = ../Common/Task ../Common/VirtualWire
include ../Makefile.master
&lt;/pre&gt;
&lt;p&gt;
Some notes about how to use the Makefile:
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
At the moment the Makefile is pretty Solaris-specific, because I haven&#039;t had the time to get it all going under a Linux VM, although the required changes are simple.  Patches are welcome :-)
&lt;/li&gt;
&lt;br&gt;
&lt;li&gt;
You&#039;ll need the standard Arduino environment installed first, either version 0018 or 0019.
&lt;/li&gt;
&lt;br&gt;
&lt;li&gt;
You must use &lt;a href=&#034;http://www.gnu.org/software/make/&#034;&gt;gmake&lt;/a&gt; as your make implementation - not usually a problem as it comes included in the Arduino environment.
&lt;/li&gt;
&lt;br&gt;
&lt;li&gt;
The valid values for &lt;code&gt;BOARD&lt;/code&gt; are those found in the standard &lt;a href=&#034;http://code.google.com/p/arduino/source/browse/trunk/hardware/arduino/boards.txt&#034;&gt;boards.txt&lt;/a&gt; file, that file is parsed to extract the relevant values for the Makefile.  &lt;code&gt;PORT&lt;/code&gt; is the path of the USB port that the Arduino is attached to.  &lt;code&gt;LIB_DIRS&lt;/code&gt; is a list of directories containing any libraries that you want to use.
&lt;/li&gt;
&lt;br&gt;
&lt;li&gt;
The following targets are provided in the Makefile:
&lt;br&gt;&lt;br&gt;
&lt;ul&gt;
  &lt;li&gt;
  &lt;strong&gt;all&lt;/strong&gt; - build everything (default).
  &lt;/li&gt;
  &lt;li&gt;
  &lt;strong&gt;clean&lt;/strong&gt; - remove all generated files.
  &lt;/li&gt;
  &lt;li&gt;
  &lt;strong&gt;upload&lt;/strong&gt; - build everything and upload to the board.
  &lt;/li&gt;
  &lt;li&gt;
  &lt;strong&gt;monitor&lt;/strong&gt; - run the serial monitor.
  &lt;/li&gt;
  &lt;li&gt;
  &lt;strong&gt;upload_monitor&lt;/strong&gt; - build everything, upload to the board and run the serial monitor.
  &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;br&gt;
&lt;li&gt;
You don&#039;t need to explicitly list the various &lt;code&gt;.c&lt;/code&gt;, &lt;code&gt;.cpp&lt;/code&gt; and &lt;code&gt;.pde&lt;/code&gt; files that make up your application, the makefile assumes that any such files it finds in the various source directories are all to be compiled.
&lt;/li&gt;
&lt;br&gt;
&lt;li&gt;
The processing of the Sketch (.pde) files is very simplistic, much more so than the processing done by the Arduino IDE.  There&#039;s talk on the Arduino development list of splitting the Sketch-to-C++ processing out into a separate library so it can be reused, but it hasn&#039;t happened yet.  I&#039;ve actually stopped using .pde files and now just write my own &lt;code&gt;main.cpp&lt;/code&gt;, it&#039;s &lt;a href=&#034;http://code.google.com/p/arduino/source/browse/trunk/hardware/arduino/cores/arduino/main.cpp&#034;&gt;simple enough&lt;/a&gt; not to be any sort of an inconvenience to do so.
&lt;/li&gt;
&lt;br&gt;
&lt;li&gt;
The output is all created in the &lt;code&gt;build&lt;/code&gt; subdirectory of the Sketch&#039;s directory.  That means it doesn&#039;t interfere with anything if you still want to be able to use the standard Arduino environment.
&lt;/li&gt;
&lt;br&gt;
&lt;li&gt;
Unlike the Arduino IDE which rebuilds everything every time, the Makefile only builds files that have changed.  One caveat: if you change the board type in the Makefile, be sure to run &lt;code&gt;make clean; make&lt;/code&gt; afterwards to rebuild everything correctly.
&lt;/li&gt;
&lt;br&gt;
&lt;li&gt;
The Makefile builds three archive libraries in the &lt;code&gt;build&lt;/code&gt; directory:
&lt;br&gt;&lt;br&gt;
&lt;ul&gt;
  &lt;li&gt;
  libarduino.a - this contains the object code of the standard Arduino run-time libraries.
  &lt;/li&gt;
  &lt;li&gt;
  liblibrary.a - this contains the object code of any libraries you specified in the &lt;code&gt;LIB_DIRS&lt;/code&gt; Makefile variable.
  &lt;/li&gt;
  &lt;li&gt;
  libsketch.a - this contains the object code of the files that comprise your Sketch.
  &lt;/li&gt;
&lt;/ul&gt;
&lt;br&gt;
The use of archive libraries allows the linker to only include object files that provide referenced symbols, which will result in smaller executables if you use libraries that contain code that you don&#039;t actually use in your Sketch.
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
I tried offering the Makefile to the Arduino developers but they seem a little, ummm... &lt;i&gt;reluctant&lt;/i&gt; to take contributions in areas outside of their immediate goals.  I understand they want to concentrate their efforts on their priorities, but if they want to grow the pool of people developing the Arduino platform (as opposed to growing the community developing &lt;i&gt;on&lt;/i&gt; the platform) they are going to have to change their approach.  It&#039;s not just me that has had this experience, the changes for the &lt;a href=&#034;http://www.edplese.com/arduino-on-solaris.html&#034;&gt;Solaris Arduino port&lt;/a&gt; also haven&#039;t made their way back in.
&lt;/p&gt;
&lt;p&gt;
I&#039;ll write a followup post on how I&#039;ve used the Makefile to enable me to use NetBeans as my Arduino development environment, including all the nice features such as code completion, pre-compilation error checking and syntax highlighting, so please check back for more!
&lt;/p&gt;</description>
      <category>Solaris</category>
    <category>Arduino</category>
    <category>Tech</category>
    <comments>http://bleaklow.com:80/2010/06/04/a_makefile_for_arduino_sketches.html#comments</comments>
    <guid isPermaLink="true">http://bleaklow.com:80/2010/06/04/a_makefile_for_arduino_sketches.html</guid>
    <pubDate>Fri, 04 Jun 2010 15:19:00 GMT</pubDate>
  </item>
  <item>
    <title>Stephen, I wonder if you recognise this?</title>
    <link>http://bleaklow.com:80/2010/05/22/stephen_i_wonder_if_you_recognise_this.html</link>
    <description>
          &lt;p&gt;
&lt;a href=&#034;images/2010/s8_beta_hat.jpeg&#034; onclick=&#034;window.open(&#039;images/2010/s8_beta_hat.jpeg&#039;,&#039;popup&#039;,&#039;width=660,height=660,toolbar=no,directories=no,location=no,menubar=no,status=no&#039;); return false&#034; class=&#034;thumbnailLink&#034;&gt;&lt;img src=&#034;images/2010/thumbnails/s8_beta_hat.jpeg&#034; alt=&#034;&#034; class=&#034;thumbnailImage&#034;/&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
I was reminiscing with Stephen about work yesterday, It&#039;s very faded after much use, but I wonder if he&#039;ll recognise the hat :-)
&lt;/p&gt;</description>
      <category>Solaris</category>
    <category>Friends</category>
    <category>Work</category>
    <comments>http://bleaklow.com:80/2010/05/22/stephen_i_wonder_if_you_recognise_this.html#comments</comments>
    <guid isPermaLink="true">http://bleaklow.com:80/2010/05/22/stephen_i_wonder_if_you_recognise_this.html</guid>
    <pubDate>Sat, 22 May 2010 18:39:00 GMT</pubDate>
  </item>
  <item>
    <title>Arduino on OpenSolaris</title>
    <link>http://bleaklow.com:80/2009/12/12/arduino_on_opensolaris.html</link>
    <description>
          &lt;p&gt;
&lt;a href=&#034;http://www.edplese.com/blog/&#034;&gt;Ed Plese&lt;/a&gt; has kindly provided OpenSolaris x86 binaries for the &lt;a href=&#034;http://www.arduino.cc/&#034;&gt;Arduino&lt;/a&gt; development environment. This includes all the necessary dependencies such as avr-gcc. and will work on &lt;a href=&#034;http://opensolaris.org&#034;&gt;OpenSolaris&lt;/a&gt; x86 build snv_113 onwards. The tarball is hosted on the Sun Download Centre, see the page at &lt;a href=&#034;http://hub.opensolaris.org/bin/view/Main/arduino&#034;&gt;OpenSolaris.org&lt;/a&gt; for more details and
links to the downloads.
&lt;/p&gt;
&lt;p&gt;
Thanks to Ed for doing the work necessary to make this available for the
OpenSolaris community.
&lt;/p&gt;</description>
      <category>Solaris</category>
    <category>Arduino</category>
    <category>Tech</category>
    <comments>http://bleaklow.com:80/2009/12/12/arduino_on_opensolaris.html#comments</comments>
    <guid isPermaLink="true">http://bleaklow.com:80/2009/12/12/arduino_on_opensolaris.html</guid>
    <pubDate>Sat, 12 Dec 2009 01:09:00 GMT</pubDate>
  </item>
  <item>
    <title>Upgrading from Nevada to OpenSolaris the easy way</title>
    <link>http://bleaklow.com:80/2009/10/21/upgrading_from_nevada_to_opensolaris_the_easy_way.html</link>
    <description>
          &lt;p&gt;
The OpenSolaris installer is simple and quick to use but it has one significant drawback - it gives you no control of how your disk is laid out.  I needed to upgrade my Toshiba R500 laptop from Nevada to OpenSolaris and I had the disk set up with 3 VTOC slices - 2 ZFS pools, one for the root pool and one for a data pool - home dirs, installed software and so on.  The final slice is a raw swap device. A straightforward install would have overwritten the entire disk, so I wanted to find a way of installing without clobbering everything. &lt;a href=&#034;http://blogs.sun.com/edp/entry/moving_from_nevada_and_live&#034;&gt;Ed Pilatowicz&lt;/a&gt; outlined some time back how you could do a hand-crafted OpenSolaris install to work around this, but I wanted to see if there was an easier way of achieving the same result with a more recent build of OpenSolaris.
&lt;/p&gt;
&lt;p&gt;
My first attempt was to use the OpenSolaris 2009.06 livecd to install OpenSolaris onto a 8Gb USB stick so I could boot off that and have a poke around.  That was fairly straightforward, but when I tried importing the existing root pool from the disk I hit a problem - the Nevada build I was running was onnv_124, but 2009.06 was based on 111b and the ZFS format has been rev&#039;d since then so the pool wouldn&#039;t import.  I then tried to update my USB image to build 125, but the stick wasn&#039;t big enough for the 125 BE and the &#039;&lt;a href=&#034;http://opensolaris.org/sc/src/pkg/gate/src/man/pkg.1.txt&#034;&gt;pkg image-update&lt;/a&gt;&#039; failed.  Drat.
&lt;/p&gt;
&lt;p&gt;
Third try was to pull a build 125 livecd image from the internal repo, boot off that and do a fresh install onto the USB stick.  As before that worked fine so I rebooted off the USB stick.  When I originally installed Nevada I had renamed the root pool from &#039;rpool&#039; to &#039;solaris&#039;, so I typed &#039;&lt;a href=&#034;http://docs.sun.com/app/docs/doc/819-2240/zpool-1m&#034;&gt;zpool import solaris&lt;/a&gt;&#039; and my existing boot pool on the drive appeared - looking good so far.  Next thing to try was &#039;&lt;a href=&#034;http://dlc.sun.com/osol/docs/content/2008.11/snapupgrade/ggfxy.html&#034;&gt;beadm list&lt;/a&gt;&#039;, and not only did my OpenSolaris BE show up, but the Nevada BEs on the drive also appeared.  Ok, so far so good.
&lt;/p&gt;
&lt;p&gt;
Now I needed to try to get an OpenSolaris BE onto the disk root pool.  Worst case I could just blow away the existing root pool on the drive and create an OpenSolaris BE in that, but I wanted to see if I could preserve the existing Nevada BEs if possible.  As Nevada and OpenSolaris are very similar and as I was using Nevada 124 and OpenSolaris 125 I figured there was a reasonable chance that if I could just get an OpenSolaris BE into the existing root pool I&#039;d be able to get it into the grub config so I could boot it, even if that meant some hand-editing of menu.lst.
&lt;/p&gt;
&lt;p&gt;
The easiest way to get an OpenSolaris BE onto the disk was to use &#039;beadm create&#039;.  Normally that creates the new BE on the same volume as the source BE, but there&#039;s a &#039;-p&#039; flag that allows you to specify an alternate pool to do the install into, which in my case was the existing &#039;solaris&#039; pool on my disk - so, &#039;beadm create -p solaris on_125&#039;.  That seemed to work OK, so with everything appropriately crossed I typed &#039;beadm activate on_125&#039; and rebooted.  When Grub appeared, my new OpenSolaris BE was listed along with my existing Nevada ones, and both the OpenSolaris and Nevada BEs work just fine.  Huzzah!
&lt;/p&gt;
&lt;p&gt;
So, to summarise, here are the steps:
&lt;ul&gt;
&lt;li&gt;Make sure you are running a recent Nevada release&lt;/li&gt;
&lt;li&gt;&lt;a href=&#034;http://dlc.sun.com/torrents/info/&#034;&gt;Obtain&lt;/a&gt; an OpenSolaris LiveCD image that is close to or the same as your Nevada release&lt;/li&gt;
&lt;li&gt;Install OpenSolaris onto a spare disk - a 8Gb or larger USB memory stick or a USB disk will do fine&lt;/li&gt;
&lt;li&gt;Boot into the OpenSolaris image&lt;/li&gt;
&lt;li&gt;Import your existing root zpool - see below why this many not be as easy for you as it was for me&lt;/li&gt;
&lt;li&gt;Create a new OpenSolaris BE on the imported pool with &#039;beadm&#039; using the &#039;-p&#039; flag to specify the imported pool&lt;/li&gt;
&lt;li&gt;Activate the new BE&lt;/li&gt;
&lt;li&gt;Reboot, and you should see your existing Nevada BEs along with the OpenSolaris one which will be booted by default&lt;/a&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;
Some caveats - this is clearly unsupported, don&#039;t be surprised if it doesn&#039;t work with a different mix of OpenSolaris and Nevada builds and don&#039;t blame me if it fries your machine.  Also, this isn&#039;t a true upgrade in that you end up with a new OpenSolaris install and you&#039;ll have to manually migrate the necessary config from your Nevada BE into the OpenSolaris one - but at least you&#039;ll still have your Nevada BE :-) The final thing is I definitely got lucky - When I originally installed I&#039;d renamed my Nevada root pool from &#039;rpool&#039; to &#039;solaris&#039;.  That meant I could import it without it conflicting with the name of the root pool on the USB stick.  If I hadn&#039;t done so I&#039;d have to have imported it using the pool identifier and a new name.  That would almost certainly have invalidated the contents of the menu.lst on that drive, so unless beadm fixed it up for me I&#039;d have had to do some surgery to fix it up.  If you try this yourself and figure out what&#039;s needed, please drop me a comment to let me know what you did :-)
&lt;/p&gt;</description>
      <category>Solaris</category>
    <category>Tech</category>
    <category>Work</category>
    <comments>http://bleaklow.com:80/2009/10/21/upgrading_from_nevada_to_opensolaris_the_easy_way.html#comments</comments>
    <guid isPermaLink="true">http://bleaklow.com:80/2009/10/21/upgrading_from_nevada_to_opensolaris_the_easy_way.html</guid>
    <pubDate>Wed, 21 Oct 2009 11:26:00 GMT</pubDate>
  </item>
  <item>
    <title>The new opensolaris.org user management webapp moves into the light</title>
    <link>http://bleaklow.com:80/2007/09/28/the_new_opensolaris_org_user_management_webapp_moves_into_the_light.html</link>
    <description>
          &lt;p&gt;
As outlined &lt;a href=&#034;http://opensolaris.org/os/project/website/website_restructuring/&#034;&gt;here&lt;/a&gt; I&#039;ve been working away on providing the infrastructure needed to break up the current monolithic J2EE application used to host &lt;a href=&#034;http://opensolaris.org&#034;&gt;opensolaris.org&lt;/a&gt;.  I&#039;ve &lt;a href=&#034;http://blogs.sun.com/alanbur/entry/source_code_for_the_opensolaris&#034;&gt;just released&lt;/a&gt; the source code of the existing portal, a large J2EE application.  As detailed in the restructuring document, the intention is to split the functionality of the current webapp into smaller, more manageable parts.  As I was releasing the portal code, I thought it was a good time to move my development repository outside as well.  Accordingly, you can browse the source at:
&lt;p&gt;
&lt;a href=&#034;http://src.opensolaris.org/source/xref/website/auth/trunk/&#034;&gt;http://src.opensolaris.org/source/xref/website/auth/trunk/&lt;/a&gt;
&lt;p&gt;
and the source can be accessed via anonymous SVN at:
&lt;p&gt;
svn+ssh://anon@opensolaris.org/svn/website/auth
&lt;p&gt;
It is *very* rudimentary and is *far* from being finished.  What I&#039;ve put on opensolaris.org is just a snapshot of my development workspace as of today.  However the database schema is available, along with a small set of dummy data which is used to populate the Derby database currently used by the prototype webapp.If you have any questions, I encourage you to &lt;a href=&#034;http://mail.opensolaris.org/mailman/listinfo/website-discuss&#034;&gt;subscribe&lt;/a&gt; to the &lt;a href=&#034;http://mail.opensolaris.org/pipermail/website-discuss/&#034;&gt;website-discuss&lt;/a&gt; mailing list and ask them there.
&lt;p&gt;</description>
      <category>Solaris</category>
    <category>Work</category>
    <comments>http://bleaklow.com:80/2007/09/28/the_new_opensolaris_org_user_management_webapp_moves_into_the_light.html#comments</comments>
    <guid isPermaLink="true">http://bleaklow.com:80/2007/09/28/the_new_opensolaris_org_user_management_webapp_moves_into_the_light.html</guid>
    <pubDate>Fri, 28 Sep 2007 15:48:25 GMT</pubDate>
  </item>
  </channel>
</rss>
