<?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>Wed, 23 Nov 2011 16:42:03 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  <image>
    <url>http://bleaklow.com/images/misc/logo.gif</url>
    <title>Alan&#039;s Ramblings (Solaris category)</title>
    <link>http://bleaklow.com:80/</link>
  </image>
  <item>
    <title>mmmmm...mbed on OpenSolaris</title>
    <link>http://bleaklow.com:80/2010/10/19/mmmmm_mbed_on_opensolaris.html</link>
    <description>
          &lt;p&gt;
&lt;img src=&#034;http://mbed.org/media/img/mbedMicrocontroller.jpg&#034; alt=&#034;mbed&#034;/&gt;
A while back, Bob from &lt;a href=&#034;http://hacman.org.uk/&#034;&gt;hacman&lt;/a&gt; mentioned that there was a &lt;a href=&#034;http://circuitcellar.com/nxpmbeddesignchallenge/&#034;&gt;competition&lt;/a&gt; running for the &lt;a href=&#034;http://mbed.org&#034;&gt;mbed&lt;/a&gt; microcontroller, and that to encourage people to enter the organisers were giving away mbeds for free, so I filled in the web application form and promptly forgot about it.  Yesterday I got an email telling me I&#039;d been allocated an mbed and that ot could take up to three weeks to arrive, so I was a little surprised to find it pop through the letterbox this morning.
&lt;/p&gt;
&lt;p&gt;
The &lt;a href=&#034;http://mbed.org/handbook/mbed-NXP-LPC1768&#034;&gt;mbed NXP LPC1768&lt;/a&gt; is quite a beastie:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;ARM Cortex-M3 Core running at 96MHz&lt;/li&gt;
&lt;li&gt;512KB FLASH, 64KB RAM&lt;/li&gt;
&lt;li&gt;Analogue, digital and PMW I/O.&lt;/li&gt;
&lt;li&gt;On-board Ethernet&lt;/li&gt;
&lt;li&gt;On-board USB&lt;/li&gt;
&lt;li&gt;CAN bus (vehicle data bus)&lt;/li&gt;
&lt;li&gt;SPI bus&lt;/li&gt;
&lt;li&gt;I2C bus&lt;/li&gt;
&lt;li&gt;On-board filesystem&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
The development environment is fairly novel as well, they&#039;ve opted for what you might call a &#039;Cloud&#039; solution.  You plug the board in to a USB port and it appears as a USB disk drive.  The compiler is hosted at &lt;a href=&#034;http://mbed.org&#034;&gt;mbed.org&lt;/a&gt; where there&#039;s web-based IDE.  You develop your code using that, and when you hit &#039;compile&#039;, you get a downloadable binary image that you save onto mbed&#039;s USB drive, then hit the &#039;reset&#039; button on the board and it runs your code.  For debugging, the board also appears as a serial device, so you can read/write from/to the device using that.
&lt;/p&gt;
&lt;p&gt;
I had no idea if it would work on Solaris but it works just fine on build 150 - I plugged it in and it appeared as a USB disk and Gnome filemanager duly popped up so I could copy images onto it.  I loaded up one of the serial demo programs and &lt;code&gt;tip -b 9600 /dev/term/0&lt;/code&gt; connected to the board and allowed me to interact with it as expected.
&lt;/p&gt;
&lt;p&gt;
I&#039;m not &lt;strong&gt;entirely&lt;/strong&gt; sure about the online IDE - sure, it&#039;s quick and easy to get started, but a bit like the Arduino IDE, I suspect you&#039;d grow out of it pretty quickly, plus having to be online just to compile code is a bit limiting on a planet that&#039;s still not got 100% network coverage.  There&#039;s &lt;a href=&#034;http://dev.frozeneskimo.com/notes/compiling_your_own_cmsis_code_for_the_mbed&#034;&gt;some information&lt;/a&gt; out there on how to set about doing things yourself, but it looks like it would be a bit of a faff to get set up - you need &lt;a href=&#034;http://www.codesourcery.com/sgpp/lite/arm/download.html&#034;&gt;Code Sourcery&#039;s ARM EABI toolchain&lt;/a&gt;, which of course isn&#039;t available in binary form for Solaris, plus there&#039;s a whole heap of other messing about that&#039;s necessary.  In fact, as far as mbed goes I&#039;d pretty much echo &lt;a href=&#034;http://dev.frozeneskimo.com/notes/compiling_your_own_cmsis_code_for_the_mbed#some_thoughts&#034;&gt;these sentiments&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
So, I&#039;m not sure quite what I&#039;ll be using my mbed for - the Ethernet support seems interesting, as does the USB support, but at £50 each I don&#039;t think I&#039;ll be rushing out and buying a load soon, when the AVR is so much cheaper and perfectly adequate for most hack projects.  I think the mbed will probably end up being a gateway between the physical and virtual worlds, for example as a bridge between the internet and a collection of wirelessly-connected Arduinos.
&lt;/p&gt;</description>
      <category>Solaris</category>
    <category>Tech</category>
    <comments>http://bleaklow.com:80/2010/10/19/mmmmm_mbed_on_opensolaris.html#comments</comments>
    <guid isPermaLink="true">http://bleaklow.com:80/2010/10/19/mmmmm_mbed_on_opensolaris.html</guid>
    <pubDate>Tue, 19 Oct 2010 21:34:00 GMT</pubDate>
  </item>
  <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;
&lt;h1&gt;Update&lt;/h1&gt;
&lt;p&gt;
Martin Oldfield has done more-or less the same thing, with more of a Linux slant.  His version can be found &lt;a href=&#034;http://mjo.tc/atelier/2009/02/arduino-cli.html&#034;&gt;here&lt;/a&gt;.
&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>
  </channel>
</rss>

