# --------------------------------------------------------------- #
# -- Copyright (c) 1994, 1995 Computer Sciences Department,    -- #
# -- University of Wisconsin-Madison, subject to the terms     -- #
# -- and conditions given in the file COPYRIGHT.  All Rights   -- #
# -- Reserved.                                                 -- #
# --------------------------------------------------------------- #

This is an example VAS, called hello, that stores the string
``hello world!'' using the SSM and then prints it.

To do this, the program:
    configures the SSM
    formats a storage device
    creates a volume on the device,
    creates a file on the volume, 
    creates a record, in the file, containing the string ``hello''
    appends ``world!'' to the record
    reads the record and prints it
    shuts down the SSM

The hello program demonstrates how to start the SSM use some of its
basic features to store data.  Compiling and running it is a quick
way to test that your Shore SM installation is correct.

The hello program is rather large (aproximately 200 lines) for programs
of its kind.  Our excuse is that an analogous program/script for
Unix would be one that partitions a disk, creates a file-system on
it, creates a directory and a file to hold ``hello world!'' and then
reads the file.

Compiling and Running
---------------------

Follow these steps to compile and run the hello program.  In the
discussion below it is assumed that SHROOT is a variable pointing to
where Shore is installed.

    mkdir hello
    cp $SHROOT/examples/vas/hello/* hello
    cd hello
    cp Makefile.template Makefile
    chmod +w Makefile

Before compiling the program, edit Makefile and change the value of
the macro INSTALL_DIR to SHROOT.

    vi Makefile
    make

Before running the hello program, edit exampleconfig and change
the value of the sm_diskrw option to $SHROOT/bin/diskrw. You will
also need to make a directory for holding the log. The log directory
used is set by the sm_logdir option in exampleconfig. Running hello
will leave log files in ./log.hello and a storage device file called
./device.hello. These can be removed when you are done.

    vi exampleconfig
    mkdir log.hello
    hello
    rm -r log.hello device.hello

