Index: README.configure
===================================================================
--- README.configure	(revision 5d18fb057a9158336a79953b88d481c74c6eb0ae)
+++ README.configure	(revision cf65c4081950eabe7e8dd4b48459247ce3e43cb9)
@@ -25,4 +25,6 @@
 	--disable-ka9q
         --enable-cxx
+        --enable-bare-cpu-model=<MODEL>
+        --enable-bare-cpu-cflags=<FLAGS>
         --enable-gcc28               (also use enable-libcdir when disabled)
         --enable-gmake-print-directory
@@ -58,6 +60,6 @@
 egcs source tree, testgcc snapshots, or gcc 2.8.0 or newer.
 
-By default, all bsps for a target are built. There are  two ways of
-changing this:
+By default, all bsps for a target are built. The bare BSP is not built
+unless directlty specified. There are  two ways of changing this:
 
   + use the --enable-rtemsbsp otion which will set the specified
@@ -81,4 +83,5 @@
 	powerpc-rtems
 	sparc-rtems
+        bare                    see notes
 	
 The cross-compiler is set to $(target)-gcc by default. This can be
@@ -143,4 +146,14 @@
       cp libc_p.a INSTALL_POINT/lib/gcc-lib/i386-go32-rtems/2.7.2/libcgo32_p.a
 
+bare:
+
+  1.  See the README in the bare bsp source directory. This should
+      contain all info you need.
+  2.  The bare bsp source contains a script to show how to build it.
+  3.  The configure flags must be used to get the bare bsp to work.
+      The --enable-bare-cpu-model and --enable-bare-cpu-cflags are the
+      only pieces of information. The module is usually a gcc module
+      such as m68302 or mcpu32. The flags are passed directly to gcc.
+      Use "" if more than one option is specified.
 
 3. To use the installed RTEMS library
@@ -178,4 +191,5 @@
 powerpc		: papyrus
 sparc 		: erc32
+any             : bare
 
 5. Makefile structure
Index: c/PROBLEMS
===================================================================
--- c/PROBLEMS	(revision 5d18fb057a9158336a79953b88d481c74c6eb0ae)
+++ c/PROBLEMS	(revision cf65c4081950eabe7e8dd4b48459247ce3e43cb9)
@@ -56,3 +56,4 @@
      --enable-gcc28 are given.
    + force --enable-libcdir when --disable-gcc28 is given
+   + Check for bare bsp getting CPU model set.
 
Index: c/src/lib/libbsp/bare/README
===================================================================
--- c/src/lib/libbsp/bare/README	(revision 5d18fb057a9158336a79953b88d481c74c6eb0ae)
+++ c/src/lib/libbsp/bare/README	(revision cf65c4081950eabe7e8dd4b48459247ce3e43cb9)
@@ -14,4 +14,6 @@
 
 #
+# Overview
+# ~~~~~~~~
 # This board support package is not a board support package at all, but
 # a means to build the RTEMS kernel without using a specific BSP.
@@ -38,48 +40,78 @@
 # I fit all the above.
 #
+# Issues
+# ~~~~~~
+# I do not consider the bare BSP as a starting point for RTEMS. The
+# BSP code integrated into the RTEMS build tree has the advantage of 
+# building all the test and sample code. The sample and test code is
+# important for validatation of your tools, and getting your BSP 
+# working correctly.
+#
+# Once you gain experience with RTEM and your application matures the
+# need to break the BSP code out from the kernel becomes important. It
+# is at this point in time that the bare BSP becomes useful.
+#
+# Once free you are able to upgrade without the worry of makefile or
+# build tree changes which can break your BSP.
+#
+# How To Configure
+# ~~~~~~~~~~~~~~~~
+# RTEMS requires you to select a BSP inorder to build the kernel.
+# If you take a close look at a BSP which is closest to your
+# needs you will find somewhere the CPU model and CPU compile 
+# flags are specified. This is the only piece of information 
+# required by the kernel inorder for it to build.
+#
+# This highlights the clean design of the kernel and its
+# independence from the particulars of target hardware.
+#
+# The CPU model is the RTEMS model and usually tries to match with
+# the GCC model. There are variations on some processors. If you are
+# unsure please ask on the RTEMS list. Someone will know (I hope).
+#
+# The CPU flags allow you to select specific operating modes for
+# GCC. For example the PowerPC has specific flags to control various
+# cache resouces. Another example is the 68000 family of embedded
+# processor do not have FPU hardware and require software emulation.
+#
+# An example configuration command line is:
+#
+#  ../rtems-4.0/configure  --target=m68k-rtems \
+#                          --prefix=/ods/egcs/test \
+#                          --enable-cxx \
+#                          --enable-gmake-print-directory \
+#                          --disable-tests \
+#                          --disable-posix \
+#                          --enable-ka9q \
+#                          --enable-bare-cpu-cflags=-mcpu32 \
+#                          --enable-bare-cpu-model=mcpu32 \
+#                          --enable-rtemsbsp=bare
+#
+# Building RTEMS
+# ~~~~~~~~~~~~~~
+# You are required to do nothing special here. Just follow the documented
+# steps. The samples are built but no linking occurs. The link command
+# is stubbed out to produce a Unix shell script.
+#
+# After installation you will find a directory called 'bare'. The nature
+# of the RTEMS build system means the bare BSP will only install into the
+# the bare directory under the specifed configuration prefix.
+#
+# I therefore suggest you move the directory to another name. This allows
+# you to make and install another bare BSP for a different variant of
+# CPU without over writing the last installed variant.
+#
+# I have provided a script file I use to configure and build RTEMS
+# from the arcihve. Take a copy and use it if you find it useful.
+#
+# Creating an Application.
+# ~~~~~~~~~~~~~~~~~~~~~~~~
+# This is something which is usually specific to your local environment.
+# The bare BSP does not lock you into any specific makefile or build 
+# system. A couple of suggestions are:
+#
+#   o Get the sample bare BSP application, or
+#   o Watch RTEMS build a BSP which is closest to yours and copy
+#     the command lines used.
+#
 
