Merge pull request #9 from interwq/master

Updated code for RTSS 2012 experiments
fixed the Makefile.end to include the cnet module
Fixed the race condition in the stack retrieval code by using cmpxchg.
Added logic to the scheduler synchronization code to do proper atomic action protected locks

Atomic instructions are now used in the scheduler code for their
per-scheduler lock.

Also added some logging code to the lock implementation...that doesn't
seem to want to run...ever.
Added support statement
update to master
update support wording a little
Reworking of the synchronization code to put the fast path into the .h file to be inlined, and keep the slow paths in the .c file.  Attempt to optimize cbuf operations, but the locks add on 90-120 cycles on an atom processor.  Just going to live with it now.

1) Move lock fast path into .h file, and inline it.
2) Separate the slow path into the library file.
3) Fix bugs related to cbuf locking: put the actual lock in a .c
   library file, rather than a .h file (in the cbuf component).
4) Remove some of the print crap from our RTSS binge.
added the init.tar to the transfer directory transfer
Started MC Composite. First step, how do we get the CPU ID in the
kernel? Answer: Save it in the TSS and push it onto stack when we get
into kernel.

Merge branch 'master' of https://github.com/gparmer/Composite

Conflicts:
	src/components/implementation/cbuf_c/naive/cbuf.c
	src/components/implementation/no_interface/connector/Makefile
	src/components/implementation/sched/base_case/base_case.c
	src/components/implementation/sched/cos_sched_base.c
	src/components/implementation/tests/unit_cbuf1/Makefile
	src/components/implementation/tests/unit_cbuf2/Makefile
	src/components/implementation/tests/unit_translator/Makefile
	src/components/interface/sched/stubs/s_stub.S
Merged with Gabe's latest repository, then
  -- add cbuf_c_claim and related
  -- add cbuf_c_introspect
  -- remove any recovery stuffs in this version
Merge branch 'master' of github.com:interwq/Composite

Conflicts:
	src/components/implementation/cbuf_c/naive/cbuf.c
	src/components/implementation/exe_cbuf_synth_hier/exe_cbuf_shbc/exe_cbuf_synth_basecase.c
	src/components/implementation/exe_cbuf_synth_hier/exe_cbuf_shrec/exe_cbuf_synth_hier.c
	src/components/implementation/no_interface/tmem_policy/tmem_policy.c
	src/components/implementation/sched/cos_sched_base.c
	src/components/implementation/tests/micro_ping_cbuf/Makefile
	src/components/implementation/tests/micro_ping_cbuf/micro_ping.c
	src/components/implementation/tests/micro_pong_cbuf/Makefile
	src/components/implementation/tests/micro_pong_cbuf/micro_pong.c
	src/components/implementation/tests/unit_cbuf1/Makefile
	src/components/implementation/tests/unit_cbuf2/Makefile
	src/components/implementation/tests/unit_translator/Makefile
	src/components/include/cbuf.h
	src/kernel/include/shared/cos_config.h
Merge pull request #11 from songjiguo/master

Merged with your last repo and remove all recovery 
Step 1 toward a low-level booter (llboot).

The goal of this string of commits is to provide a low-level boot
component that will load _all_ other components (including the normal
boot component).  The has three purposes:

1. Since only a single component is required to boot an arbitrarily
   large system (given enough memory for that single component), it
   becomes easier to boot from the bare-metal as during system boot
   up, we only need to create a single component without any
   capabilities.  A later step will include serializing this component
   image to disk so that it can be loaded as a ramdisk via the
   multi-boot standard (i.e. as a module).

2. Fault tolerance: If we want to be able to recover from faults in
   the lowest-level components such as the memory manager and the
   scheduler, then we have to have some component that can trap the
   errors, and reboot the offending component.  This is the low-level
   booter.  Support for e.g. fault handling will be included in a
   later commit.

3. To provide a low-level execution environment for the most
   timing-critical of components.  When abstractions such as the
   scheduling layer, the memory manager, file systems, stack
   management, event management, etc... entail too much overhead, and
   an application wants full access to the hardware, it can be booted
   by the low-level boot component.

Care was taken to keep the llboot component relatively small.
Discounting data-structures, and other generic code, the component is
less than 500 lines of code, and is very specialized around its
purpose.  In spite of this, it does share the majority of its code
with the normal boot component.

Currently the system does _not use the llboot_ component.  This commit
maintains backwards compatibility with existing runscripts, while
changing the way that scheduler intialization works (so that it can be
done for the root scheduler via upcall), and adds the necessary
support in the llboot component for future functionality.  To do the
latter, I had to separate out some of the normal and current
functionality for the boot component into boot_dep.h; a change that
is, again, backwards compatible.
Commit 2 in the low-level boot series: add page frame number restrictions to spds.

A component's page frame numbers that it can reference are constrained
now by checks in cos_mmap_cntl(GRANT...).  An spd can be given access
to map a given contiguous extent of physical memory.  By default,
components that are booted by Linux have access to all of physical
memory, while others have no access.  System calls (cos_pfn_cntl) are
provided to grant a page range for a component to map/unmap.
Next commit in the series toward the low-level booter.  The llboot
component now boots a simple system without the booter component.
Next commit will enable booting the booter.

Changes include:
- scheduler initialization now happens entirely from an upcall thread
- low-level booter code for memory mapping, synchronization,
  (hard-coded) scheduling, and printing.
- Modified the cpu hog component to instead print and return to test
  the configuration.
- comp0 now invokes the llbooter.
- Scheduler parent/child relationships are now manually created upon
  scheduler initialization by using the interface, as it should ahve
  been from the start.
- Separated the scheduler interface into sched.h and sched_hier.h.
Next commit in the low-level booter series.  Now both the low-level booter, and the normal booter work together to create a executable system.

Changes include:
- In the cos_loader, we now enable the booter cobj to have an
  additional section appended to it including 1) all other objects it
  is supposed to load, and 2) scheduling, initial argument, etc
  information.
- The llbooter now properly allocates physical memory to the memory
  manager, and will proportionately split physical memory between any
  components that want to do memory management.
- The scheduler interface now includes a separate sched_hier interface
  that is used for the hierarchical composition of schedulers.  The
  llbooter is the root scheduler, the memory manager is a child, and
  the main scheduler is a child of that.
- The cobj format now enables specific symbols at virtual addresses to
  be found in the cobject itself (used for looking up and modifying
  the component information page).
- The main system scheduler now becomes a scheduler through the
  sched_hier interfaces.
- Added runscripts for testing the composition of booters
  (unit_booters.sh).
Next commit in the low-level booter chronicle.  Fixed bug in the cos_loader for transparent capabilities + having a function prefix.
Next commit in the llboot series.  This fixes all of the unit* and micro* runscripts.
Final commit for the low-level boot series.  Using the low-level booter component to reboot components now works for memory manager and scheduler.  There will be bug-fixes to come, I'm sure, but for now, this is it.