Topics and trends related to the Java ecosystem with occasional random rants.

  • Sun
    February 7, 2007

Framework to Help Create Small Footprint RAM Resident Solaris Configurations

James Connors
Principal Solutions Consultant

As Sun continues to avail more of its intellectual property to the
community, the advantages Sun employees have regarding access to
internal resources almost disappear.  In fact now when attempting
to post questions to internal Sun mail aliases, I am often times
redirected to the community.  The ramifications of this change hit me
square in the gut this summer.

Having stumbled upon an internal project investigating how Solaris might be minimized for
embedded use, I thought an interesting offshoot of this effort might be
to create a ZFS appliance.  This device would boot from flash entirely
into RAM, and all state would be maintained by the ZFS volumes.  Turns
out this may be a little more tricky than anticipated, and future ZFS
enhancements to Solaris (ZFS boot) may make this idea moot.

Based on an OpenSolaris ZFS discussion
I initiated, observers went off and wrote about this topic elsewhere, some
predicting that Sun would be releasing embedded ZFS appliances.  Whoa,
hold on there, not so fast.  We have no plans (at least that I know of) to do any such thing.  This was nothing more than a pet project of mine.  Serves me right for announcing that I was a Sun employee.

But there was some good that came out of this dialog.  In addition to learning
the valuable lesson of being careful what you write, interest in the notion of using Solaris as
an "embedded" OS was quite apparent.   As a consequence,  I thought it might make sense to
publish the basic framework used to create a custom Solaris
miniroot.  Included below is the introduction section of the README file: 

1.0 Introduction

the advent of Solaris 10 Update 1 and its migration to the grub(5)
bootloader, it becomes quite feasible and straightforward to consider
creating small footprint "embedded" versions of Solaris which boot
directly into RAM. This project is based upon work done by Shudong Zhou
to create a minimized Solaris for embedded use.  The doc/ directory
contains some of the original documentation and scripts used to build
such an environment.

It is expected that entities may
want to provide further functionality and customizations to this
environment. In order to assist in this endeavor, the original work has
been enhanced to utilize the Java-based ant(1) build tool. For a
further description on how a miniroot image is created, see the section
on "Understanding the ant(1) build process".

You can download the framework here

Miscellaneous notes:

  • This
    framework assumes availability of a standard Solaris distribution. 
    Although not confirmed, I suspect it may not be real hard to
    augment for OpenSolaris.
  • The current framework produces a RAM resident version of Solaris that is about 60MB in size.  Note: there is no windowing included.
  • These
    configs are system specific.  The reference implementation for the
    included framework is an iGoLogic i84810 motherboard.  Some key specs
    • 1 GHz Celeron Processor
    • 512 MB RAM on board
    • Compact Flash slot on bottom of motherboard
    • 146mm x 104mm
    • Runs Solaris 10 U3 out of the box
    • For more info contact iGoLogic an http://www.igologic.com
  • Once an image is created, you'll need to set up grub(5) on your media.  Here's a pointer to a URL explaining Grub on a stick.  A copy of this URL is also included in the framework under the doc/ directory.
  • Here's a picture of the motherboard with ruler included to give you a feel for its size. 

Join the discussion

Comments ( 6 )
  • Mike Kiedrowski Friday, February 9, 2007
    Hi Jim,
    Thanks for posting this. I just did a build using SXCR b_54.
    Besides changing the obvious '/Solaris_10/Product' type stuff
    to Sol 11 the only other changes I had to make were:
    libcrypto.so.0.9.7 is now version 0.9.8 in SXCR
    'network/pfil:default setprop general/enabled=false'
    network/pfil:default is gone in SXCR.
    Once that was fixed the build went off without a complaint.
    I'm going to spend some time this weekend and attempt to get it
    installed on some media (USB stick probably) and see if I can get it to boot.
    After that, I'm thinking of trying to add something like microwindows (now called Nano-X
    thanks to MS) or something similar.
    I'm using a VIA EPIA-MII mainboard with basically the same specs as the board you
    mention in this blog.
    Very cool.
    Thanks again,
  • Jim Connors Monday, February 12, 2007
    Thanks for the confirming that the move to Nevada isn't too painful. Note: I did play around a little with booting a minimal Solaris on a Mini-ITX Via motherboard. The USB interface was painfully slow. It took something like 8 minutes to boot from USB to RAM. With newer hardware and better USB interfaces, this should be a lot better.
    -- Jim C
  • James Snyder Monday, February 19, 2007
    Just stumbled across this while looking for a ZFS NAS solution. My Solaris experience is pretty limited, but I've got a NAS box (which atm I'm planning to use FreeNAS with) on the way based on the Asus Terminator C3 (Via C3 800mhz). I'm planning to give this a shot as well, to see how difficult it might be to get it up and running on that hardware.
    Quick question: Is your flash boot solution over USB or ATA? The setup I've got coming has an ATA->CF adapter included, and I'm wondering whether you might know if booting from this would work out of the box? I've seen some commentary in the appliance discussions that seem to indicate there are issues here, but I wasn't sure if that's solely related to getting Solaris small enough? Also, is the 60mb all that one will need on-disk for storage?
  • Jim Connors Tuesday, February 20, 2007
    This solution can boot from both USB and flash. I honestly don't know how the flash socket interfaces with the motherboard, only that the BIOS gives options to boot from flash or USB. The trick is to get grub on either your USB and/or flash device.
    As to whether you'll be able to boot right out of the box depends upon your system. This boot image is definitely machine-specific. Your system may require special device drivers, among others, which aren't included in this miniroot.
    With regards to size, the image is approximately 60MB expanded. Grub actually stores it as a compressed image, consequently it takes up only about 30MB on flash. The image, plus the minimal Grub overhead is all that's needed. In effect the flash or USB device, is read-only, much like the way a CD-ROM is used to install Solaris. Once the image is booted, Solaris runs entirely from RAM.
  • Kim Rowe Thursday, June 14, 2007
    way cool ... of course zfs is the best performance solution around as far as I'm aware so the ability to run in a small footprint is of great interest to us.
    If we wanted to have real-time performance, on contiguous files, what additional zfs changes would be required?
    If we wanted real-time OS performance (and I know its been discussed and shot down many times at Sun), would porting onto a small fast posix kernel be doable with moderate effort?
    Great work guys!
  • guest Thursday, June 14, 2007
    Hi Kim ... Just a few things. (1) The included miniroot for this project does not supply ZFS functionality. In my opinion it got a little to kludgy to implement for this version. (2) I think your real-time/ZFS question would best be posed to the OpenSolaris ZFS community found on http://www.opensolaris.org. (3) Does the soft real-time capabilities of Solaris not fit the bill at all?
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.