-BSP NAME:	    bare
-BOARD:              not applicable
-BUS:                not applicable
-CPU FAMILY:         all
-COPROCESSORS:       not applicable
-MODE:               not applicable
-
-DEBUG MONITOR:      not applicable
-
-PERIPHERALS
-===========
-not applicable
-
-DRIVER INFORMATION
-==================
-not applicable
-
-STDIO
-=====
-not applicable
-
-NOTES
-=====
-
-Board description
------------------
-not applicable
-
-Host System
------------
-Linux (RedHat 4.0/5.0)
-egcs-1.0.2
-binutils-2.8.1, with rtems patches
-newlib-1.8.0, with rtems patches
-
-Verification
--------------------------------
-Single processor tests:  not applicable
-Multi-processort tests:  not applicable
-Timing tests:
-        not applicable
-
-Porting
--------
-        not applicable
Index: c/src/lib/libbsp/bare/build-tools
===================================================================
--- c/src/lib/libbsp/bare/build-tools	(revision cf65c4081950eabe7e8dd4b48459247ce3e43cb9)
+++ c/src/lib/libbsp/bare/build-tools	(revision cf65c4081950eabe7e8dd4b48459247ce3e43cb9)
@@ -0,0 +1,71 @@
+#
+# $Id$
+#
+# Tools to help doing build scripts. Adapted from Joel's bit
+# script.
+#
+
+#
+# USERCHANGE - uncomment this if you want to watch the commands.
+#
+# set -x
+
+start=`date`
+
+#
+# Common exit routine for this script so we can print the starting
+# and ending times.
+#
+
+my_exit()
+{
+  stop=`date`
+
+  echo
+  echo "Started:  " $start
+  echo "Finished: " $stop
+  exit $1
+}
+
+#
+# Handle a fatal error.
+#
+
+fatal_error()
+{
+  echo "ERROR: $*" >&2
+  my_exit 1
+}
+
+#
+# Checks the status returned by executables and exits if it is non-zero.
+#
+
+check_fatal()
+{
+  if [ $1 -ne 0 ] ; then
+    shift
+    fatal_error $*
+  fi
+}
+
+#
+# Test for a valid path, exit if not found
+#
+
+test_path()
+{
+  test -d $* || fatal_error "cannot find $*"
+  return 0
+}
+
+#
+# Create a directory and check it was made correctly.
+#
+
+checked_mkdir()
+{
+  mkdir -p $1
+  check_fatal $? "unable to make directory $1"
+  return 0
+}
Index: c/src/lib/libbsp/bare/do-bare-bsp-build
===================================================================
--- c/src/lib/libbsp/bare/do-bare-bsp-build	(revision cf65c4081950eabe7e8dd4b48459247ce3e43cb9)
+++ c/src/lib/libbsp/bare/do-bare-bsp-build	(revision cf65c4081950eabe7e8dd4b48459247ce3e43cb9)
@@ -0,0 +1,177 @@
+#!/bin/bash
+#
+# $Id$
+#
+# RTEMS Bare BSP Build Script.
+#
+# This is designed to allow recording of stdout to log. The log
+# forms part of a clean build trace for validation and verification
+# reasons.
+#
+
+. `echo $0 | sed -e 's/do-rtems-build/build-tools/'`
+
+#
+# The current versions we are building.
+#
+# Note: Please change to suite.
+#
+
+RTEMS=rtems-980618
+
+#
+# The list of processors we want the tools built for.
+#
+
+CPUS="m68k"
+
+#
+# RTEMS CPU target we want to build.
+#
+
+RTEMS_M68K_TARGETS="68000 68030 cpu32"
+
+#
+# The particular host settings we have.
+#
+# Map particulars for different hosts here.
+#
+
+HOST=`hostname`
+
+case "${HOST}" in
+  kiwi*)
+    ARCHIVE="/ods/archive"
+    TOOLS="/ods/egcs"
+    RTEMS_PATH=development/rtems/${RTEMS}
+    ;;
+  *)
+    fatal_error "host is not known."
+    ;;
+esac
+
+#
+# Where will RTEMS live when installed ?
+#
+
+RTEMS_PREFIX=${TOOLS}/test
+
+echo "Building on ${HOST}, archives in ${ARCHIVE}"
+
+#
+# Who is doing the build.
+#
+
+echo "User profile : "`id`
+
+#
+# Find out where we are
+#
+
+TOPDIR=`pwd`
+
+echo "Top directory is ${TOPDIR}"
+
+#
+# Test the paths to the archives exist.
+#
+
+test_path ${ARCHIVE}/${RTEMS_PATH}
+
+#
+# Get the RTEMS source and patch.
+#
+
+echo "Unpacking rtems source ${ARCHIVE}/${RTEMS_PATH}/${RTEMS}.tgz ... "
+tar zxf ${ARCHIVE}/${RTEMS_PATH}/${RTEMS}.tgz
+check_fatal $? "failed to unpack ${RTEMS}.tgz."
+
+#
+# Build all the processors we support.
+#
+
+for cpu in ${CPUS}; do
+{
+  #
+  # Create the target.
+  #
+
+  TARGET=${cpu}-rtems
+
+  #
+  # On to RTEMS.
+  #
+
+  case ${cpu} in
+    m68k)
+      RTEMS_TARGETS=${RTEMS_M68K_TARGETS}
+      ;;
+    *)
+      fatal_error "unknown cpu ${cpu}"
+      ;;
+  esac
+
+  for rtems_target in ${RTEMS_TARGETS}; do 
+  {
+    #
+    # Remove the target if found.
+    #
+
+    echo "Removing the RTEMS bare bsp directory rtems-bare-${rtems_target} ... "
+    rm -rf rtems-bare-${rtems_target}
+    check_fatal $? "failed to remove rtems-bare-${rtems_target}."
+
+    echo "Creating the RTEM build directory for target ${rtems_target} ... "
+    checked_mkdir rtems-bare-${rtems_target} 
+
+    cd rtems-bare-${rtems_target}
+
+    #
+    # Configure RTEMS.
+    #
+    # FIXME: the mapping from the rtems_target to the cpu flags
+    #        just happens to work for the m68k targets. This should
+    #        be mapped in a way which does not depends on the rtems_target,
+    #        or RTEMS should support multilibs.
+    #
+    
+    echo "Configuring RTEMS target bare-${rtems_target} ... "
+    ../${RTEMS}/configure --target=${TARGET} --prefix=${RTEMS_PREFIX} \
+      --enable-cxx --enable-gmake-print-directory \
+      --disable-tests --disable-posix --enable-ka9q \
+      --enable-bare-cpu-cflags=-m${rtems_target} \
+      --enable-bare-cpu-model=m${rtems_target} \
+      --enable-rtemsbsp=bare
+    check_fatal $? "failed to configure rtems target."
+
+    #
+    # Do the RTEMS build.
+    #
+
+    echo "Building RTEMS target bare-${rtems_target} ... "
+    make all install
+    check_fatal $? "failed to complete rtems build for target ${rtems_target}."
+
+    #
+    # Remove the target if found.
+    #
+
+    echo "Removing the RTEMS bare bsp directory ${RTEMS_PREFIX}/rtems/bare-${rtems_target} ... "
+    rm -rf ${RTEMS_PREFIX}/rtems/bare-${rtems_target}
+    check_fatal $? "failed to remove ${RTEMS_PREFIX}/rtems/bare-${rtems_target}."
+
+    #
+    # Fix up the fact that RTEMS always installsthe bare bsp to the bare directory
+    #
+
+    echo "Moving the RTEMS bare bsp directory to bare-${rtems_target} ... "
+    mv ${RTEMS_PREFIX}/rtems/bare ${RTEMS_PREFIX}/rtems/bare-${rtems_target}
+    check_fatal $? "failed to move the bare bsp directory to bare-${rtems_target}."
+
+    cd ../
+  }; done
+}; done
+ 
+cd ../
+
+my_exit 0
