Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rwxr-xr-xdocs/.project11
-rw-r--r--docs/TCF Architecture.pngbin0 -> 6941 bytes
-rw-r--r--docs/TCF Context Identifier Explanation.html257
-rwxr-xr-xdocs/TCF Getting Started.html226
-rw-r--r--docs/TCF Linux Agent Prototype.html199
-rw-r--r--docs/TCF Project.html141
-rw-r--r--docs/TCF Service - Breakpoints.html408
-rw-r--r--docs/TCF Service - File System.html1212
-rw-r--r--docs/TCF Service - Memory.html456
-rw-r--r--docs/TCF Service - Processes.html381
-rw-r--r--docs/TCF Service - Registers.html506
-rw-r--r--docs/TCF Service - Run Control.html618
-rw-r--r--docs/TCF Service - Stack Trace.html278
-rw-r--r--docs/TCF Service - System Monitor.html654
-rw-r--r--docs/TCF Services.html108
-rw-r--r--docs/TCF Specification Image1.pngbin0 -> 4771 bytes
-rw-r--r--docs/TCF Specification.html1407
-rw-r--r--docs/TCF_Launch_Dialog.jpgbin0 -> 62123 bytes
-rw-r--r--docs/TCF_RSE_Files.jpgbin0 -> 131851 bytes
-rw-r--r--docs/TCF_RSE_Processes.jpgbin0 -> 137635 bytes
-rw-r--r--docs/index.html44
21 files changed, 6906 insertions, 0 deletions
diff --git a/docs/.project b/docs/.project
new file mode 100755
index 000000000..536d25a62
--- /dev/null
+++ b/docs/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>tcf_docs</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
diff --git a/docs/TCF Architecture.png b/docs/TCF Architecture.png
new file mode 100644
index 000000000..fbf650ca0
--- /dev/null
+++ b/docs/TCF Architecture.png
Binary files differ
diff --git a/docs/TCF Context Identifier Explanation.html b/docs/TCF Context Identifier Explanation.html
new file mode 100644
index 000000000..79e5d09f4
--- /dev/null
+++ b/docs/TCF Context Identifier Explanation.html
@@ -0,0 +1,257 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+<HEAD>
+ <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1251">
+ <TITLE>TCF Context Identifier Explanation</TITLE>
+ <META NAME="GENERATOR" CONTENT="OpenOffice.org 2.2 (Win32)">
+ <META NAME="CREATED" CONTENT="20070830;12134342">
+ <META NAME="CHANGEDBY" CONTENT="Eugene Tarassov">
+ <META NAME="CHANGED" CONTENT="20070830;12351368">
+ <STYLE TYPE="text/css">
+ <!--
+ H1 { color: #000000 }
+ P { color: #000000 }
+ P.western { font-size: 13pt }
+ H2 { color: #000000 }
+ -->
+ </STYLE>
+</HEAD>
+<BODY LANG="en-US" TEXT="#000000" DIR="LTR">
+<P CLASS="western" STYLE="border-top: none; border-bottom: 1.00pt solid #4f81bd; border-left: none; border-right: none; padding-top: 0in; padding-bottom: 0.06in; padding-left: 0in; padding-right: 0in">
+<FONT COLOR="#17365d"><FONT FACE="Cambria"><FONT SIZE=6 STYLE="font-size: 26pt">TCF
+Context Identifier Explanation</FONT></FONT></FONT></P>
+<P CLASS="western"><FONT COLOR="#4f81bd"><FONT FACE="Cambria"><FONT SIZE=3><I>Felix
+Burton, Wind River, Version 2</I></FONT></FONT></FONT></P>
+<H1><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>Introduction</B></FONT></FONT></FONT></H1>
+<P CLASS="western">Most if not all TCF services functions need some
+way to identify what entity e.g. process, thread, task, semaphore,
+breakpoint, flash device, device on JTAG scan chain, etc they should
+operate on. To do this TCF uses a context identifier (aka ContextId).
+This document is attempting to explain how ContextIds are intended to
+be used. This is document does not define actual services or exact
+context hierarchies, but for the purpose of making things more
+concrete examples may be used.</P>
+<H2 LANG="en-GB" STYLE="margin-top: 0in; margin-bottom: 0.04in"><FONT COLOR="#4f81bd"><FONT FACE="Cambria"><FONT SIZE=3 STYLE="font-size: 13pt"><B>Why
+a single ContextId?</B></FONT></FONT></FONT></H2>
+<P CLASS="western">A prudent question to ask is why use a single
+ContextId instead of having separate IDs for each notion e.g. a
+ProcessId, ThreadId, BreakpointId, JTAGDeviceId, etc. Having separate
+IDs is used in many existing debug APIs and protocols and may seem
+intuitive. However, there are several issues with this approach:</P>
+<P CLASS="western">1. It is inflexible in that it requires each
+function to upfront know how many levels are needed and what type of
+context each level represent.</P>
+<P CLASS="western">2. This in turn makes it difficult to use the same
+API for different environments since they often have different types
+of IDs and has different number of levels. For example Linux have
+processes and threads while OCD have cores.</P>
+<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>Context
+identifier</B></FONT></FONT></FONT></H1>
+<P CLASS="western">ContextIds are opaque handles that only have
+meaning to the service that created them or its peer services. They
+are created for clients, by service implementations to identify some
+entity handled by the services. Clients can use contextIds in the
+following ways:</P>
+<P CLASS="western">1. Pass to the originating service or peer
+services</P>
+<P CLASS="western">2. Compare for equality with other contextIds
+retrieved from the originating service or peer services.</P>
+<P CLASS="western">More specifically, clients should not try to
+decode or extract information from the contextId, instead they should
+make requests to the originating service or peer services using the
+contextId for information or action.</P>
+<P CLASS="western">As can be seen from the above, contextIds created
+by one service can be used by its peer services. The service should
+either to do something useful or to give an error indicating that the
+contextId is not relevant to that particular service. To guarantee
+that a contextId created by service A and passed to service B is not
+misinterpreted to be something other that what service A intended,
+there must be a global naming scheme for contextId within a target.</P>
+<P CLASS="western">This allows two or more services to create the
+same contextId when they operate on the same entity. It means that a
+single contextId can have multiple aspects that are handled by
+different services, thereby allowing decoupling of service
+interfaces.</P>
+<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>Context
+hierarchies</B></FONT></FONT></FONT></H1>
+<P CLASS="western">Entities represented by contextIds typically
+relate to similar entities in a list or parent/child relationship.
+Examples, 1) Linux processes have children threads, 2) a suspended
+thread has a list of stack frames, and 3) threads have register
+groups which have registers which can have fields. These
+relationships form context hierarchies.</P>
+<P CLASS="western">Depending on the system there may be several
+different context hierarchies. For example contexts available for
+JTAG debugging include:</P>
+<P CLASS="western">1. debugging</P>
+<P CLASS="western">2. memory access</P>
+<P CLASS="western">3. register access</P>
+<P CLASS="western">4. JTAG access</P>
+<P CLASS="western">Interestingly there may also be relations between
+the different hierarchies. For example contexts available for
+debugging may correspond with contexts available for memory access. A
+typical example of this is Linux where a contextId representing a
+process can be used for debugging as well as memory access, open file
+table access, memory map access, etc. In such cases, the same
+contextId should be used in all hierarchies. This allows clients to
+detect when hierarchies come together or split apart so the client
+can represent the relationships properly to the user for example in a
+GUI.</P>
+<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>Accessing
+context information</B></FONT></FONT></FONT></H1>
+<P CLASS="western">Information associated with a contextId can be
+sufficiently large to make it impractical to transfer all associated
+information to the client in a single request. To reduce the amount
+of information transferred while still allowing the implementation to
+be relatively simple; the information is categorized as follows:</P>
+<P CLASS="western">1. Child context references per service</P>
+<P CLASS="western">2. Slow changing properties per service, a.k.a.
+properties</P>
+<P CLASS="western">3. Fast changing properties per service, a.k.a.
+state or status
+</P>
+<P CLASS="western">Category 1 provides a simple way to express
+unbounded lists of related contextIds. If such a list becomes too
+large the service can split the list into a list of lists, list of
+lists or lists, etc as needed.</P>
+<P CLASS="western">Category 2 and 3 provides a simple way to express
+arbitrary information about the context in the form of a key/value
+pair. Properties may also contain contextId references for example
+for the parent context.</P>
+<P CLASS="western">The split between category 2 and 3 allows the
+service to handle fast changing information in a more optimal way and
+allows it to handle slow changing information in a more simple way.
+It is up to the service to define what information is slow vs. fast
+changing.</P>
+<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>ContextId
+formatting</B></FONT></FONT></FONT></H1>
+<P CLASS="western">The ContextId is represented as string between
+clients and services. The formatting of the string with one exception
+is completely up to the implementation that created the contextId.
+The exception is the ContextId prefix explained below. The remainder
+of the string can be formatted in any way that the service descries.
+Two typical ways comes to mind:</P>
+<P CLASS="western">1. Hierarchical list where each level is spelled
+out. For example on Linux:</P>
+<P CLASS="western" STYLE="margin-left: 0.79in">a. A process could be
+identified by &ldquo;ppid&rdquo; and a thread by &ldquo;ppid,ttid&rdquo;</P>
+<P CLASS="western" STYLE="margin-left: 0.79in">b. A register set by
+&ldquo;ppid,ttid,rset&rdquo;</P>
+<P CLASS="western" STYLE="margin-left: 0.79in">c. A stack frame by
+&ldquo;ppid,ttid,slevel&rdquo;</P>
+<P CLASS="western" STYLE="margin-left: 0.79in">d. A local variable on
+a specific stack level by &ldquo;ppid,ttid,slevel,vname&rdquo;</P>
+<P CLASS="western">2. Flat ID that the generating service used to do
+table lookup for more information. For example</P>
+<P CLASS="western" STYLE="margin-left: 0.79in">a. Index into an array
+&ldquo;tableIndex,generationNumber&rdquo;</P>
+<P CLASS="western" STYLE="margin-left: 0.79in">b. Key used for hash
+lookup &ldquo;sequentialNumber&rdquo;</P>
+<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>ContextId
+prefix</B></FONT></FONT></FONT></H1>
+<P CLASS="western">When information from more than one channel is
+joined together to when value-adding services between the two
+endpoints create contextIds it must be possible to for every service
+to determine if a contextId was created by it or a foreign entity. To
+do this, each service manager is assigned a unique contextId prefix
+that all its generated contextIds should be prefixed with followed by
+the colon (:) character. For example imagine that GDB was designed to
+be a value-adding service, contextIds created on this level could be
+prefixed by &ldquo;gdb:&rdquo; to guarantee that the target would be
+able to return error if such contextId was given to it instead of to
+the services in GDB.</P>
+<P CLASS="western">The prefix used by a service manager is
+dynamically assigned by the client initiating the connection. A
+limited TCF endpoint implementation is not required to support
+contextId prefixing. However, in such case it is only be possible to
+have value-adding services if they intercept all services on the
+endpoint.</P>
+<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>Context
+information caching</B></FONT></FONT></FONT></H1>
+<P CLASS="western">Clients will most likely need to cache context
+information in order to keep the amount of information transferred to
+a minimum. Such caching should be based on the contextId, service
+name, and type of data i.e. children contextIds, properties or state.</P>
+<P CLASS="western">The suggested implementation is to use a two stage
+cache lookup, where the first stage is using only the contextId and
+the second stage using the service name and the type of data. The
+reason for the two stage approach is to allow easy flushing of the
+cached information when contextIds are removed.</P>
+<P CLASS="western">Services support caching in clients by sending
+events for any changes to the information. The following events are
+expected to be generated by services when needed:</P>
+<P CLASS="western">1. Children added. The event includes the parent
+contextId, service name and list of contextIds and their properties
+to be added to the cache. Clients that have not populated the cache
+for the specified parent contextId should ignore this event.</P>
+<P CLASS="western">2. Children removed. The event includes the parent
+contextId, service name and list of contextIds to be removed from the
+list. When received, clients should update cache by removing all
+listed contextIds for the specified parent contextId and service
+name.</P>
+<P CLASS="western">3. Children changed. The event includes the parent
+contextId and service name. This event does not include the updated
+list of contextIds; instead clients are expected to reread the list
+of children if they need it. When received, clients should invalidate
+the list of children contextIds for the specified parent contextId
+and service name.</P>
+<P CLASS="western">4. Properties changed. This event includes a list
+of contextId, service name and properties. When received, clients
+should update cache with the new properties.</P>
+<P CLASS="western">5. State or status changed. This event includes
+contextId, service name and state or status. When received, clients
+should update cache with the new state or status.</P>
+<P CLASS="western">Invalidating or removing entries from the list of
+children contextIds should also result in recursively invalidating
+all cache entries for the removed contextIds. This is necessary to
+avoid stale cache entries to linger when a removed contextId is
+reused for a new context.</P>
+<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>Relationship
+between services</B></FONT></FONT></FONT></H1>
+<P CLASS="western">Even though service interfaces should not have any
+direct dependencies, they can have context hierarchy relationships.</P>
+<P CLASS="western">A good example of such relationship is between the
+&ldquo;run control&rdquo; service and the &ldquo;memory&rdquo;
+service. It seems to make sense to specify that the run control
+hierarchy is &ldquo;rooted&rdquo; in the memory hierarchy since it is
+hard to imagine executing instructions without a memory that stores
+the instructions.</P>
+<P CLASS="western">Another example is for run control, register and
+stack trace services where it seems logical to define registers and
+stack frame hierarchies to be &ldquo;rooted&rdquo; in the run control
+hierarchy.</P>
+<P CLASS="western">By &ldquo;rooted&rdquo; we mean that roots for one
+hierarchy can be found in another hierarchy.</P>
+<P CLASS="western">Usually clients need only one particular hierarchy
+at the time, however some clients, for example in Eclipse the Debug
+View is designed to be provide selection for run control, memory
+view, locals view, registers view, etc in one place, so it needs to
+merge memory, run control and stack trace hierarchies in order to
+provide single tree for selection.</P>
+<P CLASS="western">The services interface specification should define
+the rooting of its context hierarchy, if any. As mentioned in the
+example above, run control service is rooted in the memory hierarchy,
+and register and stack trace services are rooted in the run control
+hierarchy.</P>
+<P CLASS="western">It may be possible to a service context hierarchy
+to be rooted in multiple hierarchies.</P>
+<P CLASS="western">Which context hierarchies are merged is up to the
+implementer of the client.</P>
+<H1 LANG="en-GB"><FONT COLOR="#365f91"><FONT FACE="Cambria"><FONT SIZE=4><B>Context
+hierarchy roots</B></FONT></FONT></FONT></H1>
+<P CLASS="western">For some services it is possible to use &ldquo;null&rdquo;
+as a special parent contextId to the &ldquo;get children&rdquo;
+command to retrieve a list of root contextIds. The service interface
+definition should specify if retrieval of roots is supported by the
+service.</P>
+<P CLASS="western">Example services that would support the &ldquo;null&rdquo;
+parent contextId are JTAG access and kernel awareness services since
+this is global information in the target.</P>
+<P CLASS="western">Example services that would not support the &ldquo;null&rdquo;
+parent contextId are register and stack trace services since parent
+contextId for registers and stack frames is usual obtained through
+run control service.</P>
+<P CLASS="western"><BR><BR>
+</P>
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/docs/TCF Getting Started.html b/docs/TCF Getting Started.html
new file mode 100755
index 000000000..05d2ed32a
--- /dev/null
+++ b/docs/TCF Getting Started.html
@@ -0,0 +1,226 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <title>Target Communication Framework: Getting Started</title>
+</head>
+
+<body lang='EN-US'>
+
+<h1>Target Communication Framework: Getting Started</h1>
+
+<p>Copyright (c) 2007 Wind River Systems, Inc. Made available under the EPL v1.0
+<p>Direct comments, questions to the <a href="mailto:dsdp-tm-dev@eclipse.org">dsdp-tm-dev@eclipse.org</a> mailing list
+
+<h2>Table of Contents</h2>
+<ul>
+ <li><a href='#Workspace'>Creating Eclipse Workspace</a>
+ <li><a href='#Plugins'>TCF Plugins</a>
+ <li><a href='#Agent'>Building TCF Agent</a>
+ <li><a href='#Browsing'>Browsing Agent Source Code in CDT</a>
+ <li><a href='#RSE'>Using TCF With Remote System Explorer</a>
+ <li><a href='#Debugger'>Using TCF With Eclipse Debugger</a>
+</ul>
+
+<h2><a name='Workspace'>Creating Eclipse Workspace</a></h2>
+
+<p>Eclipse can be used for developing clients for TCF in Java.
+TCF host side code is organized into several Eclipse plug-in projects,
+below are steps to create and populate Eclipse workspace with TCF projects:</p>
+
+<ul>
+ <li>Install JDK 1.5.0 or later
+ <li>Install <b>Eclipse Classic SDK 3.3</b> or later, last tested with 3.4M3, recommended 3.3.1.1<br>
+ <a href='http://download.eclipse.org/eclipse/downloads/'>http://download.eclipse.org/eclipse/downloads/</a>
+ <li>Install <b>TM RSE SDK 2.0</b> or later, last tested with 3.0M3, recommended 2.0.2<br>
+ <a href='http://download.eclipse.org/dsdp/tm/downloads/'>http://download.eclipse.org/dsdp/tm/downloads/</a>
+ <li><b>Optional</b> dependencies for TCF/DSF/CDT integration: these are not required by
+ TCF itself, and not needed for RSE integration or for TCF based debugger demo,
+ use these for future development:
+ <ul>
+ <li>CDT 4.0 or later, last tested with 5.0M3, recommended 4.0.1<br>
+ <a href='http://download.eclipse.org/tools/cdt/releases/europa/'>http://download.eclipse.org/tools/cdt/releases/europa/</a>
+ <li>DD DSF SDK N20071113-0200 (Must use this version, later versions will NOT work)<br>
+ <a href='http://download.eclipse.org/dsdp/dd/downloads/'>http://download.eclipse.org/dsdp/dd/downloads/</a>
+ </ul></li>
+ <li>Unzip TCF code.
+ <li>Run Eclipse:
+ <pre>eclipse.exe -vm &lt;JDK path&gt;\bin\javaw.exe -data &lt;Workspace path&gt; -vmargs -Xmx200M</pre>
+ <li>Open "Java" perspective.
+ <li>In "Package Explorer" view: do right click and then select "Import...".
+ <li>Select "General/Existing Projects into Workspace" and click "Next".
+ <li>Select root directory: &lt;TCF Root&gt;\plugins, and click "Next".<ul>
+ <li>If DD-DSF and/or CDT are not installed, don't import the following two plugins
+ into your workspace:<ul>
+ <li>com.windriver.tcf.dsf.core
+ <li>com.windriver.tcf.dsf.ui
+ </ul></li>
+ </ul></li>
+ <!--
+ <li><b>Optional</b> for browsing dependencies:<ul>
+ <li>In Package Explorer: do right click and select "Import...".
+ <li>Select "Plug-in Development/Plug-ins and Fragments" and click "Next".
+ <li>Select "Import plug-ins and fragments required by existig workspace plug-ins" and click "Next".
+ <li>Click "Select All", then click "Finish".
+ </ul></li>
+ -->
+</ul>
+
+<!--
+<p>Alternative way to get CDT, DSF and RSE installed:
+<ul>
+ <li>Get Eclipse for C/C++ Package from <a href='http://www.eclipse.org/downloads/'>
+ http://www.eclipse.org/downloads/</a> - it includes CDT.
+ <li>Do "Help > Software Updates > Find and Install > Search for New Features to Install > Next"
+ <li>Select "Europa Discovery Site", press "Finish"
+ <li>Select following:
+ <ul>
+ <li>Remote Access and Device Development
+ <ul>
+ <li>Remote System Explorer End-User Runtime
+ <li>Debugger Services Framework end-user and extender SDK
+ </ul>
+ </ul>
+ <li>Press "Select Required" if in Error
+ <li>Press "Next", "Accept", "Next", "Finish"
+</ul>
+-->
+
+<h2><a name='Plugins'>TCF Plugins</a></h2>
+
+<p>TCF plugins source code is stored in <code>&lt;TCF Root&gt;\plugins</code> directory.
+
+<dl>
+ <dt><b>com.windriver.tcf.api</b>
+ <dd>This is the main TCF plugin. It contains the framework itself and interfaces for standard services.
+ It is the only TCF plugin, which should be required by a TCF client. The rest of TCF plugins are
+ clients developed as a reference implementation or for demonstration purposes.
+ <p>
+ <dt><b>com.windriver.debug.tcf.core,com.windriver.debug.tcf.ui</b>
+ <dd>This is a prototype code that connects Eclipse Debug Framework and Target Communication Framework.
+ It allows to launch Eclipse debug session by connecting to a target running TCF agent,
+ and then perform basic debugging tasks, like resuming, suspending, single-stepping, setting/removing breakpoints, etc.
+ The code can be used as a reference for developing new TCF clients.
+ <p>
+ <dt><b>com.windriver.tcf.dsf.core,com.windriver.tcf.dsf.ui</b>
+ <dd>This code allows Debugger Services Framework (DSF) clients to access targets using TCF as comminucation protocol.
+ It includes implementation of DSF services as TCF clients.
+ <p>
+ <dt><b>com.windriver.tcf.rse.ui</b>
+ <dd>This plugin allows Remote System Explorer (RSE) to connect to remote machines using TCF as communication protocol.
+ It includes implementation of RSE services as TCF clients.
+</dl>
+
+<h2><a name='Agent'>Building TCF Agent</a></h2>
+
+<p><b>Linux</b> is the recommended evaluation platform, since most TCF services
+are implemented. To build the agent:
+<ul>
+ <li>Make sure <code>elfutils-libelf-devel</code> is installed.
+ On Fedora, it can be installed by command:
+ <pre>yum install elfutils-libelf-devel</pre>
+ It also can be built and installed from source code, e.g.
+ <a href="http://www.mr511.de/software/libelf-0.8.9.tar.gz">http://www.mr511.de/software/libelf-0.8.9.tar.gz</a>:
+ <pre>
+ ./configure
+ make
+ make install
+ setenv LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH</pre>
+ <li>Run <code>make</code> command in <code>&lt;TCF Root&gt;/agent</code> directory.
+ <li>Start agent with <code>./agent</code> command.
+</ul>
+
+<p>On <b>Windows</b>, only the TCF file service is currently implemented in the agent,
+so the RSE Processes and Eclipse Debug demos will not work.
+For building the agent, there are two possibilities:<ul>
+<li>Building with gcc (freely available from <a href="http://wascana.sourceforge.net/">Wascana</a>,
+<a href="http://www.cygwin.com">Cygwin</a> or the
+<a href="http://www.mingw.org/">MinGW32 project</a>): run
+<pre>make -fMakefile_cygwin.mak</pre>
+in the agent directory (the Makefile works with mingw, too).</li>
+
+<li>Building with Microsoft Visual C++: Open workspace file <code>&lt;TCF Root&gt;/agent/agent.dsw</code>
+and then build and run the agent using Development Studio commands. If getting an error about
+<tt>IPHlpApi.h</tt> missing, you'll need to install the latest
+<a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=0BAF2B35-C656-4969-ACE8-E4C0C0716ADB&displaylang=en">MS Platform SDK</a>.
+For the free <a href="http://www.microsoft.com/express/vc/">Visual C++ Express Edition</a>, the
+following changes in settings may be necessary:<ul>
+ <li>Project &gt; Properties &gt; C/C++ &gt; Preprocessor &gt; Preprocessor Definitions:
+ add <tt>_CRT_SECURE_NO_DEPRECATE</tt></li>
+ <li>Project &gt; Properties &gt; Linker &gt; Input &gt; Additional Dependencies :
+ add <tt>shell32.lib</tt></li>
+</ul></li>
+</ul></p>
+
+<p>On <b>VxWorks</b>, the file service as well as most debug services are currently
+working. Line number mapping and the SysMonitor service (required for RSE Processes
+Demo) are not yet implemented.<br/>
+To build the agent: Use Wind River Workbench to create a Kernel Module project out of source code in
+<code>&lt;TCF Root&gt;/agent</code> directory. Use Workbench commands to build and run the agent.</p>
+
+<h2><a name='Browsing'>Browsing Agent Source Code in CDT</a></h2>
+On Linux, the default configuration from the CDT .project file included in TCF
+should be fine for correctly browsing the agent source code. Linux is recommended
+for working on the agent anyways, because most features are implemented already.
+<p>
+On Windows, open Project Properties of the agent project, and under C/C++ General &gt;
+Indexer switch the configuration to "Win32 - Cygwin" or "Win32 - DevStudio"
+as needed.
+<p>
+For VxWorks, browsing should be configured automatically through the WR Workbench
+Kernel Module Project.
+
+<h2><a name='RSE'>Using TCF With Remote System Explorer</a></h2>
+
+<p>Remote System Explorer is an Eclipse based component that allows users to create connections to remote machines and
+explore their file systems, see list of processes and access some other resources, like remote shells.
+Remote System Explorer has been designed as a flexible, extensible framework to which Eclipse plug-in developers can
+contribute their own system definitions, actions, etc.</p>
+
+<p>Plugin <b>com.windriver.tcf.rse.ui</b> enables use of Processes and Files subsystems of Remote System Explorer over TCF.
+It also extends Processes subsystem to include CPU utilization data and some other process attributes in RSE views.</p>
+
+<p>To connect a remote machine over TCF:</p>
+<ul>
+ <li>Make sure TCF agent is running on remote machine.
+ <li>Run Eclipse with RSE and TCF plugins installed.
+ <li>In Eclipse, do "Window/Open Perspective/Remote System Explorer" command.
+ <li>In "Remote Systems" view: do right click and select "New/Connection..."
+ <li>In "New Connection" dialog box: select TCF and press "Next" button.
+ <li>Enter "Host name" - IP host name ot the target machine, and "Connection name" - arbitrary string to name new connection.
+ Press "Finish" button.
+ <li>New connection should appear in "Remote Systems" view and it is ready to be explored.
+</ul>
+
+<p>RSE features supported by TCF connection:
+<ul>
+ <li>File Subsystem: full support, i.e. browse, upload, download, copy, move, delete
+ <li>Processes: browse, including parent/child relationship
+</ul>
+
+<h2><a name='Debugger'>Using TCF With Eclipse Debugger</a></h2>
+
+<p>Plugins <b>com.windriver.debug.tcf.core</b> and <b>com.windriver.debug.tcf.ui</b> allow to start a debug session
+by connecting to a machine runnning TCF agent. This is not a complete debugger implementation, it is intended for
+demo and reference purposes.
+
+<p>To start a debug session over TCF:</p>
+<ul>
+ <li>Make sure TCF agent is running on remote machine.
+ <li>Run Eclipse with TCF plugins installed.
+ <li>In Eclipse, do "Window/Open Perspective/Debug" command.
+ <li>Do "Run/Open Debug Dialog..." command.
+ <li>In "Debug" dialog box: select "Target Comminucation Framework" configuration type and press "New" button.
+ <li>Enter a name for the configuration.
+ <li>Select a target machine in "Available targtes" list. The list shows targets autodetected on local network.
+ <li>Press "Run Diagnostics" button to test connectivity for selected target.
+ <li>Enter a program name to run in debug session, for example "/bin/ls".
+ <li>Press "Debug" to start the debugger.
+</ul>
+
+<p>In TCF debug session only "Debug", "Breakpoints" and "Registers" views are populated. Source level debugging
+in not supported at this time. Breakpoints can be planted at an absolute addresses only, using menu command "Run/Toggle Breakpoint".
+"Registers" view can be brought in by "Window > Show View > Registers". Registers can be shown only for top stack frame.
+</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/docs/TCF Linux Agent Prototype.html b/docs/TCF Linux Agent Prototype.html
new file mode 100644
index 000000000..50ec8e8fe
--- /dev/null
+++ b/docs/TCF Linux Agent Prototype.html
@@ -0,0 +1,199 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+<HEAD>
+ <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1251">
+ <TITLE>This is a brief description of the TCF Linux user-mode agent prototype implementation</TITLE>
+ <META NAME="GENERATOR" CONTENT="OpenOffice.org 2.2 (Win32)">
+ <META NAME="CREATED" CONTENT="20070830;12381303">
+ <META NAME="CHANGED" CONTENT="16010101;0">
+ <STYLE TYPE="text/css">
+ <!--
+ H1 { color: #000000 }
+ P { color: #000000 }
+ P.western { font-size: 13pt }
+ H2 { color: #000000 }
+ -->
+ </STYLE>
+</HEAD>
+<BODY LANG="en-US" TEXT="#000000" DIR="LTR">
+
+<P>This is a brief description of the TCF Linux
+user-mode agent prototype implementation. The agent is implemented as
+an event driven program. The main event queue is handled by a single
+thread &ndash; the event dispatch thread. Some sub-systems are using
+other threads locally, but will never call other sub-systems using
+these threads. Instead an event will be placed on the main event
+queue to handle the inter sub-system communication.</P>
+
+<H1>Main Program</H1>
+
+<P>Main program parses command line options and initialized sub-systems</P>
+<P>Files:</P>
+<P>main.c</P>
+
+<H1>Target Communication Framework</H1>
+
+<H2>Command and Event Registration and Dispatch</H2>
+
+<P>This module handles registration of command and
+event handlers. It is called when new messages are received and will
+dispatch messages to the appropriate handler. It has no knowledge of
+what transport protocol is used and what services do.</P>
+<P>Files:</P>
+<P>protocol.c</P>
+<P>protocol.h</P>
+
+<H2>Transport Layer</H2>
+
+<P>Implements input and output stream over TCP/IP
+transport and UDP based server side auto discovery.</P>
+<P>Files:</P>
+<P>channel.c</P>
+<P>channel.h</P>
+<P>tcf.h</P>
+
+<H2>Input and Output Stream Interface and Library</H2>
+
+<P>This module defines the input and output stream
+interface and support library functions.</P>
+<P>Files:</P>
+<P>streams.c</P>
+<P>streams.h</P>
+
+<H1>Services</H1>
+
+<H2>Breakpoint</H2>
+
+<P>The breakpoint services implements a global
+breakpoint list.</P>
+<P>Files:</P>
+<P>breakpoints.c</P>
+<P>breakpoints.h</P>
+
+<H2>Run Control</H2>
+
+<P>This module implements the run control service. It
+builds uses the context module to do low level control of contexts.
+It implements a &ldquo;safe queue&rdquo; which contains events that
+that should be processed then their context is suspended. Incoming
+TCF messages are suspended while the safe queue is non-empty and are
+resumed when the last safe queue entry is handled.</P>
+<P>Files:</P>
+<P>runctrl.c</P>
+<P>runctrl.h</P>
+
+<H2>System Monitoring</H2>
+
+<P>This module provides system level monitoring
+information, similar to the UNIX top or Windows task manager.</P>
+<P>Files:</P>
+<P>sysmon.c</P>
+<P>sysmon.h</P>
+
+<H2>Agent Diagnostics</H2>
+
+<P>This service is used to do end-to-end self test
+from the host to the target.</P>
+<P>Files:</P>
+<P>diagnostics.c</P>
+<P>diagnostics.h</P>
+
+<H1>OS Context Handling</H1>
+
+<P>This module handles process/thread OS contexts and
+their state machine. All ptrace() handling is isolated to here.</P>
+<P>Files:</P>
+<P>context.c</P>
+<P>context.h</P>
+
+<H1>Agent Event Queue</H1>
+
+<P>This module implements the main event queue
+dispatch and queuing. All events are processed by a single thread.
+Any thread can queue new events.</P>
+<P>Files:</P>
+<P>events.c</P>
+<P>events.h</P>
+
+<H1>Misc</H1>
+
+<H2>Command line interpreter</H2>
+
+<P>The module allows a user to interact with agent. Current implementation of command line interpreter is incomplete.</P>
+<P>Files:</P>
+<P>cmdline.c</P>
+<P>cmdline.h</P>
+
+<H2>Error message display</H2>
+
+<P>This module defines agent error codes in addition to system codes defined in errno.h</P>
+<P>Files:</P>
+<P>errors.c</P>
+<P>errors.h</P>
+
+<H2>Exception Handling</H2>
+
+<P>Exception handling. Functionality is similar to C++ try/catch.</P>
+<P>Files:</P>
+<P>exceptions.c</P>
+<P>exceptions.h</P>
+
+<H2>JSON Library</H2>
+
+<P>The module contains utility functions for parsing and generating of JSON text.
+TCF standard services use JSON as messages format. See <a href='TCF Specification.html#JSON'>JSON - Preferred Marshaling</a>
+for JSON description.</P>
+<P>Files:</P>
+<P>json.c</P>
+<P>json.h</P>
+
+<H2>Double Linked List</H2>
+
+<P>Utilitity module to support double linked lists.</P>
+<P>Files:</P>
+<P>link.h</P>
+
+<H2>Host OS Abstraction</H2>
+
+<P>Machine and OS dependend definitions.
+This module implements host OS abstraction layer that helps make
+agent code portable between Linux, Windows, VxWorks and potentially other OSes.</P>
+<P>Files:</P>
+<P>mdep.c</P>
+<P>mdep.h</P>
+
+<H2>Malloc Abstraction</H2>
+
+<P>Provides local versions of malloc(), realloc() and free().</P>
+<P>Files:</P>
+<P>myalloc.c</P>
+<P>myalloc.h</P>
+
+<H2>Proxy</H2>
+
+<P>Proxy service should allow tunneling of TCF messages to another target on behalf of a client.
+This service intended to be used when a client has no direct access to a target.</P>
+<P>Files:</P>
+<P>proxy.c</P>
+<P>proxy.h</P>
+
+<H2>Test Application</H2>
+
+<P>Test application is used by Diagnostics service to run various tests.</P>
+<P>Files:</P>
+<P>test.c</P>
+<P>test.h</P>
+
+<H2>Debug Logging</H2>
+
+<P>The module implements logging and tracing that is mostly intended for debugging of the agent.</P>
+<P>Files:</P>
+<P>trace.c</P>
+<P>trace.h</P>
+
+<H1>Architecture</H1>
+
+<P><IMG SRC="TCF%20Architecture.png" NAME="graphics1" ALIGN=BOTTOM WIDTH=647 HEIGHT=359 BORDER=0></P>
+
+</BODY>
+</HTML>
diff --git a/docs/TCF Project.html b/docs/TCF Project.html
new file mode 100644
index 000000000..0071e96fc
--- /dev/null
+++ b/docs/TCF Project.html
@@ -0,0 +1,141 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
+<HTML lang=en-us>
+<HEAD>
+<TITLE>Target Communication Framework</TITLE>
+</HEAD>
+
+<BODY>
+
+<H1>Target Communication Framework project</H1>
+
+<P>
+<H2><A name=Index></A>Index</H2>
+
+<UL>
+ <LI><A href="#Summary">Summary</A>
+ <LI><A href="#Goals">Goals</A>
+ <LI><A href="#Features">Features</A>
+ <LI><A href="#Agent">Reference implementation of a target agent</A>
+ <LI><A href="#Debugger">Prototype of a debugger based on Eclipse Debug Framework and TCF</A>
+ <LI><A href="#RSE">Prototype of a system monitor and remote file access based on Remote System Explorer and TCF</A>
+</UL>
+
+<P>
+<H2><A name=Summary></A>Summary </H2>
+
+<P>Today almost every device software development tool on the market has its own
+method of communication with target system. Communication methods often conflict
+with each other, require individual setup, configuration and maintenance, impose
+all kinds of unnecessary limitations. Target Communication Framework is designed
+to establish common ground in the area of communication protocols between
+development tools and embedded devices.
+
+<P>
+<H2><A name=Goals></A>Goals </H2>
+<P>
+<UL>
+ <LI>Universal, extensible, simple, lightweight, vendor agnostic framework for
+ tools and targets to communicate for purpose of debugging, profiling, code
+ patching and other device software development needs.
+ <LI>Single configuration per target (not per tool per target as today in most
+ cases), or no configuration when possible.
+ <LI>Small overhead and footprint on target side. </LI></UL>
+<P>
+
+<H2><A name=Features></A>Features </H2>
+<P><A href="TCF Specification.html">Target Communication Framework Specification</A> is a document
+describing design goals, requirements and format of TCF communication protocol,
+as well as framework API and software design considerations.
+<P>TCF communication model is based on the idea of services. A service is a group
+of related commands, events and semantics. A service can be discovered,
+added or removed as a group at communication endpoint. Service definitions are
+not part of the framework specification, and new services are expected to be
+defined by developers of tools and target agents. However, standardization of
+common services is needed to achieve certain level of compatibility of
+tools/targets, see <A href="TCF Services.html">TCF Services Specification</A>
+as starting point of this work.
+
+<H2><A name=Agent></A>Reference implementation of a target agent</H2>
+
+<P>Current reference implementation of TCF target agents is fully functional,
+can run on Windows, Linux and VxWorks, and provides the following services:
+<UL>
+ <LI>Run Control - provides threads and processes run control functionality
+ sufficient for debugging of user space programs. On Linux it is implemented
+ using PTRACE, on VxWorks is uses vxdbgLib, on Windows it is not currently supported.
+
+ <LI>Breakpoints - provides basic breakpoints support. On Linux it is
+ implemented using PTRACE, on VxWorks is uses vxdbgLib,
+ on Windows it is not currently supported.
+
+ <LI>Registers - allows inspection and modification of CPU registers.
+ Implemented for Linux and VxWorks, on Windows it is not currently supported.
+
+ <LI>Stack Trace - execution thread stack back-tracing.
+ Implemented for Linux and VxWorks, on Windows it is not currently supported.
+
+ <LI>Memory - program memory access.
+ Implemented for Linux and VxWorks, on Windows it is not currently supported.
+
+ <LI>Processes - provides access to the target OS's process
+ information, allows starting new and terminating existing processes,
+ and allows attaching and detaching processes for debugging.
+ Implemented for Linux and VxWorks, on Windows it is not currently supported.
+
+ <LI>Line Numbers - provides mapping between locations in the source files
+ and corresponding machine instruction addresses in the executable object.
+ Implemented for Linux only.
+
+ <LI>Sys Monitor - provides list of processes, process attributes and
+ CPU/memory utilization data. On Linux it is implemented using /proc file
+ system, on Windows and VxWorks it is not currently supported.
+
+ <LI>File System - provides access to remote file system.
+
+ <LI>Diagnostics - allows testing of communication channel and agent
+ functionality.
+</UL>
+
+<P>The agent code is designed to be easily extensible by adding new command
+handler implementations. The code separates machine dependences, common TCF
+logic and service implementations, which allows easy porting to a new OS or a
+target and reconfiguring of the agent for specific needs. The code is written in
+ANSI C. See <A href="TCF Linux Agent Prototype.html">TCF Linux Agent Prototype</A>
+for more details about the agent code.
+
+<H2><A name=Debugger></A>Prototype of a debugger based on Eclipse Debug Framework and TCF</H2>
+
+<P>The prototype code connects Eclipse Debug Framework and Target Communication
+Framework. It allows to launch Eclipse debug session by connecting to a target
+running TCF agent, and then perform basic debugging tasks, like resuming,
+suspending, single-stepping, setting/removing breakpoints, etc. Since current
+reference implementation of target agent does not support line number
+information access, source level debugging is not supported.
+<P>The prototype launch configuration autodetects TCF targets on a local network
+and allows a user to connect to a target by simply selecting it from a list
+without a need for any further configuration or setup. TCF launch configuration
+dialog also offers controls to run a built-in diagnostics on a selecting target,
+which perform stress testing of communication channel, agent and target itself:
+<P><IMG alt="TCF launch configuration dialog" src="TCF_Launch_Dialog.jpg">
+
+<P>The prototype makes use of flexible debug model element hierarchy support,
+which is available in Eclipse debug framework since Eclipse 3.2. The flexible
+hierarchy allows debugger views to be "data driven" or, in other words, dynamically
+adapt to a given targets capabilities and structure, without a need to modify
+debugger code to support a new target.
+
+<H2><A name=RSE></A>Prototype of a system monitor and remote file access based on Remote System Explorer and TCF</H2>
+
+<P>Remote System Explorer is an Eclipse based component that allows users to
+create connections to remote machines and explore their file systems, see list
+of processes and access some other resources, like remote shells. Remote System
+Explorer has been designed as a flexible, extensible framework to which Eclipse
+plug-in developers can contribute their own system definitions, actions, etc.
+<P>The prototype enables use of Processes and Files subsystems of Remote System
+Explorer over TCF. It also extends Processes subsystem to include CPU
+utilization data and some other process attributes in RSE views:
+<P><IMG alt="Remote System Explorer: Files subsystem over TCF" src="TCF_RSE_Files.jpg">
+<P><IMG alt="Remote System Explorer: Processes subsystem over TCF" src="TCF_RSE_Processes.jpg">
+
+</BODY>
+</HTML> \ No newline at end of file
diff --git a/docs/TCF Service - Breakpoints.html b/docs/TCF Service - Breakpoints.html
new file mode 100644
index 000000000..a49cdf3ab
--- /dev/null
+++ b/docs/TCF Service - Breakpoints.html
@@ -0,0 +1,408 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <title>Target Communication Framework Services - Breakpoints</title>
+</head>
+
+<body lang='EN-US'>
+
+<h1>Target Communication Framework Services - Breakpoints</h1>
+
+<ul>
+ <li><a href='#Cmds'>Commands</a>
+ <ul>
+ <li><a href='#CmdSet'>Set</a>
+ <li><a href='#CmdAdd'>Add</a>
+ <li><a href='#CmdChange'>Change</a>
+ <li><a href='#CmdEnable'>Enable</a>
+ <li><a href='#CmdDisable'>Disable</a>
+ <li><a href='#CmdRemove'>Remove</a>
+ <li><a href='#CmdGetIDs'>Get IDs</a>
+ <li><a href='#CmdGetProperties'>Get Properties</a>
+ <li><a href='#CmdGetStatus'>Get Status</a>
+ </ul>
+ <li><a href='#Events'>Events</a>
+ <li><a href='#API'>API</a>
+</ul>
+
+<h1>Breakpoints Service</h1>
+
+<p>Breakpoint is represented by unique identifier and set of properties.
+Breakpoint identifier (String id) needs to be unique across all hosts and targets</p>
+
+<p>Breakpoint properties is extendable collection of named attributes,
+which define breakpoint location and behavior. The service defines some common
+attribute names, host tools and target agents may support additional attributes.</p>
+
+<p>For each breakpoint a target agent maintains another extendable collection of named attributes:
+breakpoint status. While breakpoint properties are persistent and represent user input,
+breakpoint status reflects dynamic target agent reports about breakpoint current state,
+like actual addresses where breakpoint is planted or planting errors.</p>
+
+<p>Breakpoints are associated with communication channel and traget agent must remove them
+when the channel is closed. Target agent should maintain separate breakpoint table
+for each communication channel. It is allowed to set same breakpoint (same ID) through multiple
+channels, target agent should treat it as single breakpoint with maltiple references. Such breakpoint
+is removed when all refering channels are closed.</p>
+
+<p>The service uses standard format for error reports,
+see <a href='TCF Services.html#ErrorFormat'>Error Report Format</a>.</p>
+
+<h2><a name='Cmds'>Commands</a></h2>
+
+<h3><a name='CmdSet'>Set</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Breakpoints • set • <i>&lt;array of breakpoints&gt;</i> •
+
+<i>&lt;array of breakpoints&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ ]
+ <font face=Wingdings>Ψ</font> [ <i>&lt;breakpoints list&gt;</i> ]
+
+<i>&lt;breakpoints list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;breakpoint data&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;breakpoint data&gt;</i> , <i>&lt;breakpoint data&gt;</i>
+
+<i>&lt;breakpoint data&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;object&gt;</i>
+</font></b></pre>
+
+<p> The command downloads breakpoints data to a target agent.
+The command is intended to be used only to initialize target breakpoints table
+when communication channel is open. After that, host should
+notify target about (incremental) changes in breakpoint data by sending
+Add, Change and Remove commands.<p>
+
+<p>Breakpoint data consists of a list of breakpoint properties. All properties are optional, except ID.
+Tools and targets can define additional properties. Predefined properties are:</p>
+<ul>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ID" : <i>&lt;string&gt;</i></font></b></code>
+ - breakpoint ID
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Enabled" : <i>&lt;boolean&gt;</i></font></b></code>
+ - if true breakpoint is enabled
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Address" : <i>&lt;string&gt;</i></font></b></code>
+ - if preset, defines address of the breakpoint. Address is an expression that evaluates to breakpoint memory address.
+ Alternatively, breakpoint location can be given as File/Line/Column.
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Condition" : <i>&lt;string&gt;</i></font></b></code>
+ - a conditional expression that is evaluted every time execution hits the breakpoint. If condition is evaluated to false,
+ the breakpoint is skipped and execution is resumed without sending notifications to a host.
+ <li><code><b><font face="Courier New" size=2 color=#333399>"File" : <i>&lt;string&gt;</i></font></b></code>
+ - source code file name of breakpoint location.
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Line" : <i>&lt;int&gt;</i></font></b></code>
+ - source code line number of breakpoint location.
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Column" : <i>&lt;int&gt;</i></font></b></code>
+ - source code column number of breakpoint location.
+</ul>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdAdd'>Add</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Breakpoints • add • <i>&lt;breakpoint data&gt;</i> •
+</font></b></pre>
+
+<p>The command adds breakpoint to target agent breakpoint table. Host should send this command when user creates new breakpoint</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdChange'>Change</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Breakpoints • change • <i>&lt;breakpoint data&gt;</i> •
+</font></b></pre>
+
+<p>The command updates breakpoint data in target agent breakpoint table. Host should send this command when user modifies a breakpoint</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdEnable'>Enable</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Breakpoints • enable • <i>&lt;array of breakpoint IDs&gt;</i> •
+
+<i>&lt;array of breakpoint IDs&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ ]
+ <font face=Wingdings>Ψ</font> [ <i>&lt;breakpoint IDs list&gt;</i> ]
+
+<i>&lt;breakpoint IDs list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;breakpoint ID&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;breakpoint ID&gt;</i> , <i>&lt;breakpoint ID&gt;</i>
+
+<i>&lt;breakpoint ID&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;string&gt;</i>
+</font></b></pre>
+
+<p>The command enables a list of breakpoints - sets brekpoint property "Enabled" to true.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdDisable'>Disable</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Breakpoints • disable • <i>&lt;array of breakpoint IDs&gt;</i> •
+</font></b></pre>
+
+<p>The command disables a list of breakpoints - sets brekpoint property "Enabled" to false.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdRemove'>Remove</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Breakpoints • remove • <i>&lt;array of breakpoint IDs&gt;</i> •
+</font></b></pre>
+
+<p>The command removes a list of breakpoints. Host should send this command when user deletes breakpoints.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdGetIDs'>Get IDs</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Breakpoints • getIDs •
+</font></b></pre>
+
+<p>The command uploads IDs of breakpoints known to target agent. Only breakpoints what are set through
+this communication channel are reported. Target agent should maintain separate breakpoint table
+for each communication channel.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;array of breakpoint IDs&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdGetProperties'>Get Properties</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Breakpoints • getProperties • <i>&lt;string: breakpoint ID&gt;</i> •
+</font></b></pre>
+
+<p>The command uploads properties of given breakpoint from target agent breakpoint table.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;;breakpoint data&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdGetStatus'>Get Status</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Breakpoints • getStatus • <i>&lt;string: breakpoint ID&gt;</i> •
+</font></b></pre>
+
+<p>The command uploads status of given breakpoint from target agent.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;;breakpoint status&gt;</i> •
+
+<i>&lt;breakpoint status&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;object&gt;</i>
+</font></b></pre>
+
+<p>Breakpoint stat consists of a list of status properties. All properties are optional.
+Tools and targets can define additional properties. Predefined properties are:</p>
+
+<ul>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Planted" : <i>&lt;array of addresses&gt;</i></font></b></code>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Error" : <i>&lt;string&gt;</i></font></b></code>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"File" : <i>&lt;string&gt;</i></font></b></code>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Line" : <i>&lt;int&gt;</i></font></b></code>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Column" : <i>&lt;int&gt;</i></font></b></code>
+</ul>
+
+<h2><a name='Events'>Events</a></h2>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+E • Breakpoints • status • <i>&lt;string: breakpoint ID&gt;</i> • <i>&lt;breakpoint status&gt;</i> •
+</font></b></pre>
+
+<dl>
+ <dt><b>status</b>
+ <dd>is sent when breakpoint status changes.
+</dl>
+
+<h2><a name='API'>API</a></h2>
+
+<pre>
+<font color=#3F5FBF>/**
+ * Breakpoint is represented by unique identifier and set of properties.
+ * Breakpoint identifier (String id) needs to be unique across all hosts and targets.
+ *
+ * Breakpoint properties (Map<String,Object>) is extendable collection of named attributes,
+ * which define breakpoint location and behavior. This module defines some common
+ * attribute names (see PROP_*), host tools and target agents may support additional attributes.
+ *
+ * For each breakpoint a target agent maintains another extendable collection of named attributes:
+ * breakpoint status (Map<String,Object>, see STATUS_*). While breakpoint properties are
+ * persistent and represent user input, breakpoint status reflects dynamic target agent reports
+ * about breakpoint current state, like actual addresses where breakpoint is planted or planting errors.
+ */</font>
+<font color=#7F0055>public interface</font> IBreakpoints <font color=#7F0055>extends</font> IService {
+
+ <font color=#3F5FBF>/**
+ * Service name.
+ */</font>
+ <font color=#7F0055>static final</font> String NAME = "Breakpoints";
+
+ <font color=#3F5FBF>/**
+ * Breakpoint property names.
+ */</font>
+ <font color=#7F0055>static final</font> String
+ PROP_ID = "ID", // String
+ PROP_ENABLED = "Enabled", // Boolean
+ PROP_ADDRESS = "Address", // String
+ PROP_CONDITION = "Condition", // String
+ PROP_FILE = "File", // String
+ PROP_LINE = "Line", // Number
+ PROP_COLUMN = "Column"; // Number
+
+ <font color=#3F5FBF>/**
+ * Breakpoint status field names.
+ */</font>
+ <font color=#7F0055>static final</font> String
+ STATUS_PLANTED = "Planted", // Array of addresses
+ STATUS_ERROR = "Error", // String
+ STATUS_FILE = "File", // String
+ STATUS_LINE = "Line", // Number
+ STATUS_COLUMN = "Column"; // Number
+
+ <font color=#3F5FBF>/**
+ * Call back interface for breakpoint service commands.
+ */</font>
+ <font color=#7F0055>interface</font> DoneCommand {
+ <font color=#7F0055>void</font> doneCommand(IToken token, Exception error);
+ }
+
+ <font color=#3F5FBF>/**
+ * Download breakpoints data to target agent.
+ * The command is intended to be used only to initialize target breakpoints table
+ * when communication channel is open. After that, host should
+ * notify target about (incremental) changes in breakpoint data by sending
+ * add, change and remove commands.
+ *
+ * @param properties - array of breakpoints.
+ * @param done - command result call back object.
+ */</font>
+ IToken set(Map&lt;String,Object&gt;[] properties, DoneCommand done);
+
+ <font color=#3F5FBF>/**
+ * Called when breakpoint is added into breakpoints table.
+ * @param properties - breakpoint properties.
+ * @param done - command result call back object.
+ */</font>
+ IToken add(Map&lt;String,Object&gt; properties, DoneCommand done);
+
+ <font color=#3F5FBF>/**
+ * Called when breakpoint properties are changed.
+ * @param properties - breakpoint properties.
+ * @param done - command result call back object.
+ */</font>
+ IToken change(Map&lt;String,Object&gt; properties, DoneCommand done);
+
+ <font color=#3F5FBF>/**
+ * Tell target to change (only) PROP_ENABLED breakpoint property 'true'.
+ * @param ids - array of enabled breakpoint identifiers.
+ * @param done - command result call back object.
+ */</font>
+ IToken enable(String[] ids, DoneCommand done);
+
+ <font color=#3F5FBF>/**
+ * Tell target to change (only) PROP_ENABLED breakpoint property to 'false'.
+ * @param ids - array of disabled breakpoint identifiers.
+ * @param done - command result call back object.
+ */</font>
+ IToken disable(String[] ids, DoneCommand done);
+
+ <font color=#3F5FBF>/**
+ * Tell target to remove breakpoint.
+ * @param id - unique breakpoint identifier.
+ * @param done - command result call back object.
+ */</font>
+ IToken remove(String[] ids, DoneCommand done);
+
+ <font color=#3F5FBF>/**
+ * Upload IDs of breakpoints known to target agent.
+ * @param done - command result call back object.
+ */</font>
+ IToken getIDs(DoneGetIDs done);
+
+ <font color=#7F0055>interface</font> DoneGetIDs {
+ <font color=#7F0055>void</font> doneGetIDs(IToken token, Exception error, String[] ids);
+ }
+
+ <font color=#3F5FBF>/**
+ * Upload properties of given breakpoint from target agent breakpoint table.
+ * @param id - unique breakpoint identifier.
+ * @param done - command result call back object.
+ */</font>
+ IToken getProperties(String id, DoneGetProperties done);
+
+ <font color=#7F0055>interface</font> DoneGetProperties {
+ <font color=#7F0055>void</font> doneGetProperties(IToken token, Exception error, Map&lt;String,Object&gt; properties);
+ }
+
+ <font color=#3F5FBF>/**
+ * Upload status of given breakpoint from target agent.
+ * @param id - unique breakpoint identifier.
+ * @param done - command result call back object.
+ */</font>
+ IToken getStatus(String id, DoneGetStatus done);
+
+ <font color=#7F0055>interface</font> DoneGetStatus {
+ <font color=#7F0055>void</font> doneGetStatus(IToken token, Exception error, Map&lt;String,Object&gt; status);
+ }
+
+ <font color=#3F5FBF>/**
+ * Breakpoints service events listener.
+ */</font>
+ <font color=#7F0055>interface</font> BreakpointsListener {
+
+ <font color=#3F5FBF>/**
+ * Called when breakpoint status changes.
+ * @param id - unique breakpoint identifier.
+ * @param status - breakpoint status.
+ */</font>
+ <font color=#7F0055>void</font> breakpointStatusChanged(String id, Map&lt;String,Object&gt; status);
+ }
+
+ <font color=#7F0055>void</font> addListener(BreakpointsListener listener);
+
+ <font color=#7F0055>void</font> removeListener(BreakpointsListener listener);
+}
+</pre>
+
+</body>
+</html>
+
+
diff --git a/docs/TCF Service - File System.html b/docs/TCF Service - File System.html
new file mode 100644
index 000000000..711b31fe4
--- /dev/null
+++ b/docs/TCF Service - File System.html
@@ -0,0 +1,1212 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <title>Target Communication Framework Services - File System</title>
+</head>
+
+<body lang='EN-US'>
+
+<h1>Target Communication Framework Services - File System</h1>
+
+<ul>
+ <li><a href='#ReqSync'>Request Synchronization and Reordering</a>
+ <li><a href='#FileNames'>File Names</a>
+ <li><a href='#FileModes'>File Open Modes</a>
+ <li><a href='#FileAttributes'>File Attributes</a>
+ <li><a href='#ErrorCodes'>Error Codes</a>
+ <li><a href='#Cmds'>Commands</a>
+ <ul>
+ <li><a href='#CmdOpen'>open</a>
+ <li><a href='#CmdClose'>close</a>
+ <li><a href='#CmdRead'>read</a>
+ <li><a href='#CmdWrite'>write</a>
+ <li><a href='#CmdStat'>stat</a>
+ <li><a href='#CmdLStat'>lstat</a>
+ <li><a href='#CmdFStat'>fstat</a>
+ <li><a href='#CmdSetStat'>setstat</a>
+ <li><a href='#CmdFSetStat'>fsetstat</a>
+ <li><a href='#CmdOpenDir'>opendir</a>
+ <li><a href='#CmdReadDir'>readdir</a>
+ <li><a href='#CmdMkDir'>mkdir</a>
+ <li><a href='#CmdRmDir'>rmdir</a>
+ <li><a href='#CmdRoots'>roots</a>
+ <li><a href='#CmdRemove'>remove</a>
+ <li><a href='#CmdRealPath'>realpath</a>
+ <li><a href='#CmdRename'>rename</a>
+ <li><a href='#CmdReadLink'>readlink</a>
+ <li><a href='#CmdSymLink'>symlink</a>
+ <li><a href='#CmdSymLink'>copy</a>
+ <li><a href='#CmdSymLink'>user</a>
+ </ul>
+ <li><a href='#API'>API</a>
+</ul>
+
+<h1>File System Service</h1>
+
+<p>File System service provides file transfer (and more generally file
+system access) functionality in TCF. The service design is
+derived from SSH File Transfer Protocol specifications.</p>
+
+<h2><a name='ReqSync'>Request Synchronization and Reordering</a></h2>
+
+<p>The protocol and implementations MUST process requests relating to
+the same file in the order in which they are received. In other
+words, if an application submits multiple requests to the server, the
+results in the responses will be the same as if it had sent the
+requests one at a time and waited for the response in each case. For
+example, the server may process non-overlapping read/write requests
+to the same file in parallel, but overlapping reads and writes cannot
+be reordered or parallelized. However, there are no ordering
+restrictions on the server for processing requests from two different
+file transfer connections. The server may interleave and parallelize
+them at will.</p>
+
+<p>There are no restrictions on the order in which responses to
+outstanding requests are delivered to the client, except that the
+server must ensure fairness in the sense that processing of no
+request will be indefinitely delayed even if the client is sending
+other requests so that there are multiple outstanding requests all
+the time.</p>
+
+<p>There is no limit on the number of outstanding (non-acknowledged)
+requests that the client may send to the server. In practice this is
+limited by the buffering available on the data stream and the queuing
+performed by the server. If the server's queues are full, it should
+not read any more data from the stream, and flow control will prevent
+the client from sending more requests.</p>
+
+<h2><a name='FileNames'>File Names</a></h2>
+
+<p>This protocol represents file names as strings. File names are
+assumed to use the slash ('/') character as a directory separator.</p>
+
+<p>File names starting with a slash are "absolute", and are relative to
+the root of the file system. Names starting with any other character
+are relative to the user's default directory (home directory). Client
+can use 'user()' command to retrieve current user home directory.</p>
+
+<p>Servers SHOULD interpret a path name component ".." as referring to
+the parent directory, and "." as referring to the current directory.
+If the server implementation limits access to certain parts of the
+file system, it must be extra careful in parsing file names when
+enforcing such restrictions. There have been numerous reported
+security bugs where a ".." in a path name has allowed access outside
+the intended area.</p>
+
+<p>An empty path name is valid, and it refers to the user's default
+directory (usually the user's home directory).</p>
+
+<p>Otherwise, no syntax is defined for file names by this specification.
+Clients should not make any other assumptions; however, they can
+splice path name components returned by readdir() together
+using a slash ('/') as the separator, and that will work as expected.</p>
+
+<h2><a name='FileModes'>File Open Modes</a></h2>
+
+<p>File open mode is bitwise OR of mode flags:</p>
+
+<dl>
+ <dt><code>O_READ = 0x00000001</code>
+ <dd>Open the file for reading.
+
+ <dt><code>O_WRITE = 0x00000002</code>
+ <dd>Open the file for writing. If both this and O_READ are
+ specified, the file is opened for both reading and writing.
+
+ <dt><code>O_APPEND = 0x00000004</code>
+ <dd>Force all writes to append data at the end of the file.
+
+ <dt><code>O_CREAT = 0x00000008</code>
+ <dd>If this flag is specified, then a new file will be created if one
+ does not already exist (if O_TRUNC is specified, the new file will
+ be truncated to zero length if it previously exists).
+
+ <dt><code>O_TRUNC = 0x00000010</code>
+ <dd>Forces an existing file with the same name to be truncated to zero
+ length when creating a file by specifying O_CREAT.
+ O_CREAT MUST also be specified if this flag is used.
+
+ <dt><code>O_EXCL = 0x00000020</code>
+ <dd>Causes the request to fail if the named file already exists.
+ O_CREAT MUST also be specified if this flag is used.
+</dl>
+
+<h2><a name='FileAttributes'>File Attributes</a></h2>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;file attributes&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;object&gt;</i>
+</font></b></pre>
+
+<p>All attributes are optional.
+Tools and targets can define additional attributes. Predefined attributes are:</p>
+<ul>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Size" : <i>&lt;int&gt;</i></font></b></code>
+ - file size in bytes
+ <li><code><b><font face="Courier New" size=2 color=#333399>"UID" : <i>&lt;int&gt;</i></font></b></code>
+ - file owner user ID
+ <li><code><b><font face="Courier New" size=2 color=#333399>"GID" : <i>&lt;int&gt;</i></font></b></code>
+ - file owner group ID
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Permissions" : <i>&lt;int&gt;</i></font></b></code>
+ - file access permissions
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ATime" : <i>&lt;int&gt;</i></font></b></code>
+ - file last access time
+ <li><code><b><font face="Courier New" size=2 color=#333399>"MTime" : <i>&lt;int&gt;</i></font></b></code>
+ - file last modification time
+</ul>
+
+<h2><a name='ErrorCodes'>Error codes</a></h2>
+
+<p>The service uses standard format for error reports,
+see <a href='TCF Services.html#ErrorFormat'>Error Report Format</a>.</p>
+
+<p>Currently, the following values are defined for error code (other values may be
+defined by future versions of this protocol):</p>
+
+<dl>
+ <dt><code>STATUS_OK = 0</code>
+ <dd>Indicates successful completion of the operation.
+
+ <dt><code>STATUS_EOF = 1</code>
+ <dd>Indicates end-of-file condition; for 'read' it means that no
+ more data is available in the file, and for 'readdir' it
+ indicates that no more files are contained in the directory.
+
+ <dt><code>STATUS_NO_SUCH_FILE = 2</code>
+ <dd>This code is returned when a reference is made to a file which
+ should exist but doesn't.
+
+ <dt><code>STATUS_PERMISSION_DENIED = 3</code>
+ <dd>is returned when the authenticated user does not have sufficient
+ permissions to perform the operation.
+
+ <dt><code>STATUS_FAILURE = 4</code>
+ <dd>is a generic catch-all error message; it should be returned if an
+ error occurs for which there is no more specific error code.
+
+ <dt><code>STATUS_BAD_MESSAGE = 5</code>
+ <dd>may be returned if a badly formatted packet or protocol
+ incompatibility is detected.
+
+ <dt><code>STATUS_NO_CONNECTION = 6</code>
+ <dd>is a pseudo-error which indicates that the client has no
+ connection to the server (it can only be generated locally by the
+ client, and MUST NOT be returned by servers).
+
+ <dt><code>STATUS_CONNECTION_LOST = 7</code>
+ <dd>is a pseudo-error which indicates that the connection to the
+ server has been lost (it can only be generated locally by the
+ client, and MUST NOT be returned by servers).
+
+ <dt><code>STATUS_OP_UNSUPPORTED = 8</code>
+ <dd>indicates that an attempt was made to perform an operation which
+ is not supported for the server (it may be generated locally by
+ the client if e.g. the version number exchange indicates that a
+ required feature is not supported by the server, or it may be
+ returned by the server if the server does not implement an
+ operation).
+</dl>
+
+<h2><a name='Cmds'>Commands</a></h2>
+
+<h3><a name='CmdOpen'>open</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • open • <i>&lt;string: file name&gt;</i> • <i>&lt;int: mode&gt;</i> • <i>&lt;file attributes&gt;</i> •
+</font></b></pre>
+
+<p>The command opens or creates a file on a remote system. If mode contains O_CREAT then new file is created, otherwise exsting
+file is opened. If the file is created, file attributes is looked up for UID, GID and permissions. If no attribute value is found in
+the command parameters, a default value is used.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;file handle&gt;</i> •
+
+<i>&lt;file handle&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> <i>&lt;string&gt;</i>
+</font></b></pre>
+
+<p>On success, the replay contains open file handle. The handle is encoded as a string of characters. Client should never try
+to decode the string, but should use it as is to issue further file access commands. Client should close the file when it is
+not needed any more. Server should close all files that were left open after client connection was closed ot terminated.</p>
+
+<h3><a name='CmdClose'>close</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • close • <i>&lt;string: file handle&gt;</i> •
+</font></b></pre>
+
+<p>The command closes a handle, which was open by 'open' or 'opendir' commands.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdRead'>read</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • read • <i>&lt;string: file handle&gt;</i> • <i>&lt;int: offset&gt;</i> • <i>&lt;int: size&gt;</i> •
+</font></b></pre>
+
+<p>The command reads bytes from an open file.
+In response to this request, the server will read as many bytes as it
+can from the file (up to `len'), and return them in a byte array.
+If an error occurs or EOF is encountered, the server may return
+fewer bytes then requested. Replay argument 'error report'
+will be not null in case of error, and argument 'eof' will be
+true in case of EOF. For normal disk files, it is guaranteed
+that this will read the specified number of bytes, or up to end of file
+or error. For e.g. device files this may return fewer bytes than requested.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;string: data&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;boolean: eof&gt;</i> •
+</font></b></pre>
+
+<p><i>&lt;string: data&gt;</i> is Base64 encoded byte array of file data. Number of bytes is determined by the string length.
+'eof' is true when 'data' contains all available bytes up to the end of the file.</p>
+
+<h3><a name='CmdWrite'>write</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • write • <i>&lt;string: file handle&gt;</i> • <i>&lt;int: offset&gt;</i> • <i>&lt;string: data&gt;</i> •
+</font></b></pre>
+
+<p>The command writes bytes into an open file.
+The write will extend the file if writing beyond the end of the file.
+It is legal to write way beyond the end of the file; the semantics
+are to write zeroes from the end of the file to the specified offset
+and then the data. <i>&lt;string: data&gt;</i> is Base64 encoded array of data bytes.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdStat'>stat</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • stat • <i>&lt;string: file name&gt;</i> •
+</font></b></pre>
+
+<p>The command retrieves file attributes.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;file attributes&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdLStat'>lstat</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • lstat • <i>&lt;string: file name&gt;</i> •
+</font></b></pre>
+
+<p>The command retrieves file attributes.
+Unlike 'stat', 'lstat' does not follow symbolic links.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;file attributes&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdFStat'>fstat</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • fstat • <i>&lt;string: file handle&gt;</i> •
+</font></b></pre>
+
+<p>The command retrieves file attributes for an open file (identified by the file handle).</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;file attributes&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdSetStat'>setstat</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • setstat • <i>&lt;string: file name&gt;</i> • <i>&lt;file attributes&gt;</i> •
+</font></b></pre>
+
+<p>The command sets file attributes.
+This request is used for operations such as changing the ownership,
+permissions or access times, as well as for truncating a file.
+An error will be returned if the specified file system object does
+not exist or the user does not have sufficient rights to modify the
+specified attributes.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdFSetStat'>fsetstat</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • fsetstat • <i>&lt;string: file handle&gt;</i> • <i>&lt;file attributes&gt;</i> •
+</font></b></pre>
+
+<p>The command sets file attributes for an open file (identified by the file handle).
+This request is used for operations such as changing the ownership,
+permissions or access times, as well as for truncating a file.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdOpenDir'>opendir</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • opendir • <i>&lt;string: path&gt;</i> •
+</font></b></pre>
+
+<p>The command opens a directory for reading.
+Once the directory has been successfully opened, files (and
+directories) contained in it can be listed using 'readdir' requests.
+When the client no longer wishes to read more names from the
+directory, it SHOULD call 'close' for the handle. The handle
+should be closed regardless of whether a read errors have occurred or not.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;file handle&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdReadDir'>readdir</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • readdir • <i>&lt;string: file handle&gt;</i> •
+</font></b></pre>
+
+<p>The command returns one
+or more file names with full file attributes for each file. The
+client should call 'readdir' repeatedly until it has found the
+file it is looking for or until the server responds with a
+message indicating an error or end of file. The client should then
+close the handle using the 'close' request.
+Note: directory entries "." and ".." are NOT included into readdir()
+response.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;array of directory entries&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;boolean: eof&gt;</i> •
+
+<i>&lt;array of directory entries&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ ]
+ <font face=Wingdings>Ψ</font> [ <i>&lt;directory entry list&gt;</i> ]
+
+<i>&lt;directory entry list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;directory entry&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&ltdirectory entry list&gt;</i> , <i>&lt;directory entry&gt;</i>
+
+<i>&lt;directory entry&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;object&gt;</i>
+</font></b></pre>
+
+<p>Directory entry attributes are:</p>
+<ul>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"FileName" : <i>&lt;string&gt;</i></font></b></code>
+ - a file name being returned, it will be a relative name within the directory,
+ without any path components.
+ <li><code><b><font face="Courier New" size=2 color=#333399>"LongName" : <i>&lt;string&gt;</i></font></b></code>
+ - a human readable, expanded format for the file name, similar to what
+ is returned by "ls -l" on Unix systems
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Attrs" : <i>&lt;file attributes&gt;</i></font></b></code>
+ - the attributes of the file as described in Section <a href='#FileAttributes'>File Attributes</a>.
+</ul>
+
+<h3><a name='CmdMkDir'>mkdir</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • mkdir • <i>&lt;string: directory path&gt;</i> • <i>&lt;file attributes&gt;</i> •
+</font></b></pre>
+
+<p>The command creates a directory on the server.
+<i>&lt;string: directory path&gt;</i> specifies the directory to be created.
+<i>&lt;file attributes&gt;</i> specifies new directory attributes.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdRmDir'>rmdir</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • rmdir • <i>&lt;string: directory path&gt;</i> •
+</font></b></pre>
+
+<p>The command removes a directory.
+An error will be returned if no directory
+with the specified path exists, or if the specified directory is not
+empty, or if the path specified a file system object other than a
+directory. <i>&lt;string: directory path&gt;</i> - specifies the directory to be removed.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdRoots'>roots</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • roots •
+</font></b></pre>
+
+<p>The command retrieves file system roots - top level file system objects.
+UNIX file system can report just one root with path "/". Other types of systems
+can have more the one root. For example, Windows server can return multiple roots:
+one per disc (e.g. "/C:/", "/D:/", etc.). Note: even Windows implementation of
+the service must use forward slash as directory separator, and must start
+absolute path with "/". Server should implement proper translation of
+protocol file names to OS native names and back.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;array of directory entries&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdRemove'>remove</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • remove • <i>&lt;string: path&gt;</i> •
+</font></b></pre>
+
+<p>The command removes a file or symbolic link.
+This request cannot be used to remove directories.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdRealPath'>realpath</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • realpath • <i>&lt;string: path&gt;</i> •
+</font></b></pre>
+
+<p>The command canonicalizes any given path name to an absolute path.
+This is useful for converting path names containing ".." components or
+relative pathnames without a leading slash into absolute paths.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;string: path&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdRename'>rename</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • rename • <i>&lt;string: old path&gt;</i> • <i>&lt;string: new path&gt;</i> •
+</font></b></pre>
+
+<p>The command renames a file.
+It is an error if there already exists a file
+with the name specified by <i>&lt;string: new path&gt;</i>. The server may also fail rename
+requests in other situations, for example if <i>&lt;string: old path&gt;</i> and <i>&lt;string: new path&gt;</i>
+point to different file systems on the server.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdReadLink'>readlink</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • readlink • <i>&lt;string: link path&gt;</i> •
+</font></b></pre>
+
+<p>The command reads the target of a symbolic link.
+<i>&lt;string: link path&gt;</i> specifies the path name of the symbolic link to be read.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;string: path&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdSymLink'>symlink</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • symlink • <i>&lt;string: link path&gt;</i> • <i>&lt;string: target path&gt;</i> •
+</font></b></pre>
+
+<p>The command creates a symbolic link on the server.
+<i>&lt;string: link path&gt;</i> specifies the path name of the symbolic link to be created.
+<i>&lt;string: target path&gt;</i> specifies the target of the symbolic link.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdCopy'>copy</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • copy • <i>&lt;string: source path&gt;</i> • <i>&lt;string: destination path&gt;</i> •
+ <i>&lt;boolean: copy permissions&gt;</i> • <i>&lt;boolean: copy ownership&gt;</i> •
+</font></b></pre>
+
+<p>The command copies a file on remote system.
+<i>&lt;string: source path&gt;</i> specifies the path name of the file to be copied.
+<i>&lt;string: destination path&gt;</i> specifies destination file name.
+If <i>&lt;boolean: copy permissions&gt;</i> is true then copy source file permissions.
+If <i>&lt;boolean: copy ownership&gt;</i> is true then copy source file UID and GID.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdUser'>user</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • FileSystem • user •
+</font></b></pre>
+
+<p>The command retrieves information about user account, which is used by server
+to access file system on behalf of the client.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;int: real UID&gt;</i> • <i>&lt;int: effective UID&gt;</i> •
+ <i>&lt;int: real GID&gt;</i> • <i>&lt;int: effective GID&gt;</i> • <i>&lt;string: home directory&gt;</i> •
+</font></b></pre>
+
+<h2><a name='API'>API</a></h2>
+
+<pre>
+<font color=#3F5FBF>/**
+ * File System service provides file transfer (and more generally file
+ * system access) functionality in TCF. The service design is
+ * derived from SSH File Transfer Protocol specifications.
+ */</font>
+<font color=#7F0055>public interface</font> IFileSystem <font color=#7F0055>extends</font> IService {
+
+ <font color=#3F5FBF>/**
+ * Service name.
+ */</font>
+ <font color=#7F0055>static final</font> String NAME = "FileSystem";
+
+ <font color=#3F5FBF>/**
+ * Flags to be used with open() method.
+ */</font>
+ <font color=#7F0055>static final int</font>
+
+ <font color=#3F5FBF>/**
+ * Open the file for reading.
+ */</font>
+ O_READ = 0x00000001,
+
+ <font color=#3F5FBF>/**
+ * Open the file for writing. If both this and O_READ are
+ * specified, the file is opened for both reading and writing.
+ */</font>
+ O_WRITE = 0x00000002,
+
+ <font color=#3F5FBF>/**
+ * Force all writes to append data at the end of the file.
+ */</font>
+ O_APPEND = 0x00000004,
+
+ <font color=#3F5FBF>/**
+ * If this flag is specified, then a new file will be created if one
+ * does not already exist (if O_TRUNC is specified, the new file will
+ * be truncated to zero length if it previously exists).
+ */</font>
+ O_CREAT = 0x00000008,
+
+ <font color=#3F5FBF>/**
+ * Forces an existing file with the same name to be truncated to zero
+ * length when creating a file by specifying O_CREAT.
+ * O_CREAT MUST also be specified if this flag is used.
+ */</font>
+ O_TRUNC = 0x00000010,
+
+ <font color=#3F5FBF>/**
+ * Causes the request to fail if the named file already exists.
+ * O_CREAT MUST also be specified if this flag is used.
+ */</font>
+ O_EXCL = 0x00000020;
+
+ <font color=#3F5FBF>/**
+ * Flags to be used together with FileAttrs.
+ * The flags specify which of the fields are present. Those fields
+ * for which the corresponding flag is not set are not present (not
+ * included in the message).
+ */</font>
+ <font color=#7F0055>static final int</font>
+ ATTR_SIZE = 0x00000001,
+ ATTR_UIDGID = 0x00000002,
+ ATTR_PERMISSIONS = 0x00000004,
+ ATTR_ACMODTIME = 0x00000008;
+
+ <font color=#3F5FBF>/**
+ * FileAttrs is used both when returning file attributes from
+ * the server and when sending file attributes to the server. When
+ * sending it to the server, the flags field specifies which attributes
+ * are included, and the server will use default values for the
+ * remaining attributes (or will not modify the values of remaining
+ * attributes). When receiving attributes from the server, the flags
+ * specify which attributes are included in the returned data. The
+ * server normally returns all attributes it knows about.
+ */</font>
+ <font color=#7F0055>final static class</font> FileAttrs {
+
+ <font color=#3F5FBF>/**
+ * The `flags' specify which of the fields are present.
+ */</font>
+ <font color=#7F0055>public final int</font> flags;
+
+ <font color=#3F5FBF>/**
+ * The `size' field specifies the size of the file in bytes.
+ */</font>
+ <font color=#7F0055>public final long</font> size;
+
+ <font color=#3F5FBF>/**
+ * The `uid' and `gid' fields contain numeric Unix-like user and group
+ * identifiers, respectively.
+ */</font>
+ <font color=#7F0055>public final int</font> uid;
+ <font color=#7F0055>public final int</font> gid;
+
+ <font color=#3F5FBF>/**
+ * The `permissions' field contains a bit mask of file permissions as
+ * defined by posix [1].
+ */</font>
+ <font color=#7F0055>public final int</font> permissions;
+
+ <font color=#3F5FBF>/**
+ * The `atime' and `mtime' contain the access and modification times of
+ * the files, respectively. They are represented as milliseconds from
+ * midnight Jan 1, 1970 in UTC.
+ */</font>
+ <font color=#7F0055>public final long</font> atime;
+ <font color=#7F0055>public final long</font> mtime;
+
+ <font color=#3F5FBF>/**
+ * Additional (non-standard) attributes.
+ */</font>
+ <font color=#7F0055>public final</font> Map&lt;String,Object&gt; attributes;
+
+ <font color=#7F0055>public</font> FileAttrs(<font color=#7F0055>int</font> flags, <font color=#7F0055>long</font> size, <font color=#7F0055>int</font> uid, <font color=#7F0055>int</font> gid,
+ <font color=#7F0055>int</font> permissions, <font color=#7F0055>long</font> atime, <font color=#7F0055>long</font> mtime, Map&lt;String,Object&gt; attributes);
+
+ <font color=#3F5FBF>/**
+ * Determines if the file system object is a file on the remote file system.
+ *
+ * @return true if and only if the object on the remote system can be considered to have "contents" that
+ * have the potential to be read and written as a byte stream.
+ */</font>
+ <font color=#7F0055>public boolean</font> isFile();
+
+ <font color=#3F5FBF>/**
+ * Determines if the file system object is a directory on the remote file system.
+ *
+ * @return true if and only if the object on the remote system is a directory.
+ * That is, it contains entries that can be interpreted as other files.
+ */</font>
+ <font color=#7F0055>public boolean</font> isDirectory();
+ }
+
+ <font color=#3F5FBF>/**
+ * The following flags are defined for the 'permissions' field:
+ */</font>
+ <font color=#7F0055>static final int</font>
+ S_IFMT = 0170000, // bitmask for the file type bitfields
+ S_IFSOCK = 0140000, // socket
+ S_IFLNK = 0120000, // symbolic link
+ S_IFREG = 0100000, // regular file
+ S_IFBLK = 0060000, // block device
+ S_IFDIR = 0040000, // directory
+ S_IFCHR = 0020000, // character device
+ S_IFIFO = 0010000, // fifo
+ S_ISUID = 0004000, // set UID bit
+ S_ISGID = 0002000, // set GID bit (see below)
+ S_ISVTX = 0001000, // sticky bit (see below)
+ S_IRWXU = 00700, // mask for file owner permissions
+ S_IRUSR = 00400, // owner has read permission
+ S_IWUSR = 00200, // owner has write permission
+ S_IXUSR = 00100, // owner has execute permission
+ S_IRWXG = 00070, // mask for group permissions
+ S_IRGRP = 00040, // group has read permission
+ S_IWGRP = 00020, // group has write permission
+ S_IXGRP = 00010, // group has execute permission
+ S_IRWXO = 00007, // mask for permissions for others (not in group)
+ S_IROTH = 00004, // others have read permission
+ S_IWOTH = 00002, // others have write permisson
+ S_IXOTH = 00001; // others have execute permission
+
+ <font color=#7F0055>final static class</font> DirEntry {
+ <font color=#3F5FBF>/**
+ * `filename' is a file name being returned. It is a relative name within
+ * the directory, without any path components;
+ */</font>
+ <font color=#7F0055>public final</font> String filename;
+
+ <font color=#3F5FBF>/**
+ * `longname' is an expanded format for the file name, similar to what
+ * is returned by "ls -l" on Unix systems.
+ * The format of the `longname' field is unspecified by this protocol.
+ * It MUST be suitable for use in the output of a directory listing
+ * command (in fact, the recommended operation for a directory listing
+ * command is to simply display this data). However, clients SHOULD NOT
+ * attempt to parse the longname field for file attributes; they SHOULD
+ * use the attrs field instead.
+ */</font>
+ <font color=#7F0055>public final</font> String longname;
+
+ <font color=#3F5FBF>/**
+ * `attrs' is the attributes of the file.
+ */</font>
+ <font color=#7F0055>public final</font> FileAttrs attrs;
+
+ <font color=#7F0055>public</font> DirEntry(String filename, String longname, FileAttrs attrs);
+ }
+
+ <font color=#3F5FBF>/**
+ * Opaque representation of open file handle.
+ * Note: open file handle can be used only with service instance that
+ * created the handle.
+ */</font>
+ <font color=#7F0055>interface</font> IFileHandle {
+ IFileSystem getService();
+ }
+
+ <font color=#3F5FBF>/**
+ * Status codes.
+ */</font>
+ <font color=#7F0055>static final int</font>
+
+ <font color=#3F5FBF>/**
+ * Indicates successful completion of the operation.
+ */</font>
+ STATUS_OK = 0,
+
+ <font color=#3F5FBF>/**
+ * Indicates end-of-file condition; for read() it means that no
+ * more data is available in the file, and for readdir() it
+ * indicates that no more files are contained in the directory.
+ */</font>
+ STATUS_EOF = 1,
+
+ <font color=#3F5FBF>/**
+ * This code is returned when a reference is made to a file which
+ * should exist but doesn't.
+ */</font>
+ STATUS_NO_SUCH_FILE = 2,
+
+ <font color=#3F5FBF>/**
+ * is returned when the authenticated user does not have sufficient
+ * permissions to perform the operation.
+ */</font>
+ STATUS_PERMISSION_DENIED = 3,
+
+ <font color=#3F5FBF>/**
+ * is a generic catch-all error message; it should be returned if an
+ * error occurs for which there is no more specific error code.
+ *
+ */</font>
+ STATUS_FAILURE = 4,
+
+ <font color=#3F5FBF>/**
+ * may be returned if a badly formatted packet or protocol
+ * incompatibility is detected.
+ */</font>
+ STATUS_BAD_MESSAGE = 5,
+
+ <font color=#3F5FBF>/**
+ * is a pseudo-error which indicates that the client has no
+ * connection to the server (it can only be generated locally by the
+ * client, and MUST NOT be returned by servers).
+ */</font>
+ STATUS_NO_CONNECTION = 6,
+
+ <font color=#3F5FBF>/**
+ * is a pseudo-error which indicates that the connection to the
+ * server has been lost (it can only be generated locally by the
+ * client, and MUST NOT be returned by servers).
+ */</font>
+ STATUS_CONNECTION_LOST = 7,
+
+ <font color=#3F5FBF>/**
+ * indicates that an attempt was made to perform an operation which
+ * is not supported for the server (it may be generated locally by
+ * the client if e.g. the version number exchange indicates that a
+ * required feature is not supported by the server, or it may be
+ * returned by the server if the server does not implement an
+ * operation).
+ */</font>
+ STATUS_OP_UNSUPPORTED = 8;
+
+ <font color=#7F0055>abstract static class</font> FileSystemException extends IOException {
+
+ <font color=#7F0055>protected</font> FileSystemException(String message);
+
+ <font color=#7F0055>protected</font> FileSystemException(Exception x)
+
+ <font color=#7F0055>public abstract int</font> getStatus();
+ }
+
+ <font color=#3F5FBF>/**
+ * Open or create a file on a remote system.
+ *
+ * @param file_name specifies the file name. See 'File Names' for more information.
+ * @param flags is a bit mask of O_* flags.
+ * @param attrs specifies the initial attributes for the file.
+ * Default values will be used for those attributes that are not specified.
+ * @param done is call back object.
+ * @return pending command handle.
+ */</font>
+ IToken open(String file_name, <font color=#7F0055>int</font> flags, FileAttrs attrs, DoneOpen done);
+
+ <font color=#7F0055>interface</font> DoneOpen {
+ <font color=#7F0055>void</font> doneOpen(IToken token, FileSystemException error, IFileHandle handle);
+ }
+
+ <font color=#3F5FBF>/**
+ * Close a file on a remote system.
+ *
+ * @param handle is a handle previously returned in the response to
+ * open() or opendir().
+ * @param done is call back object.
+ * @return pending command handle.
+ */</font>
+ IToken close(IFileHandle handle, DoneClose done);
+
+ <font color=#7F0055>interface</font> DoneClose {
+ <font color=#7F0055>void</font> doneClose(IToken token, FileSystemException error);
+ }
+
+ <font color=#3F5FBF>/**
+ * Read bytes from an open file.
+ * In response to this request, the server will read as many bytes as it
+ * can from the file (up to `len'), and return them in a byte array.
+ * If an error occurs or EOF is encountered, the server may return
+ * fewer bytes then requested. Call back method doneRead() argument 'error'
+ * will be not null in case of error, and argument 'eof' will be
+ * true in case of EOF. For normal disk files, it is guaranteed
+ * that this will read the specified number of bytes, or up to end of file
+ * or error. For e.g. device files this may return fewer bytes than requested.
+ *
+ * @param handle is an open file handle returned by open().
+ * @param offset is the offset (in bytes) relative
+ * to the beginning of the file from where to start reading.
+ * @param len is the maximum number of bytes to read.
+ * @param done is call back object.
+ * @return pending command handle.
+ */</font>
+ IToken read(IFileHandle handle, long offset, <font color=#7F0055>int</font> len, DoneRead done);
+
+ <font color=#7F0055>interface</font> DoneRead {
+ <font color=#7F0055>void</font> doneRead(IToken token, FileSystemException error, byte[] data, boolean eof);
+ }
+
+ <font color=#3F5FBF>/**
+ * Write bytes into an open file.
+ * The write will extend the file if writing beyond the end of the file.
+ * It is legal to write way beyond the end of the file; the semantics
+ * are to write zeroes from the end of the file to the specified offset
+ * and then the data.
+ *
+ * @param handle is an open file handle returned by open().
+ * @param offset is the offset (in bytes) relative
+ * to the beginning of the file from where to start writing.
+ * @param data is byte array that contains data for writing.
+ * @param data_pos if offset in 'data' of first byte to write.
+ * @param data_size is the number of bytes to write.
+ * @param done is call back object.
+ * @return pending command handle.
+ */</font>
+ IToken write(IFileHandle handle, long offset,
+ byte[] data, <font color=#7F0055>int</font> data_pos, <font color=#7F0055>int</font> data_size, DoneWrite done);
+
+ <font color=#7F0055>interface</font> DoneWrite {
+ <font color=#7F0055>void</font> doneWrite(IToken token, FileSystemException error);
+ }
+
+ <font color=#3F5FBF>/**
+ * Retrieve file attributes.
+ *
+ * @param path - specifies the file system object for which
+ * status is to be returned.
+ * @param done is call back object.
+ * @return pending command handle.
+ */</font>
+ IToken stat(String path, DoneStat done);
+
+ <font color=#3F5FBF>/**
+ * Retrieve file attributes.
+ * Unlike 'stat()', 'lstat()' does not follow symbolic links.
+ *
+ * @param path - specifies the file system object for which
+ * status is to be returned.
+ * @param done is call back object.
+ * @return pending command handle.
+ */</font>
+ IToken lstat(String path, DoneStat done);
+
+ <font color=#3F5FBF>/**
+ * Retrieve file attributes for an open file (identified by the file handle).
+ *
+ * @param handle is a file handle returned by 'open()'.
+ * @param done is call back object.
+ * @return pending command handle.
+ */</font>
+ IToken fstat(IFileHandle handle, DoneStat done);
+
+ <font color=#7F0055>interface</font> DoneStat {
+ <font color=#7F0055>void</font> doneStat(IToken token, FileSystemException error, FileAttrs attrs);
+ }
+
+ <font color=#3F5FBF>/**
+ * Set file attributes.
+ * This request is used for operations such as changing the ownership,
+ * permissions or access times, as well as for truncating a file.
+ * An error will be returned if the specified file system object does
+ * not exist or the user does not have sufficient rights to modify the
+ * specified attributes.
+ *
+ * @param path specifies the file system object (e.g. file or directory)
+ * whose attributes are to be modified.
+ * @param attrs specifies the modifications to be made to file attributes.
+ * @param done is call back object.
+ * @return pending command handle.
+ */</font>
+ IToken setstat(String path, FileAttrs attrs, DoneSetStat done);
+
+ <font color=#3F5FBF>/**
+ * Set file attributes for an open file (identified by the file handle).
+ * This request is used for operations such as changing the ownership,
+ * permissions or access times, as well as for truncating a file.
+ *
+ * @param handle is a file handle returned by 'open()'.
+ * @param attrs specifies the modifications to be made to file attributes.
+ * @param done is call back object.
+ * @return pending command handle.
+ */</font>
+ IToken fsetstat(IFileHandle handle, FileAttrs attrs, DoneSetStat done);
+
+ <font color=#7F0055>interface</font> DoneSetStat {
+ <font color=#7F0055>void</font> doneSetStat(IToken token, FileSystemException error);
+ }
+
+ <font color=#3F5FBF>/**
+ * The opendir() command opens a directory for reading.
+ * Once the directory has been successfully opened, files (and
+ * directories) contained in it can be listed using readdir() requests.
+ * When the client no longer wishes to read more names from the
+ * directory, it SHOULD call close() for the handle. The handle
+ * should be closed regardless of whether an error has occurred or not.
+
+ * @param path - name of the directory to be listed (without any trailing slash).
+ * @param done - result call back object.
+ * @return pending command handle.
+ */</font>
+ IToken opendir(String path, DoneOpen done);
+
+ <font color=#3F5FBF>/**
+ * The files in a directory can be listed using the opendir() and
+ * readdir() requests. Each readdir() request returns one
+ * or more file names with full file attributes for each file. The
+ * client should call readdir() repeatedly until it has found the
+ * file it is looking for or until the server responds with a
+ * message indicating an error or end of file. The client should then
+ * close the handle using the close() request.
+ * Note: directory entries "." and ".." are NOT included into readdir()
+ * response.
+ * @param handle - file handle created by opendir()
+ * @param done - result call back object.
+ * @return pending command handle.
+ */</font>
+ IToken readdir(IFileHandle handle, DoneReadDir done);
+
+ <font color=#7F0055>interface</font> DoneReadDir {
+ <font color=#7F0055>void</font> doneReadDir(IToken token, FileSystemException error, DirEntry[] entries, boolean eof);
+ }
+
+ <font color=#3F5FBF>/**
+ * Create a directory on the server.
+ *
+ * @param path - specifies the directory to be created.
+ * @param attrs - new directory attributes.
+ * @param done - result call back object.
+ * @return pending command handle.
+ */</font>
+ IToken mkdir(String path, FileAttrs attrs, DoneMkDir done);
+
+ <font color=#7F0055>interface</font> DoneMkDir {
+ <font color=#7F0055>void</font> doneMkDir(IToken token, FileSystemException error);
+ }
+
+ <font color=#3F5FBF>/**
+ * Remove a directory.
+ * An error will be returned if no directory
+ * with the specified path exists, or if the specified directory is not
+ * empty, or if the path specified a file system object other than a
+ * directory.
+ *
+ * @param path - specifies the directory to be removed.
+ * @param done - result call back object.
+ * @return pending command handle.
+ */</font>
+ IToken rmdir(String path, DoneRemove done);
+
+ <font color=#7F0055>interface</font> DoneRemove {
+ <font color=#7F0055>void</font> doneRemove(IToken token, FileSystemException error);
+ }
+
+ <font color=#3F5FBF>/**
+ * Retrieve file system roots - top level file system objects.
+ * UNIX file system can report just one root with path "/". Other types of systems
+ * can have more the one root. For example, Windows server can return multiple roots:
+ * one per disc (e.g. "/C:/", "/D:/", etc.). Note: even Windows implementation of
+ * the service must use forward slash as directory separator, and must start
+ * absolute path with "/". Server should implement proper translation of
+ * protocol file names to OS native names and back.
+ *
+ * @param done - result call back object.
+ * @return pending command handle.
+ */</font>
+ IToken roots(DoneRoots done);
+
+ <font color=#7F0055>interface</font> DoneRoots {
+ <font color=#7F0055>void</font> doneRoots(IToken token, FileSystemException error, DirEntry[] entries);
+ }
+
+ <font color=#3F5FBF>/**
+ * Remove a file or symbolic link.
+ * This request cannot be used to remove directories.
+ *
+ * @param file_name is the name of the file to be removed.
+ * @param done - result call back object.
+ * @return pending command handle.
+ */</font>
+ IToken remove(String file_name, DoneRemove done);
+
+ <font color=#3F5FBF>/**
+ * Canonicalize any given path name to an absolute path.
+ * This is useful for converting path names containing ".." components or
+ * relative pathnames without a leading slash into absolute paths.
+ *
+ * @param path specifies the path name to be canonicalized.
+ * @param done - result call back object.
+ * @return pending command handle.
+ */</font>
+ IToken realpath(String path, DoneRealPath done);
+
+ <font color=#7F0055>interface</font> DoneRealPath {
+ <font color=#7F0055>void</font> doneRealPath(IToken token, FileSystemException error, String path);
+ }
+
+ <font color=#3F5FBF>/**
+ * Rename a file.
+ * It is an error if there already exists a file
+ * with the name specified by 'new_path'. The server may also fail rename
+ * requests in other situations, for example if `old_path' and `new_path'
+ * point to different file systems on the server.
+ *
+ * @param old_path is the name of an existing file or directory.
+ * @param new_path is the new name for the file or directory.
+ * @param done - result call back object.
+ * @return pending command handle.
+ */</font>
+ IToken rename(String old_path, String new_path, DoneRename done);
+
+ <font color=#7F0055>interface</font> DoneRename {
+ <font color=#7F0055>void</font> doneRename(IToken token, FileSystemException error);
+ }
+
+ <font color=#3F5FBF>/**
+ * Read the target of a symbolic link.
+ *
+ * @param path specifies the path name of the symbolic link to be read.
+ * @param done - result call back object.
+ * @return pending command handle.
+ */</font>
+ IToken readlink(String path, DoneReadLink done);
+
+ <font color=#7F0055>interface</font> DoneReadLink {
+ <font color=#7F0055>void</font> doneReadLink(IToken token, FileSystemException error, String path);
+ }
+
+ <font color=#3F5FBF>/**
+ * Create a symbolic link on the server.
+ *
+ * @param link_path specifies the path name of the symbolic link to be created.
+ * @param target_path specifies the target of the symbolic link.
+ * @param done - result call back object.
+ * @return pending command handle.
+ */</font>
+ IToken symlink(String link_path, String target_path, DoneSymLink done);
+
+ <font color=#7F0055>interface</font> DoneSymLink {
+ <font color=#7F0055>void</font> doneSymLink(IToken token, FileSystemException error);
+ }
+
+ <font color=#3F5FBF>/**
+ * Copy a file on remote system.
+ *
+ * @param src_path specifies the path name of the file to be copied.
+ * @param dst_path specifies destination file name.
+ * @param copy_permissions - if true then copy source file permissions.
+ * @param copy_ownership - if true then copy source file UID and GID.
+ * @param done - result call back object.
+ * @return pending command handle.
+ */</font>
+ IToken copy(String src_path, String dst_path,
+ boolean copy_permissions, boolean copy_ownership, DoneCopy done);
+
+ <font color=#7F0055>interface</font> DoneCopy {
+ <font color=#7F0055>void</font> doneCopy(IToken token, FileSystemException error);
+ }
+
+ <font color=#3F5FBF>/**
+ * Retrieve information about user account, which is used by server
+ * to access file system on behalf of the client.
+ *
+ * @param done - result call back object.
+ * @return pending command handle.
+ */</font>
+ IToken user(DoneUser done);
+
+ <font color=#7F0055>interface</font> DoneUser {
+ <font color=#7F0055>void</font> doneUser(IToken token, FileSystemException error,
+ <font color=#7F0055>int</font> real_uid, <font color=#7F0055>int</font> effective_uid, <font color=#7F0055>int</font> real_gid, <font color=#7F0055>int</font> effective_gid,
+ String home);
+ }
+}
+</pre>
+
+</body>
+</html>
+
+
diff --git a/docs/TCF Service - Memory.html b/docs/TCF Service - Memory.html
new file mode 100644
index 000000000..afca975ea
--- /dev/null
+++ b/docs/TCF Service - Memory.html
@@ -0,0 +1,456 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <title>Target Communication Framework Services - Memory</title>
+</head>
+
+<body lang='EN-US'>
+
+<h1>Target Communication Framework Services - Memory</h1>
+
+<ul>
+ <li><a href='#Cmds'>Commands</a>
+ <ul>
+ <li><a href='#CmdGetContext'>Get Context</a>
+ <li><a href='#CmdGetChildren'>Get Children</a>
+ <li><a href='#CmdSetMemory'>Set Memory</a>
+ <li><a href='#CmdGetMemory'>Get Memory</a>
+ <li><a href='#CmdFillMemory'>Fill Memory</a>
+ </ul>
+ <li><a href='#Events'>Events</a>
+ <li><a href='#API'>API</a>
+</ul>
+
+<h1>Memory Service</h1>
+
+<p>The service provides basic operations to read/write memory on a target. Command
+and event parameters are encoded as zero terminated <a href='TCF Specification.html#JSON'>JSON</a> strings.</p>
+
+<p>The service uses standard format for error reports,
+see <a href='TCF Services.html#ErrorFormat'>Error Report Format</a>.</p>
+
+<p>A single memory access can succeed for some addresses and fail for others. In such
+situation result message can contain partially valid data. Array of error addresses,
+in addition to error report, describes data validity on per byte basis:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;array of error addresses&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ <i>&lt;error address list&gt;</i> ]
+
+<i>&lt;error address list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;error address&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;error address list&gt;</i> , <i>&lt;error address&gt;</i>
+
+<i>&lt;error address&gt;</i>
+ <font face=Wingdings>Ψ</font> { "addr" : <i>&lt;int: range starting address&gt;</i> , "size" : <i>&lt;int: range length in bytes&gt;</i> , "stat" : <i>&lt;int: status code&gt;</i> , "msg" : <i>&lt;error description&gt;</i> }
+</font></b></pre>
+
+<p>If there is no entry in error addresses array for a data byte, then status of such
+byte is defined by main error report.</p>
+
+<p>Status code is bitwise or of status flags:</p>
+<dl>
+ <dt><code><b>BYTE_VALID        = 0x00</b></code> <dd>no error for this byte
+    <dt><code><b>BYTE_UNKNOWN      = 0x01</b></code> <dd>status is unknown
+ <dt><code><b>BYTE_INVALID      = 0x02</b></code> <dd>byte value in invalid, error message describes the problem
+ <dt><code><b>BYTE_CANNOT_READ  = 0x04</b></code> <dd>cannot read the byte
+ <dt><code><b>BYTE_CANNOT_WRITE = 0x08</b></code> <dd>cannot write the byte
+</dl>
+
+<h2><a name='Cmds'>Commands</a></h2>
+
+<h3><a name='CmdGetContext'>Get Context</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Memory • getContext • <i>&lt;string: context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command retrieves context info for given context ID. A context corresponds to an
+execution thread, process, address space, etc. Exact
+meaning of a context depends on the target. Target agent should define contexts hierarchy
+that is:</p>
+
+<ul type='disc'>
+ <li>Sufficient to resolve possible ambiguity of a memory address;
+
+ <li>Adequately reflects target memory management strategy;
+
+ <li>Intuitive to a user.
+</ul>
+
+<p>For traditional OS, like UNIX, memory access context can be one of:</p>
+
+<ul type='disc'>
+ <li>Kernel address space;
+
+ <li>A process.
+</ul>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;context data&gt;</i> •
+
+<i>&lt;context data&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> <i>&lt;object&gt;</i>
+</font></b></pre>
+
+<p>Context data object should, at least, contain member
+<b><font face="Courier New" size=2 color=#333399>"ID" : <i>&lt;string&gt;.</i></font></b>
+Context data is expected to be cached by clients.
+Service sends contextChanged event to notify changes in context data.</p>
+
+<p>Predefined memory context properties are:</p>
+<ul>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ID" : <i>&lt;string&gt;</i></font></b></code>
+ - ID of the context, same as getContext command argument.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ParentID" : <i>&lt;string&gt;</i></font></b></code>
+ - ID of a parent context.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"BigEndian" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if memory is big-endian.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"AddressSize" : <i>&lt;int&gt;</i></font></b></code>
+ - size of memory address in bytes.
+</ul>
+
+<h3><a name='CmdGetChildren'>Get Children</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Memory • getChildren • <i>&lt;string: parent context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command requests a list of contexts available for memory access commands.</p>
+
+<p>Parent context ID can be null – to retrieve top level of the hierarchy, can be one
+of context IDs retrieved by previous getChildren commands, or it can be obtained from another service.
+Contexts hierarchy can be simple plain list or it can form a tree. It is up to target agent developers to
+choose layout that is most descriptive for a given target.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;array of context IDs&gt;</i> •<i></i>
+
+<i>&lt;array of context IDs&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ ]
+ <font face=Wingdings>Ψ</font> [ <i>&lt;context ID list&gt;</i> ]
+
+<i>&lt;context ID list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;string: context ID&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;context ID list&gt;</i> , <i>&lt;string: context ID&gt;</i>
+
+</font></b></pre>
+
+<h3><a name='CmdSetMemory'>Set Memory</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • &lt;token&gt; • Memory • set •
+ <i>&lt;string: context ID&gt;</i> • <i>&lt;int: address&gt;</i> • <i>&lt;int: word size&gt;</i> •
+ <i>&lt;int: byte count&gt;</i> • <i>&lt;int: mode&gt;</i> • <i>&lt;string: BASE64 encoded byte array&gt;</i> •
+</font></b></pre>
+
+<p>Writes data bytes at given address in memory, "word size" bytes at a time. Address
+should be aligned by "word size". Context ID must be one returned by getContexts.
+Mode is logical OR of any combination of:</p>
+
+<ul type='disc'>
+ <li>0x1 – continue on error (like bus error or page fault)
+
+ <li>0x2 – verify data after writing by reading back and compare
+</ul>
+
+<p>Result message:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;array of error addresses&gt;</i> •
+</font></b></pre>
+
+<p>Error report provides integer error code and a short, human readable explanation
+of error. Error addresses, when present, let client know which bytes of data failed
+to be written into memory.</p>
+
+<h3><a name='CmdGetMemory'>Get Memory</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • &lt;token&gt; • Memory • get •
+ <i>&lt;string: context ID&gt;</i> • <i>&lt;int: address&gt;</i> • <i>&lt;int: word size&gt;</i> •
+ <i>&lt;int: byte count&gt;</i> • <i>&lt;int: mode&gt;</i> •
+</font></b></pre>
+
+<p>Reads data bytes at given address in memory, "word size" bytes at a time. Address
+should be aligned by "word size". Context ID must be one returned by getContexts.
+Mode is logical OR of any combination of:</p>
+
+<ul type='disc'>
+ <li>0x1 – continue on error (like bus error or page fault)
+
+ <li>0x2 – verify data after reading by re-reading and compare
+</ul>
+
+<p>Result message:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;string: BASE64 encoded byte array&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;array of error addresses&gt;</i> •
+</font></b></pre>
+
+<p>Error report provides integer error code and a short, human readable explanation
+of error. Error addresses, when present, let client know which bytes of data failed
+to be retrieved from memory.</p>
+
+<h3><a name='CmdFillMemory'>Fill Memory</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • &lt;token&gt; • Memory • fill •
+ <i>&lt;string: context ID&gt;</i> • <i>&lt;int: address&gt;</i> • <i>&lt;int: word size&gt;</i> •
+ &lt;int: byte count&gt; • <i>&lt;int: mode&gt;</i> • <i>&lt;array: array of pattern bytes&gt;</i> •
+</font></b></pre>
+
+<p>Writes pattern bytes at given address in memory, "word size" bytes at a time. Address
+should be aligned by "word size". If "byte count" is bigger then pattern size, then
+pattern is repeated necessary number of times. Context ID must be one returned by
+getContexts. Mode is logical OR of any combination of:</p>
+
+<ul type='disc'>
+ <li>0x1 – continue on error (like bus error or page fault)
+
+ <li>0x2 – verify data after writing by reading back and compare
+</ul>
+
+<p>Result message:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;array of error addresses&gt;</i> •
+</font></b></pre>
+
+<p>Error report provides integer error code and a short, human readable explanation
+of error. Error addresses, when present, let client know which bytes of data failed
+to be written into memory.</p>
+
+<h2><a name='Events'>Events</a></h2>
+
+<p>Memory service broadcasts notification events when memory contexts are added, removed
+or changed, and when memory content is altered by "set" or "fill" commands.</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+E • Memory • contextAdded • <i>&lt;array of context data&gt;</i> •
+E • Memory • contextChanged • <i>&lt;array of context data&gt;</i> •
+E • Memory • contextRemoved • <i>&lt;array of context IDs&gt;</i> •
+E • Memory • memoryChanged • <i>&lt;string: context ID&gt;</i> • <i>&lt;array of address ranges&gt;</i> •
+
+<i>&lt;array of context data&gt;</i> <font face="Times New Roman" size=3>- see Get Contexts command.</font>
+
+<i>&lt;array of context IDs&gt;</i>
+ <font face=Wingdings>Ψ</font> [ <i>&lt;context ID list&gt;</i> ]
+
+<i>&lt;context ID list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;string: context ID&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;context ID list&gt;</i> , <i>&lt;string: context ID&gt;</i>
+
+<i>&lt;array of address ranges&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ <i>&lt;address ranges list&gt;</i> ]
+
+<i>&lt;address ranges list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;address range&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;address ranges list&gt;</i> , <i>&lt;address range&gt;</i>
+
+<i>&lt;address range&gt;</i>
+ <font face=Wingdings>Ψ</font> { "addr" : <i>&lt;int: range starting address&gt;</i> , "size" : <i>&lt;int: range length in bytes&gt;</i> }
+</font></b></pre>
+
+<h2><a name='API'>API</a></h2>
+
+<pre>
+<font color=#3F5FBF>/**
+ * IMemory service provides basic operations to read/write memory on a target.
+ */</font>
+<font color=#7F0055>public interface</font> Memory <font color=#7F0055>extends</font> Service {
+
+ <font color=#7F0055>static final</font> String NAME = "Memory";
+
+ <font color=#3F5FBF>/**
+ * Retrieve context info for given context ID.
+ *
+ * <font color=#7F9FBF>@param</font> id – context ID.
+ * <font color=#7F9FBF>@param</font> done - callback interface called when operation is completed.
+     */</font>
+ IToken getContext(String id, DoneGetContext done);
+
+ <font color=#3F5FBF>/**
+ * Client callback interface for getContext().
+     */</font>
+ <font color=#7F0055>interface</font> DoneGetContext {
+ <font color=#3F5FBF>/**
+ * Called when contexts data retrieval is done.
+ * <font color=#7F9FBF>@param</font> error – error description if operation failed, null if succeeded.
+ * <font color=#7F9FBF>@param</font> context – context data.
+ */</font>
+ <font color=#7F0055>void</font> doneGetContext(IToken token, Exception error, MemoryContext context);
+ }
+
+ <font color=#3F5FBF>/**
+ * Retrieve contexts available for memory commands.
+ * A context corresponds to an execution thread, process, address space, etc.
+ * A context can belong to a parent context. Contexts hierarchy can be simple
+ * plain list or it can form a tree. It is up to target agent developers to choose
+ * layout that is most descriptive for a given target. Context IDs are valid across
+ * all services. In other words, all services access same hierarchy of contexts,
+ * with same IDs, however, each service accesses its own subset of context's
+ * attributes and functionality, which is relevant to that service.
+ *
+ * <font color=#7F9FBF>@param</font> parent_context_id – parent context ID. Can be null –
+ * to retrieve top level of the hierarchy, or one of context IDs retrieved
+ * by previous getContexts commands.
+ * <font color=#7F9FBF>@param</font> done - callback interface called when operation is completed.
+ */</font>
+ IToken getChildren(String parent_context_id, DoneGetChildren done);
+
+ <font color=#3F5FBF>/**
+ * Client callback interface for getChildren().
+ */</font>
+ <font color=#7F0055>interface</font> DoneGetChildren {
+ <font color=#3F5FBF>/**
+ * Called when contexts data retrieval is done.
+         * <font color=#7F9FBF>@param</font> error – error description if operation failed, null if succeeded.
+         * <font color=#7F9FBF>@param</font> contexts – array of available context IDs.
+ */</font>
+ <font color=#7F0055>void</font> doneGetChildren(IToken token, Exception error, String[] context_ids);
+ }
+
+    <font color=#3F5FBF>/**
+     * Memory access mode:
+     * Carry on when some of the memory cannot be accessed and
+     * return MemoryError at the end if any of the bytes
+     * were not processed correctly.
+     */</font>
+    <font color=#7F0055>final static int</font> MODE_CONTINUEONERROR = 0x1;
+
+    <font color=#3F5FBF>/**
+     * Memory access mode:
+     * Verify result of memory operations (by reading and comparing).
+     */</font>
+    <font color=#7F0055>final static int</font> MODE_VERIFY = 0x2;
+
+    <font color=#7F0055>interface</font> MemoryContext {
+
+        <font color=#3F5FBF>/**
+         * Retrieve context ID.
+         * Same as getProperties().get("id")
+         */</font>
+        String getID();
+
+        <font color=#3F5FBF>/**
+         * Return true if the context has children.
+         * Same as getProperties().get("has_children")
+         * Children can be retrieved by getContexts call.
+         */</font>
+        <font color=#7F0055>boolean</font> hasChildren();
+
+        <font color=#3F5FBF>/**
+         * Retrieve context properties.
+         */</font>
+        Map&lt;String,Object&gt; getProperties();
+
+        <font color=#3F5FBF>/**
+         * Set target memory.
+         * If 'word_size' is 0 it means client does not care about word size.
+         */</font>
+        <font color=#7F0055>void</font> set(long addr, <font color=#7F0055>int</font> word_size, byte[] buf,
+                         <font color=#7F0055>int</font> offs, <font color=#7F0055>int</font> size, <font color=#7F0055>int</font> mode, DoneMemory done);
+
+        <font color=#3F5FBF>/**
+         * Read target memory.
+         */</font>
+        <font color=#7F0055>void</font> get(long addr, <font color=#7F0055>int</font> word_size, byte[] buf,
+                         <font color=#7F0055>int</font> offs, <font color=#7F0055>int</font> size, <font color=#7F0055>int</font> mode, DoneMemory done);
+
+        <font color=#3F5FBF>/**
+         * Fill target memory with given pattern.
+         * 'size' is number of bytes to fill.
+         */</font>
+        <font color=#7F0055>void</font> fill(long addr, <font color=#7F0055>int</font> word_size, byte[] value,
+                          <font color=#7F0055>int</font> size, <font color=#7F0055>int</font> mode, DoneMemory done);
+   
+        <font color=#3F5FBF>/**
+         * Client callback interface for set(), get() and fill().
+         */</font>
+        <font color=#7F0055>interface</font> DoneMemory {
+            <font color=#7F0055>void</font> doneMemory(MemoryError error);
+        }
+    }
+
+    <font color=#7F0055>class</font> MemoryError <font color=#7F0055>extends</font> Exception {
+    }
+
+    <font color=#3F5FBF>/**
+     * ErrorOffset interface can be implemented by MemoryError object,
+     * which is returned by get, set and fill commands.
+     *
+  * get/set/fill () returns this exception when reading failed
+   * for some but not all bytes, and MODE_CONTINUEONERROR
+     * has been set in mode. (For example, when only part of the request
+     * translates to valid memory addresses.)
+     * Exception.getMessage can be used for generalized message of the
+     * possible reasons of partial memory operation.
+     */</font>
+    <font color=#7F0055>interface</font> ErrorOffset {
+       
+        // Error may have per byte information
+        <font color=#7F0055>final static int</font>
+            BYTE_VALID        = 0x00,
+            BYTE_UNKNOWN      = 0x01, // e.g. out of range
+            BYTE_INVALID      = 0x02,
+            BYTE_CANNOT_READ  = 0x04,
+            BYTE_CANNOT_WRITE = 0x08;
+
+        <font color=#7F0055>int</font> getStatus(<font color=#7F0055>int</font> offset);
+
+        <font color=#3F5FBF>/**
+         * Returns the detail message string about the
+         * byte associated with specified location.
+         * <font color=#7F9FBF>@return</font>  the detail error message string.
+         */</font>
+        String getMessage(<font color=#7F0055>int</font> offset);
+       
+    }
+
+    <font color=#7F0055>void</font> addListener(MemoryListener listener);
+
+    <font color=#7F0055>interface</font> MemoryListener {
+
+        <font color=#3F5FBF>/**
+         * Called when a new memory access context(s) is created.
+         */</font>
+        <font color=#7F0055>void</font> contextAdded(Context[] contexts);
+
+        <font color=#3F5FBF>/**
+         * Called when a new memory access context(s) properties changed.
+         */</font>
+        <font color=#7F0055>void</font> contextChanged(Context[] contexts);
+
+        <font color=#3F5FBF>/**
+         * Called when memory access context(s) is removed.
+         */</font>
+        <font color=#7F0055>void</font> contextRemoved(String[] context_ids);
+
+        <font color=#3F5FBF>/**
+         * Called when target memory content was changed and clients
+         * need to update themselves. Clients, at least, should invalidate
+         * corresponding cached memory data.
+         * Not every change is notified - it is not possible,
+         * only those, which are not caused by normal execution of the debuggee.
+         * ‘addr’ and ‘size’ can be null if unknown.
+         */</font>
+        <font color=#7F0055>void</font> memoryChanged(String context_id,
+               long[] addr, long[] size);
+    }
+}
+</pre>
+
+</body>
+</html>
diff --git a/docs/TCF Service - Processes.html b/docs/TCF Service - Processes.html
new file mode 100644
index 000000000..dbb3f0309
--- /dev/null
+++ b/docs/TCF Service - Processes.html
@@ -0,0 +1,381 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <title>Target Communication Framework Services - Processes</title>
+</head>
+
+<body lang='EN-US'>
+
+<h1>Target Communication Framework Services - Processes</h1>
+
+<ul>
+ <li><a href='#Cmds'>Commands</a>
+ <ul>
+ <li><a href='#CmdGetContext'>Get Context</a>
+ <li><a href='#CmdGetChildren'>Get Children</a>
+ <li><a href='#CmdAttach'>Attach</a>
+ <li><a href='#CmdDetach'>Detach</a>
+ <li><a href='#CmdTerminate'>Terminate</a>
+ <li><a href='#CmdSignal'>Signal</a>
+ <li><a href='#CmdStart'>Start</a>
+ </ul>
+ <li><a href='#Events'>Events</a>
+ <li><a href='#API'>API</a>
+</ul>
+
+<h1>Processes Service</h1>
+
+<p>Processes service provides access to the target OS's process
+information, allows to start and terminate a process, and allows
+to attach and detach a process for debugging. Debug services,
+like Memory and Run Control, require a process to be attached
+before they can access it.</p>
+
+<p>Command and event parameters are encoded
+as zero terminated <a href='TCF Specification.html#JSON'>JSON</a> strings.</p>
+
+<p>The service uses standard format for error reports,
+see <a href='TCF Services.html#ErrorFormat'>Error Report Format</a>.</p>
+
+<h2><a name='Cmds'>Commands</a></h2>
+
+<h3><a name='CmdGetContext'>Get Context</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Processes • getContext • <i>&lt;string: context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command retrieves context info for given context ID.
+A context corresponds to an execution thread, process, address space, etc.
+Context IDs are valid across TCF services, so it is allowed to issue 'Processes.getContext'
+command with a context that was obtained, for example, from Memory service.
+However, 'Processes.getContext' is supposed to return only process specific data.
+If the ID is not a process ID, 'Processes.getContext' may not return any
+useful information.
+</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;context data&gt;</i> •
+
+<i>&lt;context data&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> <i>&lt;object&gt;</i>
+</font></b></pre>
+
+<p>Context data object should, at least, contain member
+<b><font face="Courier New" size=2 color=#333399>"ID" : <i>&lt;string&gt;.</i></font></b>
+</p>
+
+<p>Predefined process context properties are:</p>
+<ul>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ID" : <i>&lt;string&gt;</i></font></b></code>
+ - ID of the context, same as getContext command argument.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ParentID" : <i>&lt;string&gt;</i></font></b></code>
+ - parent context ID.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Name" : <i>&lt;string&gt;</i></font></b></code>
+ - process name. Client UI can show this name to a user.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Attached" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if the context is attached to debugger.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"CanTerminate" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if the service can terminate the process.
+</ul>
+
+<h3><a name='CmdGetChildren'>Get Children</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Processes • getChildren • <i>&lt;string: parent context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command requests a list of contexts available for process control commands.</p>
+
+<p>Parent context ID can be null – to retrieve top level of the hierarchy, can be one
+of context IDs retrieved by previous getChildren commands, or it can be obtained from another service.
+Contexts hierarchy can be simple plain list or it can form a tree. It is up to target agent developers to
+choose layout that is most descriptive for a given target.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;array of context IDs&gt;</i> •
+
+<i>&lt;array of context IDs&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ ]
+ <font face=Wingdings>Ψ</font> [ <i>&lt;context ID list&gt;</i> ]
+
+<i>&lt;context ID list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;string: context ID&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;context ID list&gt;</i> , <i>&lt;string: context ID&gt;</i>
+</font></b></pre>
+
+<h3><a name='CmdAttach'>Attach</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Processes • attach • <i>&lt;string: context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command attaches debugger to a process.
+Services like Run Control, Memory, Breakpoints work only with attached processes.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdDetach'>Detach</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Processes • detach • <i>&lt;string: context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command detaches debugger from a process.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdTerminate'>Terminate</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Processes • terminate • <i>&lt;string: context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command terminates a process.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdSignal'>Signal</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Processes • signal • <i>&lt;string: context ID&gt;</i> • <i>&lt;int: signal&gt;</i> •
+</font></b></pre>
+
+<p>The command sends a signal to a process.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdStart'>Start</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Processes • start • <i>&lt;string: working directory&gt;</i> • <i>&lt;string: program image file&gt;</i> •
+ <i>&lt;string array: command line&gt;</i> • <i>&lt;string array: environment variables&gt;</i> • <i>&lt;boolean: attach&gt;</i> •
+
+<i>&lt;string array&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ ]
+ <font face=Wingdings>Ψ</font> [ <i>&lt;string list&gt;</i> ]
+
+<i>&lt;string list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;string&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;string list&gt;</i> , <i>&lt;string&gt;</i>
+</font></b></pre>
+
+<p>The command starts a new process on remote machine.
+<i>&lt;string: working directory&gt;</i> - initial value of working directory for the process.
+<i>&lt;string: program image file&gt;</i> - image file to start process with.
+<i>&lt;string array: command line&gt;</i> - command line arguments for the process.
+<i>&lt;string array: environment variables&gt;</i> - list of environment variables for the process,
+they will be added to default process environment.
+<i>&lt;boolean: attach&gt;</i> - if true debugger should be attached to the process.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;context data&gt;</i> •
+</font></b></pre>
+
+<p>On success the command returns context data for created process. Context data has same format as Get Context result.</p>
+
+<h2><a name='Events'>Events</a></h2>
+
+<p>No events are currently defined for Processes service.</p>
+
+<h2><a name='API'>API</a></h2>
+
+<pre>
+<font color=#7F0055>public interface</font> IProcesses <font color=#7F0055>extends</font> IService {
+
+ <font color=#7F0055>static final</font> String NAME = "Processes";
+
+ <font color=#3F5FBF>/**
+ * Retrieve context info for given context ID.
+ * A context corresponds to an execution thread, process, address space, etc.
+ * Context IDs are valid across TCF services, so it is allowed to issue
+ * 'IProcesses.getContext' command with a context that was obtained,
+ * for example, from Memory service.
+ * However, 'Processes.getContext' is supposed to return only process specific data,
+ * If the ID is not a process ID, 'IProcesses.getContext' may not return any
+ * useful information
+ *
+ * <font color=#7F9FBF><font color=#7F9FBF>@param</font></font> id – context ID.
+ * <font color=#7F9FBF><font color=#7F9FBF>@param</font></font> done - call back interface called when operation is completed.
+ */</font>
+ IToken getContext(String id, DoneGetContext done);
+
+ <font color=#3F5FBF>/**
+ * Client call back interface for getContext().
+ */</font>
+ <font color=#7F0055>interface</font> DoneGetContext {
+ <font color=#3F5FBF>/**
+ * Called when contexts data retrieval is done.
+ * <font color=#7F9FBF>@param</font> error – error description if operation failed, null if succeeded.
+ * <font color=#7F9FBF>@param</font> context – context data.
+ */</font>
+ <font color=#7F0055>void</font> doneGetContext(IToken token, Exception error, ProcessContext context);
+ }
+
+ <font color=#3F5FBF>/**
+ * Retrieve children of given context.
+ *
+ * <font color=#7F9FBF>@param</font> parent_context_id – parent context ID. Can be null –
+ * to retrieve top level of the hierarchy, or one of context IDs retrieved
+ * by previous getContext or getChildren commands.
+ * <font color=#7F9FBF>@param</font> done - call back interface called when operation is completed.
+ */</font>
+ IToken getChildren(String parent_context_id, <font color=#7F0055>boolean</font> attached_only, DoneGetChildren done);
+
+ <font color=#3F5FBF>/**
+ * Client call back interface for getChildren().
+ */</font>
+ <font color=#7F0055>interface</font> DoneGetChildren {
+ <font color=#3F5FBF>/**
+ * Called when contexts data retrieval is done.
+ * <font color=#7F9FBF>@param</font> error – error description if operation failed, null if succeeded.
+ * <font color=#7F9FBF>@param</font> context_ids – array of available context IDs.
+ */</font>
+ <font color=#7F0055>void</font> doneGetChildren(IToken token, Exception error, String[] context_ids);
+ }
+
+ <font color=#3F5FBF>/**
+ * Context property names.
+ */</font>
+ <font color=#7F0055>static final</font> String
+ <font color=#3F5FBF>/** The TCF context ID */</font>
+ PROP_ID = "ID",
+
+ <font color=#3F5FBF>/** The TCF parent context ID */</font>
+ PROP_PARENTID = "ParentID",
+
+ <font color=#3F5FBF>/** Is the context attached */</font>
+ PROP_ATTACHED = "Attached",
+
+ <font color=#3F5FBF>/** Can terminate the context */</font>
+ PROP_CAN_TERMINATE = "CanTerminate",
+
+ <font color=#3F5FBF>/** Process name. Client UI can show this name to a user */</font>
+ PROP_NAME = "Name";
+
+ <font color=#7F0055>interface</font> ProcessContext {
+
+ <font color=#3F5FBF>/**
+ * Get context ID.
+ * Same as getProperties().get(“ID”)
+ */</font>
+ String getID();
+
+ <font color=#3F5FBF>/**
+ * Get parent context ID.
+ * Same as getProperties().get(“ParentID”)
+ */</font>
+ String getParentID();
+
+ <font color=#3F5FBF>/**
+ * Get process name.
+ * Client UI can show this name to a user.
+ * Same as getProperties().get(“Name”)
+ */</font>
+ String getName();
+
+ <font color=#3F5FBF>/**
+ * Utility method to read context property PROP_ATTACHED.
+ * Services like IRunControl, IMemory, IBreakpoints work only with attached processes.
+ * <font color=#7F9FBF><font color=#7F9FBF>@return</font></font> value of PROP_ATTACHED.
+ */</font>
+ <font color=#7F0055>boolean</font> isAttached();
+
+ <font color=#3F5FBF>/**
+ * Utility method to read context property PROP_CAN_TERMINATE.
+ * <font color=#7F9FBF><font color=#7F9FBF>@return</font></font> value of PROP_CAN_TERMINATE.
+ */</font>
+ <font color=#7F0055>boolean</font> canTerminate();
+
+ <font color=#3F5FBF>/**
+ * Get all available context properties.
+ * <font color=#7F9FBF>@return</font> Map 'property name' -> 'property value'
+ */</font>
+ Map&lt;String, Object&gt; getProperties();
+
+ <font color=#3F5FBF>/**
+ * Attach debugger to a process.
+ * Services like IRunControl, IMemory, IBreakpoints work only with attached processes.
+ * <font color=#7F9FBF>@param</font> done - call back interface called when operation is completed.
+ * <font color=#7F9FBF>@return</font> pending command handle, can be used to cancel the command.
+ */</font>
+ IToken attach(DoneCommand done);
+
+ <font color=#3F5FBF>/**
+ * Detach debugger from a process.
+ * Process execution will continue without debugger supervision.
+ * <font color=#7F9FBF>@param</font> done - call back interface called when operation is completed.
+ * <font color=#7F9FBF>@return</font> pending command handle, can be used to cancel the command.
+ */</font>
+ IToken detach(DoneCommand done);
+
+ <font color=#3F5FBF>/**
+ * Terminate a process.
+ * <font color=#7F9FBF>@param</font> done - call back interface called when operation is completed.
+ * <font color=#7F9FBF>@return</font> pending command handle, can be used to cancel the command.
+ */</font>
+ IToken terminate(DoneCommand done);
+
+ <font color=#3F5FBF>/**
+ * Send a signal to a process.
+ * <font color=#7F9FBF>@param</font> signal - signal ID.
+ * <font color=#7F9FBF>@param</font> done - call back interface called when operation is completed.
+ * <font color=#7F9FBF>@return</font> pending command handle, can be used to cancel the command.
+ */</font>
+ IToken signal(<font color=#7F0055>int</font> signal, DoneCommand done);
+ }
+
+ <font color=#7F0055>interface</font> DoneCommand {
+ <font color=#7F0055>void</font> doneCommand(IToken token, Exception error);
+ }
+
+ <font color=#3F5FBF>/**
+ * Start a new process on remote machine.
+ * <font color=#7F9FBF>@param</font> directory - initial value of working directory for the process.
+ * <font color=#7F9FBF>@param</font> file - process image file.
+ * <font color=#7F9FBF>@param</font> command_line - command line arguments for the process.
+ * <font color=#7F9FBF>@param</font> environment - list of environment variables for the process.
+ * <font color=#7F9FBF>@param</font> attach - if true debugger should be attached to the process.
+ * <font color=#7F9FBF>@param</font> done - call back interface called when operation is completed.
+ * <font color=#7F9FBF>@return</font> pending command handle, can be used to cancel the command.
+ */</font>
+ IToken start(String directory, String file,
+ String[] command_line, String[] environment, <font color=#7F0055>boolean</font> attach, DoneStart done);
+
+ <font color=#7F0055>interface</font> DoneStart {
+ <font color=#7F0055>void</font> doneStart(IToken token, Exception error, ProcessContext process);
+ }
+}
+</pre>
+
+</body>
+</html>
diff --git a/docs/TCF Service - Registers.html b/docs/TCF Service - Registers.html
new file mode 100644
index 000000000..ef346af69
--- /dev/null
+++ b/docs/TCF Service - Registers.html
@@ -0,0 +1,506 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <title>Target Communication Framework Services - Registers</title>
+</head>
+
+<body lang='EN-US'>
+
+<h1>Target Communication Framework Services - Registers</h1>
+
+<ul>
+ <li><a href='#Cmds'>Commands</a>
+ <ul>
+ <li><a href='#CmdGetContext'>Get Context</a>
+ <li><a href='#CmdGetChildren'>Get Children</a>
+ <li><a href='#CmdSetRegister'>Set Register</a>
+ <li><a href='#CmdGetRegister'>Get Register</a>
+ </ul>
+ <li><a href='#Events'>Events</a>
+ <li><a href='#API'>API</a>
+</ul>
+
+<h1>Registers Service</h1>
+
+<p>The service provides basic operations to read/write CPU and hardware registers. Command
+and event parameters are encoded as zero terminated <a href='TCF Specification.html#JSON'>JSON</a> strings.</p>
+
+<p>The service uses standard format for error reports,
+see <a href='TCF Services.html#ErrorFormat'>Error Report Format</a>.</p>
+
+<h2><a name='Cmds'>Commands</a></h2>
+
+<h3><a name='CmdGetContext'>Get Context</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Registers • getContext • <i>&lt;string: context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command retrieves context info for given context ID. A context corresponds to an
+register, register group, register bit field, etc. Exact meaning of a context depends on the target.
+Target agent should define contexts hierarchy that is:</p>
+
+<ul type='disc'>
+ <li>Adequately reflects target hardware registers layout;
+ <li>Consistent with the lingo/terminology of the processor manuals;
+ <li>Intuitive to a user.
+</ul>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;context data&gt;</i> •
+
+<i>&lt;context data&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> <i>&lt;object&gt;</i>
+</font></b></pre>
+
+<p>Context data object should, at least, contain member
+<b><font face="Courier New" size=2 color=#333399>"ID" : <i>&lt;string&gt;.</i></font></b>
+Context data is expected to be cached by clients.
+Service sends contextChanged event to notify changes in context data.</p>
+
+<p>Predefined register context properties are:</p>
+<ul>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ID" : <i>&lt;string&gt;</i></font></b></code>
+ - ID of the context, same as getContext command argument.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ParentID" : <i>&lt;string&gt;</i></font></b></code>
+ - ID of a parent context.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ProcessID" : <i>&lt;string&gt;</i></font></b></code>
+ - process ID.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Name" : <i>&lt;string&gt;</i></font></b></code>
+ - context name.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Description" : <i>&lt;string&gt;</i></font></b></code>
+ - context description.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Formats" : <i>&lt;array of string&gt;</i></font></b></code>
+ - value formats available for register get/set commands.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Readable" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if context value can be read.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ReadOnce" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if reading the context (register) destroys its current value - it can be read only once.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Writeable" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if context value can be written.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"WriteOnce" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if register value can not be overwritten - every write counts.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"SideEffects" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if writing the context can change values of other registers.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Volatile" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if the register value can change even when target is stopped.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Float" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if the register value is a floating-point value.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"BigEndian" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if big endian, which means decreasing numeric significance with increasing bit number.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"LeftToRight" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if the lowest numbered bit (i.e. bit #0 or bit #1, depending on "FirstBit" value) should be shown to user as the left-most bit.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"FirstBit" : <i>&lt;int&gt;</i></font></b></code>
+ - 0 or 1. If the context has bit field children, bit positions of the fields can be zero-based or 1-based.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Bits" : <i>&lt;array of int&gt;</i></font></b></code>
+ - if context is a bit field, contains the field bit numbers in the parent context.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Values" : <i>&lt;array of named values&gt;</i></font></b></code>
+ - predefined names (mnemonics) for some of context values.
+
+</ul>
+
+<h3><a name='CmdGetChildren'>Get Children</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Registers • getChildren • <i>&lt;string: parent context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command requests a list of contexts available for registers access commands.</p>
+
+<p>Parent context ID is usually a thread ID retrieved through Run Control Service or one
+of context IDs retrieved by previous getChildren commands.
+Contexts hierarchy can be simple plain list of registers, or it can form a tree of register groups, registers and bit fields.
+It is up to target agent developers to choose layout that is most descriptive for a given target.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;array of context IDs&gt;</i> •<i></i>
+
+<i>&lt;array of context IDs&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ ]
+ <font face=Wingdings>Ψ</font> [ <i>&lt;context ID list&gt;</i> ]
+
+<i>&lt;context ID list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;string: context ID&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;context ID list&gt;</i> , <i>&lt;string: context ID&gt;</i>
+
+</font></b></pre>
+
+<h3><a name='CmdSetRegister'>Set Register</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • &lt;token&gt; • Registers • set • <i>&lt;string: context ID&gt;</i> • <i>&lt;string: value format&gt;</i> • <i>&lt;string: value&gt;</i> •
+</font></b></pre>
+
+<p>Writes value into given register context. Context ID must be one returned by getContexts.
+Value format must be one that is supported by the register context.
+Client can get list of supported formats from context attributes.</p>
+
+<p>Result message:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<p>Error report provides integer error code and a short, human readable explanation
+of error.</p>
+
+<h3><a name='CmdGetRegister'>Get Register</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • &lt;token&gt; • Registers • get • <i>&lt;string: context ID&gt;</i> • <i>&lt;string: value format&gt;</i> •
+</font></b></pre>
+
+<p>Reads register value from given register context. Context ID must be one returned by getContexts.
+Value format must be one that is supported by the register context.
+Client can get list of supported formats from context attributes.</p>
+
+<p>Result message:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;string: value&gt;</i> •
+</font></b></pre>
+
+<p>Error report provides integer error code and a short, human readable explanation
+of error. Value is formatted according to requested format.</p>
+
+<h2><a name='Events'>Events</a></h2>
+
+<p>Registers service broadcasts notification events when registers contexts are changed, and when
+a register content is altered by "set" commands.</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+E • Registers • contextChanged •
+E • Registers • registerChanged • <i>&lt;string: context ID&gt;</i> •
+</font></b></pre>
+
+<h2><a name='API'>API</a></h2>
+
+<pre>
+<font color=#3F5FBF>/**
+ * IRegisters service provides access to target CPU register values and properties.
+ */</font>
+<font color=#7F0055>public interface</font> IRegisters <font color=#7F0055>extends</font> IService {
+
+ <font color=#7F0055>static final</font> String NAME = "Registers";
+
+ <font color=#3F5FBF>/**
+ * Context property names.
+ */</font>
+ <font color=#7F0055>static final</font> String
+ PROP_ID = "ID",
+ PROP_PARENT_ID = "ParentID",
+ PROP_PROCESS_ID = "ProcessID",
+ PROP_NAME = "Name",
+ PROP_DESCRIPTION = "Description",
+ PROP_FORMATS = "Formats",
+ PROP_READBLE = "Readable",
+ PROP_READ_ONCE = "ReadOnce",
+ PROP_WRITEABLE = "Writeable",
+ PROP_WRITE_ONCE = "WriteOnce",
+ PROP_SIDE_EFFECTS = "SideEffects",
+ PROP_VOLATILE = "Volatile",
+ PROP_FLOAT = "Float",
+ PROP_BIG_ENDIAN = "BigEndian",
+ PROP_LEFT_TO_RIGHT = "LeftToRight",
+ PROP_FIST_BIT = "FirstBit",
+ PROP_BITS = "Bits",
+ PROP_VALUES = "Values";
+
+ <font color=#3F5FBF>/**
+ * Standard known formats for register data.
+ */</font>
+ <font color=#7F0055>static final</font> String
+ FORMAT_BINARY = "Binary",
+ FORMAT_OCTAL = "Octal",
+ FORMAT_DECIMAL = "Decimal",
+ FORMAT_HEX = "Hex",
+ FORMAT_NATURAL = "Natural";
+
+ <font color=#3F5FBF>/**
+ * Retrieve context info for given context ID.
+ *
+ * <font color=#7F9FBF>@param</font> id – context ID.
+ * <font color=#7F9FBF>@param</font> done - call back interface called when operation is completed.
+ */</font>
+ IToken getContext(String id, DoneGetContext done);
+
+ <font color=#3F5FBF>/**
+ * Client call back interface for getContext().
+ */</font>
+ <font color=#7F0055>interface</font> DoneGetContext {
+ <font color=#3F5FBF>/**
+ * Called when contexts data retrieval is done.
+ * <font color=#7F9FBF>@param</font> error – error description if operation failed, null if succeeded.
+ * <font color=#7F9FBF>@param</font> context – context data.
+ */</font>
+ <font color=#7F0055>void</font> doneGetContext(IToken token, Exception error, RegistersContext context);
+ }
+
+ <font color=#3F5FBF>/**
+ * Retrieve contexts available for registers commands.
+ * A context corresponds to an execution thread, stack frame, registers group, etc.
+ * A context can belong to a parent context. Contexts hierarchy can be simple
+ * plain list or it can form a tree. It is up to target agent developers to choose
+ * layout that is most descriptive for a given target. Context IDs are valid across
+ * all services. In other words, all services access same hierarchy of contexts,
+ * with same IDs, however, each service accesses its own subset of context's
+ * attributes and functionality, which is relevant to that service.
+ *
+ * <font color=#7F9FBF>@param</font> parent_context_id – parent context ID. Can be null –
+ * to retrieve top level of the hierarchy, or one of context IDs retrieved
+ * by previous getChildren commands.
+ * <font color=#7F9FBF>@param</font> done - call back interface called when operation is completed.
+ */</font>
+ IToken getChildren(String parent_context_id, DoneGetChildren done);
+
+ <font color=#3F5FBF>/**
+ * Client call back interface for getChildren().
+ */</font>
+ <font color=#7F0055>interface</font> DoneGetChildren {
+ <font color=#3F5FBF>/**
+ * Called when contexts data retrieval is done.
+ * <font color=#7F9FBF>@param</font> error – error description if operation failed, null if succeeded.
+ * <font color=#7F9FBF>@param</font> context_ids – array of available context IDs.
+ */</font>
+ <font color=#7F0055>void</font> doneGetChildren(IToken token, Exception error, String[] context_ids);
+ }
+
+ <font color=#3F5FBF>/**
+ * RegistersContext objects represent register groups, registers and bit fields.
+ */</font>
+ <font color=#7F0055>interface</font> RegistersContext {
+ <font color=#3F5FBF>/**
+ * Get Context ID.
+ * <font color=#7F9FBF>@return</font> context ID.
+ */</font>
+ String getID();
+
+ <font color=#3F5FBF>/**
+ * Get parent context ID.
+ * <font color=#7F9FBF>@return</font> parent context ID.
+ */</font>
+ String getParentID();
+
+ <font color=#3F5FBF>/**
+ * Get context (register, register group, bit field) name.
+ * <font color=#7F9FBF>@return</font> context name.
+ */</font>
+ String getName();
+
+ <font color=#3F5FBF>/**
+ * Get context description.
+ * <font color=#7F9FBF>@return</font> context description.
+ */</font>
+ String getDescription();
+
+ <font color=#3F5FBF>/**
+ * Get value formats available for register get/set commands.
+ * See FORMAT_* for knows format IDs definition.
+ * <font color=#7F9FBF>@return</font> array of supported format IDs.
+ */</font>
+ String[] getAvailableFormats();
+
+ <font color=#3F5FBF>/**
+ * Check if context value can be read.
+ * <font color=#7F9FBF>@return</font> true if can read value of the context.
+ */</font>
+ <font color=#7F0055>boolean</font> isReadable();
+
+ <font color=#3F5FBF>/**
+ * Check if reading the context (register) destroys its current value -
+ * it can be read only once.
+ * <font color=#7F9FBF>@return</font> true if read-once register.
+ */</font>
+ <font color=#7F0055>boolean</font> isReadOnce();
+
+ <font color=#3F5FBF>/**
+ * Check if context value can be written.
+ * <font color=#7F9FBF>@return</font> true if can write value of the context.
+ */</font>
+ <font color=#7F0055>boolean</font> isWriteable();
+
+ <font color=#3F5FBF>/**
+ * Check if register value can not be overwritten - every write counts.
+ * <font color=#7F9FBF>@return</font> true if write-once register.
+ */</font>
+ <font color=#7F0055>boolean</font> isWriteOnce();
+
+ <font color=#3F5FBF>/**
+ * Check if writing the context can change values of other registers.
+ * <font color=#7F9FBF>@return</font> true if has side effects.
+ */</font>
+ <font color=#7F0055>boolean</font> hasSideEffects();
+
+ <font color=#3F5FBF>/**
+ * Check if the register value can change even when target is stopped.
+ * <font color=#7F9FBF>@return</font> true if the register value can change at any time.
+ */</font>
+ <font color=#7F0055>boolean</font> isVolatile();
+
+ <font color=#3F5FBF>/**
+ * Check if the register value is a floating-point value.
+ * <font color=#7F9FBF>@return</font> true if a floating-point register.
+ */</font>
+ <font color=#7F0055>boolean</font> isFloat();
+
+ <font color=#3F5FBF>/**
+ * Check endianess of the context.
+ * Big endian means decreasing numeric significance with increasing bit number.
+ * <font color=#7F9FBF>@return</font> true if big endian.
+ */</font>
+ <font color=#7F0055>boolean</font> isBigEndian();
+
+ <font color=#3F5FBF>/**
+ * Check if the lowest numbered bit (i.e. bit #0 or bit #1 depending on
+ * getFirstBitNumber() value) should be shown to user as the left-most bit or
+ * the right-most bit.
+ * <font color=#7F9FBF>@return</font> true if the first bit is left-most bit.
+ */</font>
+ <font color=#7F0055>boolean</font> isLeftToRight();
+
+ <font color=#3F5FBF>/**
+ * If the context has bit field children, bit positions of the fields
+ * can be zero-based or 1-based.
+ * <font color=#7F9FBF>@return</font> first bit position - 0 or 1.
+ */</font>
+ <font color=#7F0055>int</font> getFirstBitNumber();
+
+ <font color=#3F5FBF>/**
+ * If context is a bit field, get the field bit numbers in parent context.
+ * <font color=#7F9FBF>@return</font> array of bit numbers.
+ */</font>
+ <font color=#7F0055>int</font>[] getBitNumbers();
+
+ <font color=#3F5FBF>/**
+ * A context can have predefined names (mnemonics) for some its values.
+ * This method returns a list of such named values.
+ * <font color=#7F9FBF>@return</font> array of named values or null.
+ */</font>
+ NamedValue[] getNamedValues();
+
+ <font color=#3F5FBF>/**
+ * Get complete map of context properties.
+ * <font color=#7F9FBF>@return</font> map of context properties.
+ */</font>
+ Map&lt;String,Object&gt; getProperties();
+
+ <font color=#3F5FBF>/**
+ * Read value of the context.
+ * <font color=#7F9FBF>@param</font> format - ID of a format to use for result value.
+ * <font color=#7F9FBF>@param</font> done - call back object.
+ * <font color=#7F9FBF>@return</font> - pending command handle.
+ */</font>
+ IToken get(String format, DoneGet done);
+
+ <font color=#3F5FBF>/**
+ * Set value of the context.
+ * <font color=#7F9FBF>@param</font> format - ID of a format used for value.
+ * <font color=#7F9FBF>@param</font> value - value to write into the context.
+ * <font color=#7F9FBF>@param</font> done - call back object.
+ * <font color=#7F9FBF>@return</font> - pending command handle.
+ */</font>
+ IToken set(String format, String value, DoneSet done);
+ }
+
+ <font color=#3F5FBF>/**
+ * A register context can have predefined names (mnemonics) for some its values.
+ * NamedValue objects represent such values.
+ */</font>
+ <font color=#7F0055>interface</font> NamedValue {
+ <font color=#3F5FBF>/**
+ * Get number associated with this named value.
+ * <font color=#7F9FBF>@return</font> the value as a number.
+ */</font>
+ Number getValue();
+
+ <font color=#3F5FBF>/**
+ * Get name (mnemonic) of the value.
+ * <font color=#7F9FBF>@return</font> value name.
+ */</font>
+ String getName();
+
+ <font color=#3F5FBF>/**
+ * Get human readable description of the value.
+ * <font color=#7F9FBF>@return</font> value description.
+ */</font>
+ String getDescription();
+ }
+
+ <font color=#3F5FBF>/**
+ * 'get' command call back interface.
+ */</font>
+ <font color=#7F0055>interface</font> DoneGet {
+ <font color=#7F0055>void</font> doneGet(IToken token, Exception error, String value);
+ }
+
+ <font color=#3F5FBF>/**
+ * 'set' command call back interface.
+ */</font>
+ <font color=#7F0055>interface</font> DoneSet {
+ <font color=#7F0055>void</font> doneSet(IToken token, Exception error);
+ }
+
+ <font color=#3F5FBF>/**
+ * Add registers service event listener.
+ * <font color=#7F9FBF>@param</font> listener - event listener implementation.
+ */</font>
+ <font color=#7F0055>void</font> addListener(RegistersListener listener);
+
+ <font color=#3F5FBF>/**
+ * Remove registers service event listener.
+ * <font color=#7F9FBF>@param</font> listener - event listener implementation.
+ */</font>
+ <font color=#7F0055>void</font> removeListener(RegistersListener listener);
+
+ <font color=#3F5FBF>/**
+ * Registers event listener is notified when registers context hierarchy
+ * changes, and when a register is modified by the service commands.
+ */</font>
+ <font color=#7F0055>interface</font> RegistersListener {
+
+ <font color=#3F5FBF>/**
+ * Called when register context properties changed.
+ * Most targets have static set of registers and register properties.
+ * Such targets never generate this event. However, some targets,
+ * for example, JTAG probes, allow user to modify register definitions.
+ * Clients should flush all cached register context data.
+ */</font>
+ <font color=#7F0055>void</font> contextChanged();
+
+ <font color=#3F5FBF>/**
+ * Called when register content was changed and clients
+ * need to update themselves. Clients, at least, should invalidate
+ * corresponding cached registers data.
+ * Not every change is notified - it is not possible,
+ * only those, which are not caused by normal execution of the debuggee.
+ */</font>
+ <font color=#7F0055>void</font> registerChanged(String context_id);
+ }
+}
+</pre>
+
+</body>
+</html>
diff --git a/docs/TCF Service - Run Control.html b/docs/TCF Service - Run Control.html
new file mode 100644
index 000000000..dc17b079b
--- /dev/null
+++ b/docs/TCF Service - Run Control.html
@@ -0,0 +1,618 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <title>Target Communication Framework Services - Run Control</title>
+</head>
+
+<body lang='EN-US'>
+
+<h1>Target Communication Framework Services - Run Control</h1>
+
+<ul>
+ <li><a href='#Cmds'>Commands</a>
+ <ul>
+ <li><a href='#CmdGetContext'>Get Context</a>
+ <li><a href='#CmdGetChildren'>Get Children</a>
+ <li><a href='#CmdSuspend'>Suspend</a>
+ <li><a href='#CmdResume'>Resume</a>
+ <li><a href='#CmdGetState'>Get State</a>
+ <li><a href='#CmdTerminate'>Terminate</a>
+ </ul>
+ <li><a href='#Events'>Events</a>
+ <li><a href='#API'>API</a>
+</ul>
+
+<h1>Run Control Service</h1>
+
+<p>The service provides basic run control operations for execution contexts on a target.
+Command and event parameters are encoded as zero terminated <a href='TCF Specification.html#JSON'>JSON</a> strings.</p>
+
+<p>The service uses standard format for error reports,
+see <a href='TCF Services.html#ErrorFormat'>Error Report Format</a>.</p>
+
+<h2><a name='Cmds'>Commands</a></h2>
+
+<p>All run control commands are fully asynchronous, which means they never wait until
+context is in a particular state. For example, if single step command arrives when
+context is running, it does not wait until it stops, but returns an error. If a command
+successfully resumed a context, it does not wait until instruction pointer reaches
+desired destination – from client point of view the command execution ends right after
+context was resumed. Various stepping commands can leave a context running in a special
+mode, which is different from normal execution, for example, it can leave temporary
+breakpoints to suspend the context when control reaches a particular place. Such execution
+mode ends when the context is suspended, even if it was suspended for reasons unrelated
+to the command and intended destination was not reached. Client can know when and
+why a context is suspended by listening to events.</p>
+
+<h3><a name='CmdGetContext'>Get Context</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • RunControl • getContext • <i>&lt;string: context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command retrieves context properties for given context ID.
+Exact meaning of context depends on the target.
+A context can represent an execution thread, a process, an address space, etc.
+A context can belong to a parent context. Contexts hierarchy can be simple
+plain list or it can form a tree. It is up to target agent developers to choose
+layout that is most descriptive for a given target. Context IDs are valid across
+all services. In other words, all services access same hierarchy of contexts,
+with same IDs, however, each service accesses its own subset of context's
+attributes and functionality, which is relevant to that service.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;context data&gt;</i> •
+
+<i>&lt;context data&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> <i>&lt;object: context properties&gt;</i>
+</font></b></pre>
+
+<p>Context data object is collection of context properties. It should, at least, contain member
+<b><font face="Courier New" size=2 color=#333399>"ID" : <i>&lt;string&gt;</i></font></b>.
+It can also contain arbitrary number of components
+describing context properties and capabilities. Context data is supposed to be cached
+by clients and it is not expected to change frequently. It can include, for example,
+context name or ability to perform single step command on the context. But, it should
+not include volatile data like current PC or running/suspended state. Service sends
+contextChanged event to notify changes in context data.</p>
+
+<p>Predefined run control context properties are:</p>
+<ul>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ID" : <i>&lt;string&gt;</i></font></b></code>
+ - ID of the context, same as getContext command argument.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ParentID" : <i>&lt;string&gt;</i></font></b></code>
+ - ID of a parent context.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"IsContainer" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if the context is a container.
+ Executing resume or suspend command on a container causes all its children to resume or suspend.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"HasState" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if the context is an execution context, therefore
+ has an execution state, like state of a program counter (PC).
+ Only context that has a state can be resumed or suspended.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"CanSuspend" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if Suspend command is supported for this contex. It does not mean that the command can be executed successfully in
+ the current state of the context. For example, the command still can fail if context is already suspended.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"CanResume" : <i>&lt;int: bitset of resume modes&gt;</i></font></b></code>
+ - for each resume mode, corresponding bit is '1' if Resume command mode is supported for this contex, and '0' otherwise.
+ It does not mean that the command can be executed successfully in
+ the current state of the context. For example, the command still can fail if context is already resumed.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"CanCount" : <i>&lt;int: bitset of resume modes&gt;</i></font></b></code>
+ - for each resume mode, corresponding bit is '1' if Resume command mode with count other then 1 is supported by the context.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"CanTerminate" : <i>&lt;boolean&gt;</i></font></b></code>
+ - true if Terminate command is supported by the context,
+</ul>
+
+<h3><a name='CmdGetChildren'>Get Children</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • RunControl • getChildren • <i>&lt;string: parent context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command requests list of execution contexts available for run control commands.</p>
+
+<p>Parent context ID can be null – to retrieve top level of the hierarchy, can be one
+of context IDs retrieved by previous getChildren commands, or it can be obtained from another service.
+Contexts hierarchy can be simple plain list or it can form a tree. It is up to target agent developers to
+choose layout that is most descriptive for a given target.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;array of context IDs&gt;</i> •
+
+<i>&lt;array of context IDs&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ <i>&lt;context ID list&gt;</i> ]
+
+<i>&lt;context ID list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;string: context ID&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;context ID list&gt;</i> , <i>&lt;string: context ID&gt;</i>
+</font></b></pre>
+
+<h3><a name='CmdSuspend'>Suspend</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • RunControl • suspend • <i>&lt;string: context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command suspends execution of given context. The command should fail if CanSuspend property of the context is false.
+If context's IsContainer = true, the command is propagated to context's children. Only contexts with HasState = true
+can be suspended.</p>
+
+<p>Result message:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdResume'>Resume</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • RunControl • resume • <i>&lt;string: context ID&gt;</i> • <i>&lt;int: mode&gt;</i> • <i>&lt;int: count&gt;</i> •
+</font></b></pre>
+
+<p>The command resumes execution of given context. The command should fail if CanResume
+property of the context is '0' for given mode. If context's IsContainer = true, the command is propagated
+to context's children. Only contexts with HasState = true can be resumed.</p>
+
+<p>Resume modes:</p>
+<ul>
+ <li><code>RM_RESUME = 0</code> - rusume normal execution. Execution will
+ continue until suspended by command or breakpoint.
+
+ <li><code>RM_STEP_OVER = 1</code> - step over single instruction. If instruction
+ is function call, execution continues until control returns from the function.
+
+ <li><code>RM_STEP_INTO = 2</code> - single instruction in given context.
+
+ <li><code>RM_STEP_OVER_LINE = 3</code> - resume execution of given context until control reaches instruction
+ that belongs to a different line of source code, but runs any functions called at
+ full speed. Error is returned if line number information not available.
+
+ <li><code>RM_STEP_INTO_LINE = 4</code> - resumes execution of given context until control reaches instruction
+ that belongs to a different line of source code. If a function is called,
+ stop at first line of the function code. Error is returned if line number
+ information not available.
+
+ <li><code>RM_STEP_OUT = 5</code> - resume execution of given context until control returns from current
+ function.
+</ul>
+
+<p>Result message:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='CmdGetState'>Get State</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • RunControl • getState • <i>&lt;string: context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command retrieves current state of the context. The command should fail if HasState property of
+the context is false.</p>
+
+<p>Result message:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;boolean: suspended&gt;</i> •
+ <i>&lt;int: PC&gt;</i> • <i>&lt;string: last state change reason&gt;</i> • <i>&lt;state data&gt;</i> •
+
+<i>&lt;state data&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> <i>&lt;object: context state properties&gt;</i>
+</font></b></pre>
+
+<p>State change reason can be any text, but if it is one of predefined strings,
+a generic client might be able to handle it better. Predefined reasons are:</p>
+<ul>
+ <li><code>REASON_USER_REQUEST = "Suspended"</code> - context suspended by command.
+ <li><code>REASON_STEP = "Step"</code> - context resumed or suspended by step command.
+ <li><code>REASON_BREAKPOINT = "Breakpoint"</code> - context suspended by breakpoint.
+ <li><code>REASON_EXCEPTION = "Exception"</code> - context suspended by exception.
+ <li><code>REASON_CONTAINER = "Container"</code> - context suspended or resumed as part of container.
+ <li><code>REASON_WATCHPOINT = "Watchpoint"</code> - context suspended by watchpoint (data breakpoint).
+ <li><code>REASON_SIGNAL = "Signal"</code> - context suspended because it received a signal.
+ <li><code>REASON_SHAREDLIB = "Shared Library"</code> - context suspended because a shared library is loaded or unloaded.
+ <li><code>REASON_ERROR = "Error"</code> - context suspended because of an error in execution environment.
+</ul>
+
+<p>Context state properties can contain any data relevant to context state.
+Defenition of state properties depends on a target.</p>
+
+<h3><a name='CmdTerminate'>Terminate</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • RunControl • terminate • <i>&lt;string: context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command terminates execution of given context. The command should fail if CanTerminate
+property of the context is false.</p>
+
+<p>Result message:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h2><a name='Events'>Events</a></h2>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+E • RunControl • contextAdded • <i>&lt;array of context data&gt;</i> •
+
+E • RunControl • contextChanged • <i>&lt;array of context data&gt;</i> •
+
+E • RunControl • contextRemoved • <i>&lt;array of context IDs&gt;</i> •
+
+E • RunControl • contextSuspended • <i>&lt;string: context ID&gt;</i> • <i>&lt;int: PC&gt;</i> •
+ <i>&lt;string: reason&gt;</i> • <i>&lt;state data&gt;</i> •
+
+E • RunControl • contextResumed • <i>&lt;string: context ID&gt;</i> •
+
+E • RunControl • contextException • <i>&lt;string: context ID&gt;</i> • <i>&lt;string: description&gt;</i> •
+
+E • RunControl • containerSuspended • <i>&lt;string: context ID&gt;</i> • <i>&lt;int: PC&gt;</i> •
+ <i>&lt;string: reason&gt;</i> • <i>&lt;state data&gt;</i> • <i>&lt;array of context IDs&gt;</i> •
+
+E • RunControl • containerResumed • <i>&lt;array of context IDs&gt;</i> •
+
+<i>&lt;array of context data&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ <i>&lt;context data list&gt;</i> ]
+
+<i>&lt;context data list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;object: context data&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;context data list&gt;</i> , <i>&lt;object: context data&gt;</i>
+</font></b></pre>
+
+<dl>
+ <dt><b>contextAdded</b>
+ <dd>is sent when new contexts are created or attached for debugging. The message contains
+ array of context data. Context data is same as returned by Get Context command.
+ <dt><b>contextChanged</b>
+ <dd>is sent when context properties change. The message contains
+ array of changed (new) context data. Context data is same as returned by Get Context command.
+ <dt><b>contextRemoved</b>
+ <dd>is sent when context is removed - terminated or dettached. The message contains
+ array of context IDs.
+ <dt><b>contextSuspended</b>
+ <dd>is sent when context is suspended. The message context ID contains context state data,
+ same state data as returned by Get State command.
+ <dt><b>contextResumed</b>
+ <dd>is sent when context is resumed. The message contains resumed context ID.
+ <dt><b>contextException</b>
+ <dd>is sent when execution exception occurs in a context. The message contains context ID and
+ a string that describes nature of the exception.
+ <dt><b>containerSuspended</b>
+ <dd>is sent when target simultaneously suspends multiple threads in a container (process, core, etc.).
+ The message contains context ID and context state data of a context responsible for the event.
+ It can be container ID or any one of container children, for example, it can be thread
+ that hit "suspend all" breakpoint. Message also contains full list of all contexts that were suspended
+ simultaneously. No separate contextSuspened events are sent for contexts in the list. If client needs
+ state data for those contexts, it should use Get State command.
+ <dt><b>containerResumed</b>
+ <dd>is sent when target simultaneously resumes multiple threads in a container (process,
+ core, etc.). Message contains full list of all contexts that were resumed
+ simultaneously. No separate contextResumed events are sent for contexts in the list.
+</dl>
+
+<h2><a name='API'>API</a></h2>
+
+<pre>
+<font color=#7F0055>public interface</font> IRunControl <font color=#7F0055>extends</font> IService {
+
+ <font color=#3F5FBF>/**
+ * Context property names.
+ */</font>
+ <font color=#7F0055>static final</font> String
+ PROP_ID = "ID",
+ PROP_PARENT_ID = "ParentID",
+ PROP_IS_CONTAINER = "IsContainer",
+ PROP_HAS_STATE = "HasState",
+ PROP_CAN_RESUME = "CanResume",
+ PROP_CAN_COUNT = "CanCount",
+ PROP_CAN_SUSPEND = "CanSuspend",
+ PROP_CAN_TERMINATE = "CanTerminate";
+
+ <font color=#3F5FBF>/**
+ * Context resume modes.
+ */</font>
+ <font color=#7F0055>static final int</font>
+ RM_RESUME = 0,
+ RM_STEP_OVER = 1,
+ RM_STEP_INTO = 2,
+ RM_STEP_OVER_LINE = 3,
+ RM_STEP_INTO_LINE = 4,
+ RM_STEP_OUT = 5;
+
+ <font color=#3F5FBF>/**
+ * State change reason of a context.
+ * Reason can be any text, but if it is one of predefined strings,
+ * a generic client might be able to handle it better.
+ */</font>
+ <font color=#7F0055>static final</font> String
+ REASON_USER_REQUEST = "Suspended",
+ REASON_STEP = "Step",
+ REASON_BREAKPOINT = "Breakpoint",
+ REASON_EXCEPTION = "Exception",
+ REASON_CONTAINER = "Container",
+ REASON_WATCHPOINT = "Watchpoint",
+ REASON_SIGNAL = "Signal",
+ REASON_SHAREDLIB = "Shared Library",
+ REASON_ERROR = "Error";
+
+ <font color=#3F5FBF>/**
+ * Retrieve context info for given context ID.
+ *
+ * <font color=#7F9FBF>@param</font> id – context ID.
+ * <font color=#7F9FBF>@param</font> done - callback interface called when operation is completed.
+ */</font>
+ IToken getContext(String id, DoneGetContext done);
+
+ <font color=#3F5FBF>/**
+ * Client callback interface for getContext().
+ */</font>
+ <font color=#7F0055>interface</font> DoneGetContext {
+ <font color=#3F5FBF>/**
+ * Called when contexts data retrieval is done.
+ * <font color=#7F9FBF>@param</font> error – error description if operation failed, null if succeeded.
+ * <font color=#7F9FBF>@param</font> context – context data.
+ */</font>
+ <font color=#7F0055>void</font> doneGetContext(IToken token, Exception error, RunControlContext context);
+ }
+
+    <font color=#3F5FBF>/**
+ * Retrieve children of given context.
+ *
+ * <font color=#7F9FBF>@param</font> parent_context_id – parent context ID. Can be null –
+ * to retrieve top level of the hierarchy, or one of context IDs retrieved
+ * by previous getContext or getChildren commands.
+ * <font color=#7F9FBF>@param</font> done - callback interface called when operation is completed.
+     */</font>
+ IToken getChildren(String parent_context_id, DoneGetChildren done);
+
+    <font color=#3F5FBF>/**
+     * Client callback interface for getContexts().
+     */</font>
+    <font color=#7F0055>interface</font> DoneGetChildren {
+        <font color=#3F5FBF>/**
+         * Called when contexts data retrieval is done.
+         * <font color=#7F9FBF>@param</font> error – error description if operation failed, null if succeeded.
+         * <font color=#7F9FBF>@param</font> contexts – array of available context IDs.
+         */</font>
+        <font color=#7F0055>void</font> doneGetChildren(IToken token, RunControlError error, Context[] contexts);
+    }
+
+ <font color=#3F5FBF>/**
+ * A context corresponds to an execution thread, process, address space, etc.
+ * A context can belong to a parent context. Contexts hierarchy can be simple
+ * plain list or it can form a tree. It is up to target agent developers to choose
+ * layout that is most descriptive for a given target. Context IDs are valid across
+ * all services. In other words, all services access same hierarchy of contexts,
+ * with same IDs, however, each service accesses its own subset of context's
+ * attributes and functionality, which is relevant to that service.
+ */</font>
+    <font color=#7F0055>interface</font> RunControlContext {
+
+ <font color=#3F5FBF>/**
+ * Retrieve context ID.
+ * Same as getProperties().get("ID")
+ */</font>
+        String getID();
+
+ <font color=#3F5FBF>/**
+ * Retrieve parent context ID.
+ * Same as getProperties().get("ParentID")
+ */</font>
+ String getParentID();
+
+ <font color=#3F5FBF>/**
+ * Get context properties. See PROP_* definitions for property names.
+ * Context properties are read only, clients should not try to modify them.
+ * <font color=#7F9FBF>@return</font> Map of context properties.
+ */</font>
+        Map&lt;String,Object&gt; getProperties();
+
+ <font color=#3F5FBF>/**
+ * Utility method to read context property PROP_IS_CONTAINER.
+ * Executing resume or suspend command on a container causes all its children to resume or suspend.
+ * <font color=#7F9FBF>@return</font> value of PROP_IS_CONTAINER.
+ */</font>
+ <font color=#7F0055>boolean</font> isContainer();
+
+ <font color=#3F5FBF>/**
+ * Utility method to read context property PROP_HAS_STATE.
+ * Only context that has a state can be resumed or suspended.
+ * <font color=#7F9FBF>@return</font> value of PROP_HAS_STATE.
+ */</font>
+ <font color=#7F0055>boolean</font> hasState();
+
+ <font color=#3F5FBF>/**
+ * Utility method to read context property PROP_CAN_SUSPEND.
+ * Value 'true' means suspend command is supported by the context,
+ * however the method does not check that the command can be executed successfully in
+ * the current state of the context. For example, the command still can fail if context is
+ * already suspended.
+ * <font color=#7F9FBF>@return</font> value of PROP_CAN_SUSPEND.
+ */</font>
+ <font color=#7F0055>boolean</font> canSuspend();
+
+ <font color=#3F5FBF>/**
+ * Utility method to read a 'mode' bit in context property PROP_CAN_RESUME.
+ * Value 'true' means resume command is supported by the context,
+ * however the method does not check that the command can be executed successfully in
+ * the current state of the context. For example, the command still can fail if context is
+ * already resumed.
+ * <font color=#7F9FBF>@param</font> mode - resume mode, see RM_*.
+ * <font color=#7F9FBF>@return</font> value of requested bit of PROP_CAN_RESUME.
+ */</font>
+ <font color=#7F0055>boolean</font> canResume(<font color=#7F0055>int</font> mode);
+
+ <font color=#3F5FBF>/**
+ * Utility method to read a 'mode' bit in context property PROP_CAN_COUNT.
+ * Value 'true' means resume command with count other then 1 is supported by the context,
+ * however the method does not check that the command can be executed successfully in
+ * the current state of the context. For example, the command still can fail if context is
+ * already resumed.
+ * <font color=#7F9FBF>@param</font> mode - resume mode, see RM_*.
+ * <font color=#7F9FBF>@return</font> value of requested bit of PROP_CAN_COUNT.
+ */</font>
+ <font color=#7F0055>boolean</font> canCount(<font color=#7F0055>int</font> mode);
+
+ <font color=#3F5FBF>/**
+ * Utility method to read context property PROP_CAN_TERMINATE.
+ * Value 'true' means terminate command is supported by the context,
+ * however the method does not check that the command can be executed successfully in
+ * the current state of the context. For example, the command still can fail if context is
+ * already exited.
+ * <font color=#7F9FBF>@return</font> value of PROP_CAN_SUSPEND.
+ */</font>
+ <font color=#7F0055>boolean</font> canTerminate();
+
+ <font color=#3F5FBF>/**
+ * Send a command to retrieve current state of a context.
+ * <font color=#7F9FBF>@param</font> done - command result call back object.
+ * <font color=#7F9FBF>@return</font> pending command handle, can be used to cancel the command.
+ */</font>
+ IToken getState(DoneGetState done);
+
+ <font color=#3F5FBF>/**
+ * Send a command to suspend a context.
+ * Also suspends children if context is a container.
+ * <font color=#7F9FBF>@param</font> done - command result call back object.
+ * <font color=#7F9FBF>@return</font> pending command handle, can be used to cancel the command.
+ */</font>
+ IToken suspend(DoneCommand done);
+
+ <font color=#3F5FBF>/**
+ * Send a command to resume a context.
+ * Also resumes children if context is a container.
+ * <font color=#7F9FBF>@param</font> mode - defines how to resume the context, see RM_*.
+ * <font color=#7F9FBF>@param</font> count - if mode implies stepping, defines how many steps to perform.
+ * <font color=#7F9FBF>@param</font> done - command result call back object.
+ * <font color=#7F9FBF>@return</font> pending command handle, can be used to cancel the command.
+ */</font>
+ IToken resume(<font color=#7F0055>int</font> mode, <font color=#7F0055>int</font> count, DoneCommand done);
+
+ <font color=#3F5FBF>/**
+ * Send a command to terminate a context.
+ * <font color=#7F9FBF>@param</font> done - command result call back object.
+ * <font color=#7F9FBF>@return</font> pending command handle, can be used to cancel the command.
+ */</font>
+ IToken terminate(DoneCommand done);
+    }
+
+    <font color=#7F0055>class</font> RunControlError <font color=#7F0055>extends</font> Exception {
+    }
+
+ <font color=#7F0055>interface</font> DoneGetState {
+ <font color=#7F0055>void</font> doneGetState(IToken token, Exception error, <font color=#7F0055>boolean</font> suspended, String pc,
+ String reason, Map&lt;String,Object&gt; params);
+ }
+
+ <font color=#7F0055>interface</font> DoneCommand {
+ <font color=#3F5FBF>/**
+ * Called when run control command execution is complete.
+ * <font color=#7F9FBF>@param</font> token - pending command handle.
+ * <font color=#7F9FBF>@param</font> error - command execution error or null.
+ */</font>
+ <font color=#7F0055>void</font> doneCommand(IToken token, Exception error);
+ }
+
+ <font color=#3F5FBF>/**
+ * Add run control event listener.
+ * <font color=#7F9FBF>@param</font> listener - run control event listener to add.
+ */</font>
+ <font color=#7F0055>void</font> addListener(RunControlListener listener);
+
+ <font color=#3F5FBF>/**
+ * Remove run control event listener.
+ * <font color=#7F9FBF>@param</font> listener - run control event listener to remove.
+ */</font>
+ <font color=#7F0055>void</font> removeListener(RunControlListener listener);
+
+ <font color=#3F5FBF>/**
+ * Service events listener interface.
+ */</font>
+ <font color=#7F0055>interface</font> RunControlListener {
+
+ <font color=#3F5FBF>/**
+ * Called when a new contexts are created.
+ * <font color=#7F9FBF>@param</font> contexts - array of new context properties.
+ */</font>
+ <font color=#7F0055>void</font> contextAdded(RunControlContext contexts[]);
+
+ <font color=#3F5FBF>/**
+ * Called when a context properties changed.
+ * <font color=#7F9FBF>@param</font> contexts - array of new context properties.
+ */</font>
+ <font color=#7F0055>void</font> contextChanged(RunControlContext contexts[]);
+
+ <font color=#3F5FBF>/**
+ * Called when contexts are removed.
+ * <font color=#7F9FBF>@param</font> context_ids - aray of removed context IDs.
+ */</font>
+ <font color=#7F0055>void</font> contextRemoved(String context_ids[]);
+
+ <font color=#3F5FBF>/**
+ * Called when a thread is suspended.
+ * <font color=#7F9FBF>@param</font> context - ID of a context that was suspended.
+ * <font color=#7F9FBF>@param</font> pc - program counter of the context, can be null.
+ * <font color=#7F9FBF>@param</font> reason - human readable description of suspend reason.
+ * <font color=#7F9FBF>@param</font> params - additional, target specific data about suspended context.
+ */</font>
+ <font color=#7F0055>void</font> contextSuspended(String context, String pc,
+ String reason, Map&lt;String,Object&gt; params);
+
+ <font color=#3F5FBF>/**
+ * Called when a thread is resumed.
+ * <font color=#7F9FBF>@param</font> context - ID of a context that was resumed.
+ */</font>
+ <font color=#7F0055>void</font> contextResumed(String context);
+
+ <font color=#3F5FBF>/**
+ * Called when target simultaneously suspends multiple threads in a container
+ * (process, core, etc.).
+ *
+ * <font color=#7F9FBF>@param</font> context - ID of a context responsible for the event. It can be container ID or
+ * any one of container children, for example, it can be thread that hit "suspend all" breakpoint.
+ * Client expected to move focus (selection) to this context.
+ * <font color=#7F9FBF>@param</font> pc - program counter of the context.
+ * <font color=#7F9FBF>@param</font> reason - human readable description of suspend reason.
+ * <font color=#7F9FBF>@param</font> params - additional target specific data about suspended context.
+ * <font color=#7F9FBF>@param</font> suspended_ids - full list of all contexts that were suspended.
+ */</font>
+ <font color=#7F0055>void</font> containerSuspended(String context, String pc,
+ String reason, Map&lt;String,Object&gt; params, String[] suspended_ids);
+
+ <font color=#3F5FBF>/**
+ * Called when target simultaneously resumes multiple threads in a container (process,
+ * core, etc.).
+ *
+ * <font color=#7F9FBF>@param</font> context_ids - full list of all contexts that were resumed.
+ */</font>
+ <font color=#7F0055>void</font> containerResumed(String[] context_ids);
+
+ <font color=#3F5FBF>/**
+ * Called when an exception is detected in a target thread.
+ * <font color=#7F9FBF>@param</font> context - ID of a context that caused an exception.
+ * <font color=#7F9FBF>@param</font> msg - human readable description of the exception.
+ */</font>
+ <font color=#7F0055>void</font> contextException(String context, String msg);
+ }
+}
+</pre>
+
+</body>
+</html>
diff --git a/docs/TCF Service - Stack Trace.html b/docs/TCF Service - Stack Trace.html
new file mode 100644
index 000000000..c1ce675d5
--- /dev/null
+++ b/docs/TCF Service - Stack Trace.html
@@ -0,0 +1,278 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <title>Target Communication Framework Services - Stack Trace</title>
+</head>
+
+<body lang='EN-US'>
+
+<h1>Target Communication Framework Services - Stack Trace</h1>
+
+<ul>
+ <li><a href='#Cmds'>Commands</a>
+ <ul>
+ <li><a href='#CmdGetContext'>Get Context</a>
+ <li><a href='#CmdGetChildren'>Get Children</a>
+ </ul>
+ <li><a href='#Events'>Events</a>
+ <li><a href='#API'>API</a>
+</ul>
+
+<h1>Stack Trace Service</h1>
+
+<p>The service implements thread stack back tracing. Command
+and event parameters are encoded as zero terminated <a href='TCF Specification.html#JSON'>JSON</a> strings.</p>
+
+<p>The service uses standard format for error reports,
+see <a href='TCF Services.html#ErrorFormat'>Error Report Format</a>.</p>
+
+<h2><a name='Cmds'>Commands</a></h2>
+
+<h3><a name='CmdGetContext'>Get Context</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • StackTrace • getContext • <i>&lt;array of context IDs&gt;</i> •
+
+<i>&lt;array of context IDs&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ ]
+ <font face=Wingdings>Ψ</font> [ <i>&lt;context ID list&gt;</i> ]
+
+<i>&lt;context ID list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;string: context ID&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;context ID list&gt;</i> , <i>&lt;string: context ID&gt;</i>
+</font></b></pre>
+
+<p>The command retrieves context info for given context IDs.
+Command allows to query multiple contexts at once.
+Stack Trace context represents single stack frame.
+If target supports more then one stack per thread,
+each stack is also represented by a separate context.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;array of context data&gt;</i> • <i>&lt;error report&gt;</i> •
+
+<i>&lt;array of context data&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ ]
+ <font face=Wingdings>Ψ</font> [ <i>&lt;context data list&gt;</i> ]
+
+<i>&lt;context data list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;context data&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;context data list&gt;</i> , <i>&lt;context data&gt;</i>
+
+<i>&lt;context data&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> <i>&lt;object&gt;</i>
+</font></b></pre>
+
+<p>Context data object should, at least, contain member
+<b><font face="Courier New" size=2 color=#333399>"ID" : <i>&lt;string&gt;.</i></font></b>
+Context data is expected to be cached by clients.
+Cached context data should by flushed when parent thread is resumed.</p>
+
+<p>Predefined stack trace context properties are:</p>
+<ul>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ID" : <i>&lt;string&gt;</i></font></b></code>
+ - ID of the context, same as getContext command argument.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ParentID" : <i>&lt;string&gt;</i></font></b></code>
+ - ID of a parent context.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ProcessID" : <i>&lt;string&gt;</i></font></b></code>
+ - process ID.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Name" : <i>&lt;string&gt;</i></font></b></code>
+ - context name if context is a stack
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"FP" : <i>&lt;number&gt;</i></font></b></code>
+ - frame pointer - memory address of stack frame
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"PC" : <i>&lt;number&gt;</i></font></b></code>
+ - program counter - memory address of instruction that will be executed when thread returns from this stack frame.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ArgsCnt" : <i>&lt;number&gt;</i></font></b></code>
+ - function arguments count
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ArgsAddr" : <i>&lt;number&gt;</i></font></b></code>
+ - memory address of function arguments
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Level" : <i>&lt;number&gt;</i></font></b></code>
+ - frame level. Bottom most (oldest) frame is level 0.
+</ul>
+
+<h3><a name='CmdGetChildren'>Get Children</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • StackTrace • getChildren • <i>&lt;string: parent context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command retrieves stack trace context list.
+Parent context usually corresponds to an execution thread.
+Some targets have more then one stack. In such case children of a thread
+are stacks, and stack frames are deeper in the hierarchy - they can be
+retrieved with additional getChildren commands.</p>
+
+<p>The command will fail if parent thread is not suspended.
+Client can use Run Control service to suspend a thread.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;array of context IDs&gt;</i> •<i></i>
+
+<i>&lt;array of context IDs&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ ]
+ <font face=Wingdings>Ψ</font> [ <i>&lt;context ID list&gt;</i> ]
+
+<i>&lt;context ID list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;string: context ID&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;context ID list&gt;</i> , <i>&lt;string: context ID&gt;</i>
+
+</font></b></pre>
+
+
+<h2><a name='Events'>Events</a></h2>
+
+<p>No events are currently defined for Stack Trace service.</p>
+
+<h2><a name='API'>API</a></h2>
+
+<pre>
+<font color=#7F0055>public interface</font> IStackTrace <font color=#7F0055>extends</font> IService {
+
+ <font color=#7F0055>static final</font> String NAME = "StackTrace";
+
+ <font color=#3F5FBF>/**
+ * Context property names.
+ */</font>
+ <font color=#7F0055>static final</font> String
+ PROP_ID = "ID",
+ PROP_PARENT_ID = "ParentID",
+ PROP_PROCESS_ID = "ProcessID",
+ PROP_NAME = "Name",
+ PROP_FRAME_ADDRESS = "FP",
+ PROP_PROGRAM_COUNTER = "PC",
+ PROP_ARGUMENTS_COUNT = "ArgsCnt",
+ PROP_ARGUMENTS_ADDRESS = "ArgsAddr",
+ PROP_LEVEL = "Level";
+
+ <font color=#3F5FBF>/**
+ * Retrieve context info for given context IDs.
+ *
+ * The command will fail if parent thread is not suspended.
+ * Client can use Run Control service to suspend a thread.
+ *
+ * <font color=#7F9FBF>@param</font> id – array of context IDs.
+ * <font color=#7F9FBF>@param</font> done - call back interface called when operation is completed.
+ */</font>
+ IToken getContext(String[] id, DoneGetContext done);
+
+ <font color=#3F5FBF>/**
+ * Client call back interface for getContext().
+ */</font>
+ <font color=#7F0055>interface</font> DoneGetContext {
+ <font color=#3F5FBF>/**
+ * Called when context data retrieval is done.
+ * <font color=#7F9FBF>@param</font> error – error description if operation failed, null if succeeded.
+ * <font color=#7F9FBF>@param</font> context – array of context data or null if error.
+ */</font>
+ <font color=#7F0055>void</font> doneGetContext(IToken token, Exception error, StackTraceContext[] context);
+ }
+
+ <font color=#3F5FBF>/**
+ * Retrieve stack trace context list.
+ * Parent context usually corresponds to an execution thread.
+ * Some targets have more then one stack. In such case children of a thread
+ * are stacks, and stack frames are deeper in the hierarchy - they can be
+ * retrieved with additional getChildren commands.
+ *
+ * The command will fail if parent thread is not suspended.
+ * Client can use Run Control service to suspend a thread.
+ *
+ * <font color=#7F9FBF>@param</font> parent_context_id – parent context ID.
+ * <font color=#7F9FBF>@param</font> done - call back interface called when operation is completed.
+ */</font>
+ IToken getChildren(String parent_context_id, DoneGetChildren done);
+
+ <font color=#3F5FBF>/**
+ * Client call back interface for getChildren().
+ */</font>
+ <font color=#7F0055>interface</font> DoneGetChildren {
+ <font color=#3F5FBF>/**
+ * Called when context list retrieval is done.
+ * <font color=#7F9FBF>@param</font> error – error description if operation failed, null if succeeded.
+ * <font color=#7F9FBF>@param</font> context_ids – array of available context IDs.
+ * Stack frames are ordered from stack bottom to top.
+ */</font>
+ <font color=#7F0055>void</font> doneGetChildren(IToken token, Exception error, String[] context_ids);
+ }
+
+ <font color=#3F5FBF>/**
+ * StackTraceContext represents stack trace objects - stacks and stack frames.
+ */</font>
+ <font color=#7F0055>interface</font> StackTraceContext {
+
+ <font color=#3F5FBF>/**
+ * Get Context ID.
+ * <font color=#7F9FBF>@return</font> context ID.
+ */</font>
+ String getID();
+
+ <font color=#3F5FBF>/**
+ * Get parent context ID.
+ * <font color=#7F9FBF>@return</font> parent context ID.
+ */</font>
+ String getParentID();
+
+ <font color=#3F5FBF>/**
+ * Get context name - if context represents a stack.
+ * <font color=#7F9FBF>@return</font> context name or null.
+ */</font>
+ String getName();
+
+ <font color=#3F5FBF>/**
+ * Get memory address of this frame.
+ * <font color=#7F9FBF>@return</font> address or null if not a stack frame.
+ */</font>
+ Number getFrameAddress();
+
+ <font color=#3F5FBF>/**
+ * Get program counter saved in this stack frame -
+ * it is address of instruction to be executed when the function returns.
+ * <font color=#7F9FBF>@return</font> program counter or null if not a stack frame.
+ */</font>
+ Number getProgramCounter();
+
+ <font color=#3F5FBF>/**
+ * Get number of function arguments for this frame.
+ * <font color=#7F9FBF>@return</font> function arguments count.
+ */</font>
+ <font color=#7F0055>int</font> getArgumentsCount();
+
+ <font color=#3F5FBF>/**
+ * Get address of function arguments area in memory.
+ * <font color=#7F9FBF>@return</font> function arguments address or null if not available.
+ */</font>
+ Number getArgumentsAddress();
+
+ <font color=#3F5FBF>/**
+ * Get stack frame level.
+ * <font color=#7F9FBF>@return</font> frame level or 0 if not a stack frame.
+ */</font>
+ <font color=#7F0055>int</font> getLevel();
+
+ <font color=#3F5FBF>/**
+ * Get complete map of context properties.
+ * <font color=#7F9FBF>@return</font> map of context properties.
+ */</font>
+ Map&lt;String,Object&gt; getProperties();
+ }
+}
+</pre>
+
+</body>
+</html>
diff --git a/docs/TCF Service - System Monitor.html b/docs/TCF Service - System Monitor.html
new file mode 100644
index 000000000..882e91094
--- /dev/null
+++ b/docs/TCF Service - System Monitor.html
@@ -0,0 +1,654 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <title>Target Communication Framework Services - System Monitor</title>
+</head>
+
+<body lang='EN-US'>
+
+<h1>Target Communication Framework Services - System Monitor</h1>
+
+<ul>
+ <li><a href='#Cmds'>Commands</a>
+ <ul>
+ <li><a href='#CmdGetContext'>Get Context</a>
+ <li><a href='#CmdGetChildren'>Get Children</a>
+ <li><a href='#CmdGetCommandLine'>Get Command Line</a>
+ <li><a href='#CmdGetEnvironment'>Get Environment</a>
+ </ul>
+ <li><a href='#Events'>Events</a>
+ <li><a href='#API'>API</a>
+</ul>
+
+<h1>System Monitor Service</h1>
+
+<p>The service can be used for monitoring system activity and utilization.
+It provides list of running processes, different process attributes like command line, environment, etc.,
+and some resource utilization data. The service can be used by a client to provide functionality
+similar to Unix 'top' utility or Windows 'Task Manager'.</p>
+
+<p>Command and event parameters are encoded
+as zero terminated <a href='TCF Specification.html#JSON'>JSON</a> strings.</p>
+
+<p>The service uses standard format for error reports,
+see <a href='TCF Services.html#ErrorFormat'>Error Report Format</a>.</p>
+
+<h2><a name='Cmds'>Commands</a></h2>
+
+<h3><a name='CmdGetContext'>Get Context</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • SysMonitor • getContext • <i>&lt;string: context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command retrieves context info for given context ID.
+A context corresponds to an execution thread or process.
+Context IDs are valid across TCF services, so it is allowed to issue 'SysMonitor.getContext'
+command with a context that was obtained from another service.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;context data&gt;</i> •
+
+<i>&lt;context data&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> <i>&lt;object&gt;</i>
+</font></b></pre>
+
+<p>Context data object should, at least, contain member
+<b><font face="Courier New" size=2 color=#333399>"ID" : <i>&lt;string&gt;.</i></font></b>
+</p>
+
+<p>Predefined context properties are:</p>
+<ul>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ID" : <i>&lt;string&gt;</i></font></b></code>
+ - ID of the context, same as getContext command argument.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ParentID" : <i>&lt;string&gt;</i></font></b></code>
+ - parent context ID.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"CWD" : <i>&lt;string&gt;</i></font></b></code>
+ - current working directory of the process.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Root" : <i>&lt;string&gt;</i></font></b></code>
+ - the process's root directory (as set by chroot).
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"UID" : <i>&lt;int&gt;</i></font></b></code>
+ - User ID of the process owner.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"UGID" : <i>&lt;int&gt;</i></font></b></code>
+ - Group ID of the process owner.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"UserName" : <i>&lt;string&gt;</i></font></b></code>
+ - user name of the process owner.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"GroupName" : <i>&lt;string&gt;</i></font></b></code>
+ - group name of the process owner.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"PID" : <i>&lt;int&gt;</i></font></b></code>
+ - system process ID.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"File" : <i>&lt;string&gt;</i></font></b></code>
+ - executable file of the process.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"State" : <i>&lt;string&gt;</i></font></b></code>
+ - one character from the string "RSDZTW" where R is running, S is
+ sleeping in an interruptible wait, D is waiting in uninterruptible
+ disk sleep, Z is zombie, T is traced or stopped (on a signal), and W
+ is paging.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"PPID" : <i>&lt;int&gt;</i></font></b></code>
+ - system ID of the parent process.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"PGRP" : <i>&lt;int&gt;</i></font></b></code>
+ - the process group ID of the process.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Session" : <i>&lt;int&gt;</i></font></b></code>
+ - the session ID of the process.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"TTY" : <i>&lt;int&gt;</i></font></b></code>
+ - the tty the process uses.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"TGID" : <i>&lt;int&gt;</i></font></b></code>
+ - the process group ID of the process which currently owns the tty that
+ the process is connected to.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"TracerPID" : <i>&lt;int&gt;</i></font></b></code>
+ - ID of a process that has attached this process for tracing or debugging.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Flags" : <i>&lt;int&gt;</i></font></b></code>
+ - the kernel flags word of the process. Details depend on the kernel.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"MinFlt" : <i>&lt;int&gt;</i></font></b></code>
+ - the number of minor faults the process has made which have not
+ required loading a memory page from disk.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"CMinFlt" : <i>&lt;int&gt;</i></font></b></code>
+ - the number of minor faults that the process's waited-for children have made.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"MajFlt" : <i>&lt;int&gt;</i></font></b></code>
+ - the number of major faults the process has made which have required
+ loading a memory page from disk.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"CMajFlt" : <i>&lt;int&gt;</i></font></b></code>
+ - the number of major faults that the process's waited-for children
+ have made.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"UTime" : <i>&lt;int&gt;</i></font></b></code>
+ - the number of milliseconds that this process has been scheduled in user mode.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"STime" : <i>&lt;int&gt;</i></font></b></code>
+ - the number of milliseconds that this process has been scheduled in kernel mode.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"CUTime" : <i>&lt;int&gt;</i></font></b></code>
+ - the number of jiffies that this process's waited-for children have
+ been scheduled in user mode.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"CSTime" : <i>&lt;int&gt;</i></font></b></code>
+ - the number of jiffies that this process's waited-for children have
+ been scheduled in user mode.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Priority" : <i>&lt;int&gt;</i></font></b></code>
+ - the standard nice value.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Nice" : <i>&lt;int&gt;</i></font></b></code>
+ - the nice value.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ITRealValue" : <i>&lt;int&gt;</i></font></b></code>
+ - the time in milliseconds before the next SIGALRM is sent to the process
+ due to an interval timer.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"StartTime" : <i>&lt;int&gt;</i></font></b></code>
+ - the time in milliseconds the process started after system boot.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"VSize" : <i>&lt;int&gt;</i></font></b></code>
+ - virtual memory size in bytes.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"PSize" : <i>&lt;int&gt;</i></font></b></code>
+ - memory pages size in bytes.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"RSS" : <i>&lt;int&gt;</i></font></b></code>
+ - resident Set Size: number of pages the process has in real memory,
+ minus used for administrative purposes. This is just the pages which
+ count towards text, data, or stack space. This does not include
+ pages which have not been demand-loaded in, or which are swapped out.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"RLimit" : <i>&lt;int&gt;</i></font></b></code>
+ - current limit in bytes on the rss of the process.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"CodeStart" : <i>&lt;int&gt;</i></font></b></code>
+ - the address above which program text can run.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"CodeEnd" : <i>&lt;int&gt;</i></font></b></code>
+ - the address below which program text can run.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"StackStart" : <i>&lt;int&gt;</i></font></b></code>
+ - the address of the start of the stack.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Signals" : <i>&lt;int&gt;</i></font></b></code>
+ - the bitmap of pending signals.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"SigBlock" : <i>&lt;int&gt;</i></font></b></code>
+ - the bitmap of blocked signals.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"SigIgnore" : <i>&lt;int&gt;</i></font></b></code>
+ - the bitmap of ignored signals.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"SigCatch" : <i>&lt;int&gt;</i></font></b></code>
+ - the bitmap of caught signals.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"WChan" : <i>&lt;int&gt;</i></font></b></code>
+ - this is the "channel" in which the process is waiting. It is the
+ address of a system call, and can be looked up in a namelist if you
+ need a textual name.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"NSwap" : <i>&lt;int&gt;</i></font></b></code>
+ - number of pages swapped.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"CNSwap" : <i>&lt;int&gt;</i></font></b></code>
+ - cumulative NSwap for child processes.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ExitSignal" : <i>&lt;int&gt;</i></font></b></code>
+ - signal to be sent to parent when this process exits.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Processor" : <i>&lt;int&gt;</i></font></b></code>
+ - CPU number last executed on.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"RTPriority" : <i>&lt;int&gt;</i></font></b></code>
+ - real-time scheduling priority.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Policy" : <i>&lt;int&gt;</i></font></b></code>
+ - scheduling policy.
+</ul>
+
+<h3><a name='CmdGetChildren'>Get Children</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • SysMonitor • getChildren • <i>&lt;string: parent context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command requests a list of contexts available for System Monitor commands.</p>
+
+<p>Parent context ID can be null – to retrieve top level of the hierarchy, can be one
+of context IDs retrieved by previous getChildren commands, or it can be obtained from another service.
+Contexts hierarchy can be simple plain list or it can form a tree. It is up to target agent developers to
+choose layout that is most descriptive for a given target.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;array of context IDs&gt;</i> •
+
+<i>&lt;array of context IDs&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ ]
+ <font face=Wingdings>Ψ</font> [ <i>&lt;context ID list&gt;</i> ]
+
+<i>&lt;context ID list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;string: context ID&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;context ID list&gt;</i> , <i>&lt;string: context ID&gt;</i>
+</font></b></pre>
+
+<h3><a name='CmdGetCommandLine'>Get Command Line</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • SysMonitor • getCommandLine • <i>&lt;string: context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command requests a list of progess command line arguments.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;array of string&gt;</i> •
+
+<i>&lt;array of string&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> [ ]
+ <font face=Wingdings>Ψ</font> [ <i>&lt;string list&gt;</i> ]
+
+<i>&lt;string list&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;string&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;string list&gt;</i> , <i>&lt;string&gt;</i>
+</font></b></pre>
+
+<h3><a name='CmdGetEnvironment'>Get Environment</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • SysMonitor • getEnvironment • <i>&lt;string: context ID&gt;</i> •
+</font></b></pre>
+
+<p>The command requests a list of progess environment variables.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> • <i>&lt;array of string&gt;</i> •
+</font></b></pre>
+
+<h2><a name='Events'>Events</a></h2>
+
+<p>No events are currently defined for System Monitor service.</p>
+
+<h2><a name='API'>API</a></h2>
+
+<pre>
+<font color=#7F0055>public interface</font> ISysMonitor <font color=#7F0055>extends</font> IService {
+
+ <font color=#7F0055>static final</font> String NAME = "SysMonitor";
+
+ <font color=#3F5FBF>/**
+ * Retrieve context info for given context ID.
+ *
+ * <font color=#7F9FBF>@param</font> id – context ID.
+ * <font color=#7F9FBF>@param</font> done - callback interface called when operation is completed.
+ */</font>
+ IToken getContext(String id, DoneGetContext done);
+
+ <font color=#3F5FBF>/**
+ * Client callback interface for getContext().
+ */</font>
+ <font color=#7F0055>interface</font> DoneGetContext {
+ <font color=#3F5FBF>/**
+ * Called when contexts data retrieval is done.
+ * <font color=#7F9FBF>@param</font> error – error description if operation failed, null if succeeded.
+ * <font color=#7F9FBF>@param</font> context – context data.
+ */</font>
+ <font color=#7F0055>void</font> doneGetContext(IToken token, Exception error, SysMonitorContext context);
+ }
+
+ <font color=#3F5FBF>/**
+ * Retrieve children of given context.
+ *
+ * <font color=#7F9FBF>@param</font> parent_context_id – parent context ID. Can be null –
+ * to retrieve top level of the hierarchy, or one of context IDs retrieved
+ * by previous getContext or getChildren commands.
+ * <font color=#7F9FBF>@param</font> done - callback interface called when operation is completed.
+ */</font>
+ IToken getChildren(String parent_context_id, DoneGetChildren done);
+
+ <font color=#3F5FBF>/**
+ * Client callback interface for getChildren().
+ */</font>
+ <font color=#7F0055>interface</font> DoneGetChildren {
+ <font color=#3F5FBF>/**
+ * Called when contexts data retrieval is done.
+ * <font color=#7F9FBF>@param</font> error – error description if operation failed, null if succeeded.
+ * <font color=#7F9FBF>@param</font> context_ids – array of available context IDs.
+ */</font>
+ <font color=#7F0055>void</font> doneGetChildren(IToken token, Exception error, String[] context_ids);
+ }
+
+ <font color=#3F5FBF>/**
+ * Context property names.
+ */</font>
+ <font color=#7F0055>static final</font> String
+ <font color=#3F5FBF>/** The TCF context ID */</font>
+ PROP_ID = "ID",
+
+ <font color=#3F5FBF>/** The TCF parent context ID */</font>
+ PROP_PARENTID = "ParentID",
+
+ <font color=#3F5FBF>/** Current working directory of the process */</font>
+ PROP_CWD = "CWD",
+
+ <font color=#3F5FBF>/** The process's root directory (as set by chroot) */</font>
+ PROP_ROOT = "Root",
+
+ <font color=#3F5FBF>/** User ID of the process owner */</font>
+ PROP_UID = "UID",
+
+ <font color=#3F5FBF>/** Group ID of the process owner */</font>
+ PROP_UGID = "UGID",
+
+ <font color=#3F5FBF>/** User name of the process owner */</font>
+ PROP_USERNAME = "UserName",
+
+ <font color=#3F5FBF>/** Group name of the process owner */</font>
+ PROP_GROUPNAME = "GroupName",
+
+ <font color=#3F5FBF>/** System process ID */</font>
+ PROP_PID = "PID",
+
+ <font color=#3F5FBF>/** Executable file of the process */</font>
+ PROP_FILE = "File",
+
+ <font color=#3F5FBF>/** One character from the string "RSDZTW" where R is running, S is
+ * sleeping in an interruptible wait, D is waiting in uninterruptible
+ * disk sleep, Z is zombie, T is traced or stopped (on a signal), and W
+ * is paging.*/</font>
+ PROP_STATE = "State",
+
+ <font color=#3F5FBF>/** System ID of the parent process */</font>
+ PROP_PPID = "PPID",
+
+ <font color=#3F5FBF>/** The process group ID of the process */</font>
+ PROP_PGRP = "PGRP",
+
+ <font color=#3F5FBF>/** The session ID of the process */</font>
+ PROP_SESSION = "Session",
+
+ <font color=#3F5FBF>/** The tty the process uses */</font>
+ PROP_TTY = "TTY",
+
+ <font color=#3F5FBF>/** The process group ID of the process which currently owns the tty that
+ * the process is connected to. */</font>
+ PROP_TGID = "TGID",
+
+ <font color=#3F5FBF>/** ID of a process that has attached this process for tracing or debugging */</font>
+ PROP_TRACERPID = "TracerPID",
+
+ <font color=#3F5FBF>/** The kernel flags word of the process. Details depend on the kernel */</font>
+ PROP_FLAGS = "Flags",
+
+ <font color=#3F5FBF>/** The number of minor faults the process has made which have not
+ * required loading a memory page from disk */</font>
+ PROP_MINFLT = "MinFlt",
+
+ <font color=#3F5FBF>/** The number of minor faults that the process's waited-for children have made */</font>
+ PROP_CMINFLT = "CMinFlt",
+
+ <font color=#3F5FBF>/** The number of major faults the process has made which have required
+ * loading a memory page from disk */</font>
+ PROP_MAJFLT = "MajFlt",
+
+ <font color=#3F5FBF>/** The number of major faults that the process's waited-for children
+ * have made */</font>
+ PROP_CMAJFLT = "CMajFlt",
+
+ <font color=#3F5FBF>/** The number of milliseconds that this process has been scheduled in user mode */</font>
+ PROP_UTIME = "UTime",
+
+ <font color=#3F5FBF>/** The number of milliseconds that this process has been scheduled in kernel mode */</font>
+ PROP_STIME = "STime",
+
+ <font color=#3F5FBF>/** The number of jiffies that this process's waited-for children have
+ * been scheduled in user mode */</font>
+ PROP_CUTIME = "CUTime",
+
+ <font color=#3F5FBF>/** The number of jiffies that this process's waited-for children have
+ * been scheduled in user mode */</font>
+ PROP_CSTIME = "CSTime",
+
+ <font color=#3F5FBF>/** The standard nice value */</font>
+ PROP_PRIORITY = "Priority",
+
+ <font color=#3F5FBF>/** The nice value */</font>
+ PROP_NICE = "Nice",
+
+ <font color=#3F5FBF>/** The time in milliseconds before the next SIGALRM is sent to the process
+ * due to an interval timer */</font>
+ PROP_ITREALVALUE = "ITRealValue",
+
+ <font color=#3F5FBF>/** The time in milliseconds the process started after system boot */</font>
+ PROP_STARTTIME = "StartTime",
+
+ <font color=#3F5FBF>/** Virtual memory size in bytes */</font>
+ PROP_VSIZE = "VSize",
+
+ <font color=#3F5FBF>/** Memory pages size in bytes */</font>
+ PROP_PSIZE = "PSize",
+
+ <font color=#3F5FBF>/** Resident Set Size: number of pages the process has in real memory,
+ * minus used for administrative purposes. This is just the pages which
+ * count towards text, data, or stack space. This does not include
+ * pages which have not been demand-loaded in, or which are swapped out */</font>
+ PROP_RSS = "RSS",
+
+ <font color=#3F5FBF>/** Current limit in bytes on the rss of the process */</font>
+ PROP_RLIMIT = "RLimit",
+
+ <font color=#3F5FBF>/** The address above which program text can run */</font>
+ PROP_CODESTART = "CodeStart",
+
+ <font color=#3F5FBF>/** The address below which program text can run */</font>
+ PROP_CODEEND = "CodeEnd",
+
+ <font color=#3F5FBF>/** The address of the start of the stack */</font>
+ PROP_STACKSTART = "StackStart",
+
+ <font color=#3F5FBF>/** The bitmap of pending signals */</font>
+ PROP_SIGNALS = "Signals",
+
+ <font color=#3F5FBF>/** The bitmap of blocked signals */</font>
+ PROP_SIGBLOCK = "SigBlock",
+
+ <font color=#3F5FBF>/** The bitmap of ignored signals */</font>
+ PROP_SIGIGNORE = "SigIgnore",
+
+ <font color=#3F5FBF>/** The bitmap of caught signals */</font>
+ PROP_SIGCATCH = "SigCatch",
+
+ <font color=#3F5FBF>/** This is the "channel" in which the process is waiting. It is the
+ * address of a system call, and can be looked up in a name list if you
+ * need a textual name */</font>
+ PROP_WCHAN = "WChan",
+
+ <font color=#3F5FBF>/** Number of pages swapped */</font>
+ PROP_NSWAP = "NSwap",
+
+ <font color=#3F5FBF>/** Cumulative NSwap for child processes */</font>
+ PROP_CNSWAP = "CNSwap",
+
+ <font color=#3F5FBF>/** Signal to be sent to parent when this process exits */</font>
+ PROP_EXITSIGNAL = "ExitSignal",
+
+ <font color=#3F5FBF>/** CPU number last executed on */</font>
+ PROP_PROCESSOR = "Processor",
+
+ <font color=#3F5FBF>/** Real-time scheduling priority */</font>
+ PROP_RTPRIORITY = "RTPriority",
+
+ <font color=#3F5FBF>/** Scheduling policy */</font>
+ PROP_POLICY = "Policy";
+
+
+ <font color=#3F5FBF>/**
+ * A context corresponds to an execution thread, process, address space, etc.
+ * A context can belong to a parent context. Contexts hierarchy can be simple
+ * plain list or it can form a tree. It is up to target agent developers to choose
+ * layout that is most descriptive for a given target. Context IDs are valid across
+ * all services. In other words, all services access same hierarchy of contexts,
+ * with same IDs, however, each service accesses its own subset of context's
+ * attributes and functionality, which is relevant to that service.
+ */</font>
+ <font color=#7F0055>interface</font> SysMonitorContext {
+
+ <font color=#3F5FBF>/**
+ * Get context ID.
+ * Same as getProperties().get(“ID”)
+ */</font>
+ String getID();
+
+ <font color=#3F5FBF>/**
+ * Get parent context ID.
+ * Same as getProperties().get(“ParentID”)
+ */</font>
+ String getParentID();
+
+ <font color=#3F5FBF>/**
+ * Get process group ID.
+ * Same as getProperties().get(“PGRP”)
+ */</font>
+ <font color=#7F0055>long</font> getPGRP();
+
+ <font color=#3F5FBF>/**
+ * Get process ID.
+ * Same as getProperties().get(“PID”)
+ */</font>
+ <font color=#7F0055>long</font> getPID();
+
+ <font color=#3F5FBF>/**
+ * Get process parent ID.
+ * Same as getProperties().get(“PPID”)
+ */</font>
+ <font color=#7F0055>long</font> getPPID();
+
+ <font color=#3F5FBF>/**
+ * Get process TTY group ID.
+ * Same as getProperties().get(“TGID”)
+ */</font>
+ <font color=#7F0055>long</font> getTGID();
+
+ <font color=#3F5FBF>/**
+ * Get tracer process ID.
+ * Same as getProperties().get(“TracerPID”)
+ */</font>
+ <font color=#7F0055>long</font> getTracerPID();
+
+ <font color=#3F5FBF>/**
+ * Get process owner user ID.
+ * Same as getProperties().get(“UID”)
+ */</font>
+ <font color=#7F0055>long</font> getUID();
+
+ <font color=#3F5FBF>/**
+ * Get process owner user name.
+ * Same as getProperties().get(“UserName”)
+ */</font>
+ String getUserName();
+
+ <font color=#3F5FBF>/**
+ * Get process owner user group ID.
+ * Same as getProperties().get(“UGID”)
+ */</font>
+ <font color=#7F0055>long</font> getUGID();
+
+ <font color=#3F5FBF>/**
+ * Get process owner user group name.
+ * Same as getProperties().get(“GroupName”)
+ */</font>
+ String getGroupName();
+
+ <font color=#3F5FBF>/**
+ * Get process state.
+ * Same as getProperties().get(“State”)
+ */</font>
+ String getState();
+
+ <font color=#3F5FBF>/**
+ * Get process virtual memory size in bytes.
+ * Same as getProperties().get(“VSize”)
+ */</font>
+ <font color=#7F0055>long</font> getVSize();
+
+ <font color=#3F5FBF>/**
+ * Get process virtual memory page size in bytes.
+ * Same as getProperties().get(“PSize”)
+ */</font>
+ <font color=#7F0055>long</font> getPSize();
+
+ <font color=#3F5FBF>/**
+ * Get number of memory pages in process resident set.
+ * Same as getProperties().get(“RSS”)
+ */</font>
+ <font color=#7F0055>long</font> getRSS();
+
+ <font color=#3F5FBF>/**
+ * Get context executable file.
+ * Same as getProperties().get(“File”)
+ */</font>
+ String getFile();
+
+ <font color=#3F5FBF>/**
+ * Get context current file system root.
+ * Same as getProperties().get(“Root”)
+ */</font>
+ String getRoot();
+
+ <font color=#3F5FBF>/**
+ * Get context current working directory.
+ * Same as getProperties().get(“CWD”)
+ */</font>
+ String getCurrentWorkingDirectory();
+
+ <font color=#3F5FBF>/**
+ * Get all available context properties.
+ * @return Map 'property name' -> 'property value'
+ */</font>
+ Map&lt;String,Object&gt; getProperties();
+ }
+
+ <font color=#3F5FBF>/**
+ * Get context command line.
+ */</font>
+ IToken getCommandLine(String id, DoneGetCommandLine done);
+
+ <font color=#7F0055>interface</font> DoneGetCommandLine {
+ <font color=#7F0055>void</font> doneGetCommandLine(IToken token, Exception error, String[] cmd_line);
+ }
+
+ <font color=#3F5FBF>/**
+ * Get context environment variables.
+ */</font>
+ IToken getEnvironment(String id, DoneGetEnvironment done);
+
+ <font color=#7F0055>interface</font> DoneGetEnvironment {
+ <font color=#7F0055>void</font> doneGetEnvironment(IToken token, Exception error, String[] environment);
+ }
+}
+</pre>
+
+</body>
+</html>
diff --git a/docs/TCF Services.html b/docs/TCF Services.html
new file mode 100644
index 000000000..38377555c
--- /dev/null
+++ b/docs/TCF Services.html
@@ -0,0 +1,108 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <title>Target Communication Framework Services</title>
+</head>
+
+<body lang='EN-US'>
+
+<h1>Target Communication Framework Services</h1>
+
+<p>Copyright (c) 2007 Wind River Systems, Inc. Made available under the EPL v1.0
+<p>Direct comments, questions to the <a href="mailto:dsdp-tm-dev@eclipse.org">dsdp-tm-dev@eclipse.org</a> mailing list
+
+<h2>Table of Contents</h2>
+<ul>
+ <li><a href='#Overview'>Overview</a>
+ <li><a href='#Syntax'>Syntax Rules Notation</a>
+ <li><a href='#ErrorFormat'>Error Report Format</a>
+ <li><a href='#Services'>Services</a>
+</ul>
+
+<h2><a name='Overview'>Overview</a></h2>
+
+TCF communication model is based on the idea of services. A service is a group of related commands, events and semantics.
+For example, <a href='TCF Service - Memory.html'>Memory Service</a> defines group of command and events for
+reading and writing target memory.
+Service definitions are not part of the <a href='TCF Specification.html'>framework specification</a>, and new services
+are expected to be defined by developers of tools and target agents.
+Defenitions of standard services are provided to achieve certain level of compatibility between tools and targets.
+
+<h2><a name='Syntax'>Syntax Rules Notation</a></h2>
+
+<p>Format of the protocol messages is defined by syntax rules. Syntax is described
+using a simple variant of Backus-Naur Form. In particular:</p>
+
+<ul type='disc'>
+ <li>Italic lower case words in a courier font, enclosed into angular brackets, are
+ used to denote syntactic categories, for example:&nbsp;<b><i><font face="Courier New" size=2 color=#333399>&lt;token&gt;.
+ </font></i></b>Category name can be followed by colon and a text, which explains semantics
+ of the category, for example: <b><i><font face="Courier New" size=2 color=#333399>&lt;int:
+ error code&gt;</font></i></b> has same meaning as <b><i><font face="Courier New" size=2 color=#333399>&lt;int&gt;</font></i></b>,
+ but denotes that the integer number used to indicate an "error code".
+
+ <li>A syntax rule consists of a category designation followed by one or more syntax
+ definitions for the category. The category name and each definition are placed on
+ separate lines, bullets are used to denote definitions, for example:
+</ul>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;chars&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;char&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;chars&gt; &lt;char&gt;</i>
+</font></b></pre>
+
+<ul type='disc'>
+ <li>Spaces are added for readability only and they are not part of the syntax.
+
+ <li>All text in the category definition, other than categories and spaces, is UTF-8
+ based representation of a message bytes.
+
+ <li>The symbol ‘•’ designates a zero byte.
+</ul>
+
+<h2><a name='ErrorFormat'>Error Report Format</a></h2>
+
+<p>Most of TCF standard services use same format for error reporting:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;error report&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;int: error code&gt;</i> • <i>&lt;error description&gt;</i>
+</font></b></pre>
+
+<p>Error code zero means success. Error description provides a short, localizable,
+human readable explanation of error.</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;error description&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+ <font face=Wingdings>Ψ</font> <i>&lt;string&gt;</i>
+ <font face=Wingdings>Ψ</font> { "format" : <i>&lt;string&gt;</i> , "params" : [ <i>&lt;params&gt;</i> ] }
+
+<i>&lt;params&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;value&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;params&gt;</i> , <i>&lt;value&gt;</i>
+</font></b></pre>
+
+<p>For <b><i><font face="Courier New" size=2 color=#333399>&lt;string&gt;</font></i></b>
+and <b><i><font face="Courier New" size=2 color=#333399>&lt;value&gt;</font></i></b> encoding see
+<a href='TCF Specification.html#JSON'>JSON - Preferred Marshaling</a>.
+Error description format supports separation between constant and variable parts
+of the message ("format" and "params"). This is done to support localization. See
+Java class <b><font face="Courier New" size=2>java.text.MessageFormat</font></b> for details.</p>
+
+<h2><a name='Services'>Services</h2>
+<ul>
+ <li><a href='TCF Service - Memory.html'>Memory Service</a>
+ <li><a href='TCF Service - Processes.html'>Processes Service</a>
+ <li><a href='TCF Service - Run Control.html'>Run Control Service</a>
+ <li><a href='TCF Service - Registers.html'>Registers Service</a>
+ <li><a href='TCF Service - Stack Trace.html'>Stack Trace Service</a>
+ <li><a href='TCF Service - Breakpoints.html'>Breakpoints Service</a>
+ <li><a href='TCF Service - File System.html'>File System Service</a>
+ <li><a href='TCF Service - System Monitor.html'>System Monitor Service</a>
+</ul>
+
+</body>
+</html>
+ \ No newline at end of file
diff --git a/docs/TCF Specification Image1.png b/docs/TCF Specification Image1.png
new file mode 100644
index 000000000..85933f613
--- /dev/null
+++ b/docs/TCF Specification Image1.png
Binary files differ
diff --git a/docs/TCF Specification.html b/docs/TCF Specification.html
new file mode 100644
index 000000000..2aec03f3f
--- /dev/null
+++ b/docs/TCF Specification.html
@@ -0,0 +1,1407 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <title>Target Communication Framework Specification</title>
+</head>
+<body lang='EN-US'>
+
+<h1>Target Communication Framework Specification</h1>
+
+<p>Copyright (c) 2007 Wind River Systems, Inc. Made available under the EPL v1.0
+<p>Direct comments, questions to the <a href="mailto:dsdp-tm-dev@eclipse.org">dsdp-tm-dev@eclipse.org</a> mailing list
+
+<h1>Table of Contents</h1>
+
+<ul>
+ <li><a href='#Overview'>Overview</a>
+ <ul>
+ <li><a href='#Goals'>Goals</a>
+ <li><a href='#Definitions'>Definitions</a>
+ <li><a href='#Requirements'>Requirements</a>
+ <li><a href='#Syntax'>Syntax Rules Notation</a>
+ </ul>
+ <li><a href='#Design'>Framework Software Design Considerations</a>
+ <ul>
+ <li><a href='#Concurrency'>Concurrency</a>
+ <li><a href='#Reflection'>Reflection</a>
+ <li><a href='#Ordering'>Message ordering</a>
+ </ul>
+ <li><a href='#Transport'>Transport Layer</a>
+ <li><a href='#Protocol'>Communication Protocol</a>
+ <ul>
+ <li><a href='#ProtocolCommands'>Commands</a>
+ <li><a href='#ProtocolResults'>Results</a>
+ <li><a href='#ProtocolEvents'>Events</a>
+ <li><a href='#ProtocolFlowControl'>Flow Control</a>
+ <li><a href='#ProtocolExamples'>Examples</a>
+ </ul>
+ <li><a href='#API'>API</a>
+ <li><a href='#JSON'>JSON - Preferred Marshaling</a>
+ <ul>
+ <li><a href='#JSONExamples'>JSON - Examples</a>
+ </ul>
+ <li><a href='#Locator'>Locator Service</a>
+ <ul>
+ <li><a href='#LocatorPeer'>Peer Attributes</a>
+ <li><a href='#LocatorCommands'>Locator Service Commands</a>
+ <li><a href='#LocatorEvents'>Locator Service Events</a>
+ <li><a href='#LocatorAPI'>Locator Service API</a>
+ </ul>
+</ul>
+
+<h1><a name='Overview'>Overview</a></h1>
+
+<p>Today almost every device software development tool on the market has its own method
+of communication with target system. Communication methods often require individual setup,
+configuration and maintenance, impose unnecessary limitations.
+Target Communication Framework goal is to establish common ground in
+the area of communication protocols between development tools and embedded devices.</p>
+
+<p>The goal is a single protocol used to communicate between all tools and targets:</p>
+<p><img src='TCF Specification Image1.png'></p>
+
+<h2><a name='Goals'>Goals</a></h2>
+
+<ul type='disc'>
+ <li>Universal, simple, lightweight, vendor agnostic framework for tools and targets
+ to communicate for purpose of debugging, profiling, code patching and other device
+ software development needs.
+
+ <li>Single configuration per target (not per tool per target as today in most cases),
+ or no configuration when possible.
+
+ <li>Minimal overhead and footprint on target side.
+</ul>
+
+<h2><a name='Definitions'>Definitions</a></h2>
+
+<dl>
+<dt><b>Peer:</b> <dd>communication endpoint. Both hosts and targets are called peers. A
+peer can act as a client or a server depending on services it implements.
+
+<dt><b>Service:</b> <dd>group of related commands, events and semantic define a service.
+A service can be discovered, added or removed as a group at communication endpoint.
+
+<dt><b>Message:</b> <dd>a packet of data, formatted according to framework specification
+and transmitted over communication channel.
+
+<dt><b>Channel:</b> <dd>communication link connecting two endpoints (peers).  A single
+channel may be used to communicate with multiple services.  Multiple channels may
+be used to connect the same peers, however no command or event ordering is guaranteed
+across channels.
+
+<dt><b>Command:</b> <dd>command is a message sent to remote peer in order to request some
+predefined action there.
+
+<dt><b>Result:</b> <dd>result is a message sent as a response to a command.
+
+<dt><b>Event:</b> <dd>event is a message sent to all interested parties in order to notify
+them about state changes.
+</dl>
+
+<h2><a name='Requirements'>Requirements</a></h2>
+
+<ul type='disc'>
+ <li>Simple and extensible protocol.
+
+ <li>Small footprint on the target.
+
+ <li>Fully asynchronous, message based communication.
+
+ <li>Two ways of message routing:
+
+ <ul>
+ <li>Point to point request/response (command/result) communication.
+
+ <li>Subscription based broadcast of notifications (events).
+ </ul>
+
+ <li>Full duplex, symmetric communication: both host and target should be able to send
+ commands and events at same time, though ability to establish communication channel
+ can be limited to host only.
+
+ <li>For each communication channel between two peers, the framework should preserve
+ order of commands, results and events.
+
+ <li>Support for slow and high latency connections.
+
+ <li>Transport protocol agnostic. The framework should work well, at least, on top
+ of: TCP/IP, UDP, USB, RS232 and JTAG.
+
+ <li>The framework should support multiplexing, that is, single target device shared
+ between multiple tools at same time. To reduce footprint on the target, multiplexing
+ can be implemented on host if needed.
+
+ <li>Dynamic discovery of participating targets and hosts. No configuration when possible.
+
+ <li>Dynamic discovery of available services (high level protocols, command sets).
+ Clients can query for available services.
+
+ <li>Services can be added and removed dynamically.
+
+ <li>Framework should define a set of common high level interfaces (services).  For
+ example: flow control, memory access, registers access, up-load mechanism, kernel
+ awareness, run control, target file system, console, flash programming. Implementation
+ of these interfaces is optional, but if provided it will support much wider compatibility
+ with various tools.
+
+ <li>Framework should be layered in such a way so it is possible to use different transport
+ medias (e.g. TCP/IP, RS232, USB, etc) without any changes to individual services. 
+ In other words, transport implementation should be services agnostic, and services
+ implementation should be transport agnostic.
+
+ <li>Each service defines how marshalling is done for command, result and event arguments.
+ This allows existing target agents to remain unchanged.
+
+ <li>Framework should define a preferred marshalling mechanism that new services can
+ use.
+
+ <li>The definition of services (groups of related commands and events) is separate
+ from the definition of the framework itself.  The framework provides unified communication
+ mechanism, while services use it to communicate with its clients.
+
+ <li>Anybody (including 3rd parties) can add services without having to modify communication
+ protocol or framework software.
+
+ <li>The framework should support tunneling through a proxy. Proxy may be used, for
+ example:
+
+ <ul type='circle'>
+ <li>to bridge different transport protocols, like TCP and RS232;
+
+ <li>to make a RS232 or USB target connection accessible from multiple hosts;
+
+ <li>to access targets behind firewalls or otherwise not directly accessible
+ </ul>
+
+ <li>A proxy should be able to provide services in addition to those implemented by
+ a target. Such distribution of services allows target services to be implemented on
+ a host, thereby reducing the footprint on the target. For example, debug information,
+ stack back trace or OS awareness can be implemented by a proxy on a host. To provide
+ this functionality, proxy services would typically use low-level target services,
+ like memory access.
+
+ <li>Supports of concurrent requests. Maximum number of concurrent requests (window
+ size) can be limited on target side. Simple agents only have to support window size
+ of 1. Framework should maintain a queue of additional requests, so tools don’t need
+ to know the window size. This may only be relevant for certain transport protocols
+ e.g. UDP.
+
+ <li>Events can be broadcasted at any time, i.e. no polling should be required.
+
+ <li>Protocol should support a standard mechanism of sending data larger than MTU.
+</ul>
+
+<h2><a name='Syntax'>Syntax Rules Notation</a></h2>
+
+<p>Format of the protocol messages is defined by syntax rules. Syntax is described
+using a simple variant of Backus-Naur Form. In particular:</p>
+
+<ul type='disc'>
+ <li>Italic lower case words in a courier font, enclosed into angular brackets, are
+ used to denote syntactic categories, for example: <b><i><font face="Courier New" size=2 color=#333399>&lt;token&gt;.
+ </font></i></b>Category name can be followed by colon and a text, which explains semantics
+ of the category, for example: <b><i><font face="Courier New" size=2 color=#333399>&lt;int:
+ error code&gt;</font></i></b> has same meaning as <b><i><font face="Courier New" size=2 color=#333399>&lt;int&gt;</font></i></b>,
+ but denotes that the integer number used to indicate an “error code”.
+
+ <li>A syntax rule consists of a category designation followed by one or more syntax
+ definitions for the category. The category name and each definition are placed on
+ separate lines, bullets are used to denote definitions, for example:
+ <pre><b><font face="Courier New" size=2 color=#333399>
+ <i>&lt;chars&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;char&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;chars&gt; &lt;char&gt;</i>
+ </font></b></pre>
+
+ <li>Spaces are added for readability only and they are not part of the syntax.
+
+ <li>All text in the category definition, other then categories and spaces, is UTF-8
+ based representation of a message bytes.
+
+ <li>The symbol ‘•’ designates a zero byte.
+</ul>
+
+<h1><a name='Design'>Framework Software Design Considerations</a></h1>
+
+<p>The framework will be packaged, distributed and installed on a host as separate
+product. It should be installed as system service and require no configuration for
+most common case – target connected over TCP or UDP on a local network. For more complicated
+setup, framework should have easily accessible and user friendly GUI with all relevant
+configuration options.</p>
+
+<p>Framework should use a dynamic discovery protocol to locate targets and other hosts
+running instances of the framework when possible, and maintain a dynamic list of available
+communication endpoints, as well as lists of services available at each endpoint.
+Host discovery is needed to locate hosts able to proxy communications for targets,
+which are not accessible otherwise - for example, targets connected with RS232 or
+JTAG to a remote host. It should also be possible to add target configuration manually.
+Development tools will access this data through the Locator Service API and use it,
+for example, to present a user a list of available targets that have capabilities
+needed by a particular tool.</p>
+
+<p>Framework should provide software libraries to be used by tools and target agents
+developers. The libraries should be available at least for ANSI C and Java. On host
+side, at least Windows, Solaris and Linux must be supported. Libraries will provide
+APIs for low-level communication protocol, Locator Service, preferred marshaling and
+predefined common services.</p>
+
+<p>The proposed target communication protocol is text-based. It allows extensions,
+which define messages with blocks of binary data, but it is not a recommended data
+formatting, and its usage is supposed to be limited. Text-based protocols have both
+advantages and disadvantages in compare with binary protocols.</p>
+
+<p>Advantages:</p>
+
+<ul type='disc'>
+ <li>The software for text-based protocols is easier to develop and debug since they
+ use a relatively human-friendly communication.
+
+ <li>It is possible to use huge selection of existing tools and library routines to
+ view, edit, validate, and transform text-based data.
+
+ <li>Text based definition is in line with current trend in Internet protocols: most
+ popular protocols such as SMTP and HTTP are text-based.
+</ul>
+
+<p>Disadvantages:</p>
+
+<ul type='disc'>
+ <li>Text-based protocols usually need more bytes to store numerical data than binary
+ protocols do.
+
+ <li>Parsing of text-based data is not efficient compared to parsing of binary data
+ since text-based data is usually not stored in a way similar to how it is stored in
+ computer memory.
+
+ <li>It is seldom possible to read only part of a text-based message since the exact
+ byte offset to a data item is generally not known.
+</ul>
+
+<p>A possible alternative to consider is binary, variable length encoding like BaseStream.</p>
+
+<h2><a name='Concurrency'>Concurrency</a></h2>
+
+<p>Concurrent asynchronous communication is much faster then synchronous, because
+it alleviates communication channel latency and allows better bandwidth utilization.
+But it also requires proper design of framework software. Concurrency, in general,
+implies multithreading. However, systems developed with global multithreading, are
+often unreliable and prone to different kinds of thread synchronization problems,
+which are often very difficult to locate and resolve. We therefore strongly recommend
+that the software is designed to follow the compartment threading model, which simplifies
+thread synchronization and promotes reliable software design. In this model each thread
+execution path is strictly contained in predefined subset of code (compartment), and
+no code, except for reentrant libraries, is executed by multiple threads. Each compartment
+has a message queue and other threads communicate with the compartment thread by posting
+messages to the queue.</p>
+
+<p>Framework APIs are designed to be compatible with the compartment threading model.
+Hence the API functions do not contain any thread synchronization primitives to protect
+against multiple threads using the functions. All framework APIs belong to a single
+compartment and should be used by a single thread. The same thread is used to dispatch
+events and command results. Concurrency is achieved by declaring API functions to
+be asynchronous. Asynchronous functions do not have any return value, and returns
+immediately, most of the time before the intended job is done. They take additional
+arguments to specify a callback function and callback data. In object-oriented languages
+such as Java, this is typically done by a single callback object argument containing
+both the data and the function.  The result listener is called asynchronously when
+the job is done. This approach is commonly known as asynchronous<b>, </b>event-driven<b>
+</b>or<b> </b>callback-based<b> </b>programming<b>.</b></p>
+
+<p>One important characteristic of an asynchronous code is that the methods defined
+by the user will often be called from within the framework itself, rather than from
+the user's application code. The framework often plays the role of the main program
+in coordinating and sequencing application activity. This phenomenon is called Inversion
+of Control (also known as the Hollywood Principle - "Don't call us, we'll call you").</p>
+
+<h2><a name='Reflection'>Reflection</a></h2>
+
+<p>Communication between development tools and embedded devices must allow a host
+to collect target side data and build a reflection of target state. Reflection is
+usually incomplete – a subset of all remote data. Reflection is always delayed – it
+represents a remote peer state in the past. Reflection can be updated by polling for
+data changes or by listening to events (event is communication message that is sent
+asynchronously by a peer to notify others about state change). Reflection is correct
+if it represents a state that actually did happen on remote peer.</p>
+
+<p>Reflection is coherent if it is exactly equal to subset of peer state at a single
+moment of time and that moment of time is not too far in the past. Non-coherent reflection
+can have parts of data representing peer state at different moments of time. Coherent
+reflection is more valuable for a user, because non-coherent reflection can have logically
+conflicting data if that data was collected at different time.</p>
+
+<p>Traditionally, debuggers would ensure coherence of state reflection by collecting
+data only while target is suspended, and flushing all (or most) reflection data (reducing
+observed subset to zero) when target is resumed. This approach does not work well
+for multithreaded, multicore or real time targets. Maintaining correctness and coherence
+of a non-empty reflection while target is running requires additional support from
+target agent, communication software and debugger itself.</p>
+
+<p>Since remote peer state is changing over time, coherent reflection can be built
+only if:</p>
+
+<ul type='disc'>
+ <li>Observed subset of state is properly selected and dynamically re-selected. Observing
+ too much can overflow communication channel. Observing too little has little value
+ for a user.
+
+ <li>Observer is listening to all relevant events.
+
+ <li>Events are coming in exactly same order as corresponding changes happen.
+
+ <li>Events are properly ordered relative to other messages that carry state data.
+
+ <li>All changes in observed subset of peer state are reported by events.
+
+ <li>All event messages must either contain a complete description of a change or they
+ all should not contain any state data at all. If client is getting some data from
+ events and required to retrieve new values of other changed data by using other means
+ (commands), the reflection will not be coherent at least until such retrieval is complete.
+ And if such periods of data retrieval overlap, the reflection will never be coherent.
+ Sending deltas with events is usually more efficient then using data retrieval commands
+ to update reflection.
+</ul>
+
+<h2><a name='Ordering'>Message ordering</a></h2>
+
+<p>The transmission order of commands, results and events is important, it coveys
+valuable information about target state transitions and it should be preserved when
+possible. Consider an example:</p>
+
+<p>Client transmits: </p>
+
+<pre>
+ Command X=2
+</pre>
+
+<p>Then, as result of some activity of another client or the target itself, X is assigned
+value 3.</p>
+
+<p>Target transmits:</p>
+
+<pre>
+ Event X=3
+ Result X=2
+</pre>
+
+<p>Now client has to show value of X to a user. If the order of messages is preserved,
+the client will know that command was executed <i>after</i> X was assigned 3, the
+last message contains last known value of X and 2 is the correct value to show. If
+the target is allowed to transmit events and results in arbitrary order, the client
+will have no clue what to show – 2 or 3. In fact, the client will have to make a tough
+decision about each message it receives: either trust message data as correct last
+known target state, or assume the message came in out-of-order and ignore it, or re-request
+the information from the target.</p>
+
+<p>Note that re-requesting data from the target, in general, does not solve the problem
+of interpretation of messages when order is not preserved. For example, after sending
+a request to read value of X, X could change at about the same time, and client could
+receive:</p>
+
+<pre>
+ Event X=2
+ Result X=3
+ Event X=4
+</pre>
+
+<p>If order is not preserved, it is still impossible to tell which value of X is the
+last one. A client could assume value of X unknown every time it receives a notification
+of X change, and then re-request the data again. But this is expensive and, if events
+coming in frequently, client can end up in infinite loop re-requesting the data again
+and again, and it will never have trustworthy data about current target state.</p>
+
+<p>Developers should be careful when using multithreading or multiple queues in software
+design – it can easily cause message reordering.</p>
+
+<p>The framework itself is required to preserve message order. However, if for whatever
+reason a target agent cannot preserve message order, the result will be that clients
+of the service can receive messages in the wrong order. When this is the case it should
+be well documented, so tools developers are aware and can make the best of the situation.
+In most cases it will not cause any trouble, but there is no perfect way to restore
+actual sequence of events and maintain data coherency after ordering was lost, and
+in some cases it can severely impact tool functionality and user experience.</p>
+
+<h1><a name='Transport'>Transport Layer</a></h1>
+
+
+<p>Tools are required to be transport protocol agnostic, so most of the layer functionality
+is used internally by framework and is not exposed to clients. This layer maintains
+a collection of transport protocol handlers. Each handler is designed to provide:</p>
+
+<ul type='disc'>
+ <li>Enumeration of available peers, including both automatically discovered and manually
+ configured peers. Handler fires notification events when peers are added or removed.
+ Enumeration can be implemented by scanning JTAG chain, by broadcasting special UDP
+ packet and waiting for responses, by communicating with ICE hardware, or by any other
+ suitable means.
+
+ <li>Bidirectional point-to-point communication of data packets. Packets are arrays
+ of bytes of arbitrary size.
+ Transport handler and underlying protocol are responsible for adding all necessary
+ control data, headers, error checking bits, addresses, fragmentation/defragmentation,
+ flow control, transmission retries and whatever necessary to ensure lossless, order-preserving
+ delivery of packets.
+
+ <li>Configuration UI should allow user to inspect and modify properties of both manually
+ configured and automatically discovered peers, setup new peers, view connections status
+ and statistics.
+</ul>
+
+<p>Existing service discovery protocols can be used together with the framework, for
+example:</p>
+
+<ul type='disc'>
+ <li>Zero Configuration Networking (Zeroconf), see <a href='http://www.zeroconf.org/'>http://www.zeroconf.org</a>;
+
+ <li>Service Location Protocol (SLP), developed by the IETF;
+
+ <li>Jini, which is Sun’s Java-base approach to service discovery, see <a href='http://www.sun.com/jini'>http://www.sun.com/jini</a>;
+
+ <li>Salutation, developed by an open industry consortium, called the Salutation Consortium;
+
+ <li>Microsoft’s Universal Plug and Play (UPnP), see <a href='http://www.upnp.org/'>http://www.upnp.org</a>;
+
+ <li>Bluetooth Service Discovery Protocol (SDP).
+</ul>
+
+<p>Service discovery protocols, as well as transport protocols will be supported by
+framework plug-ins, they are not part of framework code itself, and they can be developed
+by 3rd parties. Note that existing discovery protocols define term “service” differently
+- as an independent communication endpoint (usually a TCP/IP port). In this document
+it is called “peer” (host, target, communication endpoint), and a peer can provide
+multiple services over single communication channel.</p>
+
+<p>Using of standard discovery protocols should be optional, because it can potentially
+cause conflict or interference between development tools and application being developed
+over a use of same standard protocol – devices software often includes implementation
+of service discovery protocols as part of application code to support their main functions.
+</p>
+
+<h1><a name='Protocol'>Communication Protocol</a></h1>
+
+<p>The communication protocol defines data packets properties and roles common for
+all services. The communication protocol API provides functions for opening and /closing
+of the communication channel for a particular peer, and for sending and receiving
+data packets. The protocol define contents of a part of a packet, the rest of the
+packet is treated as array of bytes at this level. The communication protocol implementation
+also provides:</p>
+
+<ul type='disc'>
+ <li>Multiplexing – opening multiple channels per peer.
+
+ <li>Proxy – packet forwarding in behalf of other hosts.
+</ul>
+
+<p>Protocol defines three packet types: commands (requests), results (responses),
+and events. Each packet consists of several protocol defined control fields followed
+by byte array of data. Binary representation of control fields is a sequence of zero
+terminated ASCII strings. Format of data array depends on a service. We recommend
+using framework preferred marshaling for data formatting.</p>
+
+<p>Syntax:</p>
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;message&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;command&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;result&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;event&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;flow control message&gt;</i>
+</font></b></pre>
+
+<h2><a name='ProtocolCommands'>Commands</a></h2>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;command&gt;</i>
+ <font face=Wingdings>Ψ</font> C • <i>&lt;token&gt; </i>• <i>&lt;service name&gt; </i>• <i>&lt;command name&gt; </i>• <i>&lt;byte array: arguments&gt;</i>
+</font></b></pre>
+
+<p>Command packets start with string “C”.</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;token&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;chars&gt;</i>
+</font></b></pre>
+
+<p>Token is unique string generated by framework for each command. It is used to match
+results to commands.</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;service name&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;chars&gt;</i>
+</font></b></pre>
+
+<p>Service name is used to identify a service that handles the command, it is same
+string as returned by Service.getName().</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;command name&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;chars&gt;</i>
+</font></b></pre>
+
+<p>Command name interpretation depends on a service.</p>
+
+<p>A command should always be answered with result packed. Result does not have to
+be positive – it can include an error code, but there always must be one. Since client
+cannot detect that a response is missing, if for some reasons peer is not able to
+answer a command, it should consider such situation a fatal communication error and
+it must shutdown the communication channel. It is not necessary to wait for result
+before sending next command. In fact, sending multiple commands in a burst can greatly
+improve performance, especially when connection has high latency. At the same time,
+clients should be carefully designed to avoid flooding the communication channel with
+unlimited number of requests, since this will use resources in forms of memory to
+store the requests and time to process them.</p>
+
+<h2><a name='ProtocolResults'>Results</a></h2>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;result&gt;</i>
+ <font face=Wingdings>Ψ</font> R • <i>&lt;token&gt;</i> • <i>&lt;byte array: result data&gt;</i>
+ <font face=Wingdings>Ψ</font> P • <i>&lt;token&gt;</i> • <i>&lt;byte array: result data&gt;</i>
+</font></b></pre>
+
+<p>Result packets start with string “P” for intermediate result and “R” for final
+result. Receiving of “R” result concludes execution of corresponding command.
+There should be exactly one “R” result for each command. In addition, command execution can produce any number of
+intermediate “P” results. “P” results can be sent before “R”, and it can serve, for
+example, as command execution progress report when execution takes long time.</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;token&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;chars&gt;</i>
+</font></b></pre>
+
+<p>Token should match token field of one of the pending commands that produced the result.</p>
+
+<h2><a name='ProtocolEvents'>Events</a></h2>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;event&gt;</i>
+ <font face=Wingdings>Ψ</font> E • <i>&lt;service name&gt;</i> • <i>&lt;event name&gt;</i> • <i>&lt;byte array: event data&gt;</i>
+</font></b></pre>
+
+<p>Event packets start with string “E”.</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;service name&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;chars&gt;</i>
+</font></b></pre>
+
+<p>Service name identifies a service that fired event, same string as returned by
+Service.getName().</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;event name&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;chars&gt;</i>
+</font></b></pre>
+
+<p>Event name meaning depends on a service.</p>
+
+<p>Events are used to notify clients about changes in peer state. Services should
+provide sufficient variety of events for clients to track remote peer state without
+too much of polling. Clients, interested in a particular aspect of the target state,
+should have a “reflection” (or “model”) of that state and update the reflection by
+listening for relevant events. If a service implements a command that changes a particular
+aspect of peers state, then, normally, it should also generate notifications event
+when that same part of the state changes and it should provide a command to retrieve
+current value of the state – to be used by clients to initialize the reflection. Service
+events are defined statically, together with commands. The framework does not do any
+event processing besides delivering them to clients, however a service can define
+additional event related functionality if necessary, for example, commands for event
+filtering, enabling, disabling, registration, etc. Care should be taken when designing
+events for a service - if events are sent too frequently, they will cause flooding
+of the communication channels and degrade performance. However, too few events will
+force clients to poll for changes and can also degrade performance. A balanced approach
+is the best.</p>
+
+<h2><a name='ProtocolFlowControl'>Flow Control</a> </h2>
+
+<p>It often happens that one side of communication channel produces messages faster
+then they can be transmitted over the channel or can be consumed by another side.
+This will cause channel traffic congestion (flooding). Framework will deal with the
+problem and slow down transmitting side by blocking execution inside sendEvent(),
+sendCommand() and sendResult() functions when message buffers are full. However, in
+many cases, it is not the best way to handle congestion. For example, it can make
+a tool UI appear locked for prolonged time or it can break target software if it is
+designed to work in real time. Clients can use flow control events to implement advanced
+techniques to handle traffic congestion, for example, message coalescing, switching
+to less detailed messages, etc.</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;flow control message&gt;</i>
+ <font face=Wingdings>Ψ</font> F • <i>&lt;int: traffic congestion level&gt;</i> •
+</font></b></pre>
+
+<p>Traffic congestion level value is in range –100..100, where –100 means no pending
+messages (no traffic), 0 means optimal load, and positive numbers
+indicate level of congestion. When a peer receives flow control message with congestion level > 0
+it should try to reduce its transmition speed.</p>
+
+<h2><a name='ProtocolExamples'>Message Examples</a></h2>
+
+<p>Examples use simplified command arguments and result data. See service description
+for actual data formats.</p>
+
+<p>Executing <b><i>suspend</i></b> command from <b><i>RunControl</i></b> service:</p>
+
+<p>&nbsp;</p>
+
+<pre>
+Send   :      C 1 RunControl suspend “Thread1”
+Receive:      E RunControl suspended “Thread1”
+Receive:      R 1 “Success”
+</pre>
+
+<p>Same command, but target was already suspended:</p>
+
+<pre>
+Receive:      E RunControl suspended “Thread1”
+Send   :      C 2 RunControl suspend “Thread1”
+Receive:      R 2 “Already suspended”
+</pre>
+
+<p>Same command, but target was suspended (by another client) after sending the command,
+but before command was executed: </p>
+
+<pre>
+Receive:      E RunControl running “Thread1”
+Send   :      C 3 RunControl suspend “Thread1”
+Receive:      E RunControl suspended “Thread1”
+Receive:      R 3 “Already suspended”
+</pre>
+
+<h2><a name='API'>Framework API</a></h2>
+
+<pre>
+<font color=#3F5FBF>/**
+ *
+ * Class Protocol provides static methods to access Target Communication Framework root objects:
+ * 1. the framework event queue and dispatch thread;
+ * 2. local instance of Locator service, which maintains a list of available targets;
+ * 3. list of open communication channels.
+ */</font>
+<font color=#7F0055>public class</font> Protocol {
+    
+    <font color=#7F0055>private static</font> IEventQueue <i>event_queue</i>;
+    
+    <font color=#3F5FBF>/**
+ * Before TCF can be used it should be given an object implementing IEventQueue interface.
+ * The implementation maintains a queue of objects implementing Runnable interface and
+ * executes <code>run</code> methods of that objects in a sequence by a single thread.
+ * The thread in referred as TCF event dispatch thread. Objects in the queue are called TCF events.
+ * Executing <code>run</code> method of an event is also called dispatching of event.
+ *
+ * Only few methods in TCF APIs are thread safe - can be invoked from any thread.
+ * If a method description does not say "can be invoked from any thread" explicitly -
+ * the method must be invoked from TCF event dispatch thread. All TCF listeners are
+ * invoked from the dispatch thread.
+ *
+ * <font color=#7F9FBF>@param</font> event_queue - IEventQueue implementation.
+     */</font>
+    <font color=#7F0055>public static void</font> setEventQueue(IEventQueue event_queue);
+   
+    <font color=#3F5FBF>/**
+     * <font color=#7F9FBF>@return</font> instance of IEventQueue that should be used for TCF events.
+     */</font>
+    <font color=#7F0055>public static</font> IEventQueue getEventQueue();
+   
+    <font color=#3F5FBF>/**
+     * Returns true if the calling thread is TCF dispatch thread.
+     * Use this call to ensure that a given task is being executed (or not being)
+     * on dispatch thread.
+     * This method is thread-safe.
+     *
+     * <font color=#7F9FBF>@return</font> true if running on the dispatch thread.
+     */</font>
+    <font color=#7F0055>public static boolean</font> isDispatchThread();
+   
+    <font color=#3F5FBF>/**
+     * Causes runnable to have its run
+     * method called in the dispatch thread of the framework.
+     * Runnables are dispatched in same order as queued.
+ * If invokeLater is called from the dispatching thread
+ * the <i>runnable.run()</i> will still be deferred until
+ * all pending events have been processed.
+ *
+ * This method can be invoked from any thread.
+     *
+     * <font color=#7F9FBF>@param runnable</font> the Runnable whose run
+     * method should be executed asynchronously.</font>
+     */</font>
+    <font color=#7F0055>public static void</font> invokeLater(Runnable runnable);
+   
+    <font color=#3F5FBF>/**
+     * Causes runnable to have its run
+     * method called in the dispatch thread of the framework.
+     * Calling thread is suspended util the method is executed.
+     * This method is thread-safe.
+     *
+     * <font color=#7F9FBF>@param runnable</font> the Runnable whose run
+     * method should be executed on dispatch thread.
+     */</font>
+    <font color=#7F0055>public static void</font> invokeAndWait(Runnable runnable)
+        <font color=#7F0055>throws</font> InterruptedException;
+   
+    <font color=#3F5FBF>/**
+ * Get instance of the framework locator service.
+ * The service can be used to discover available remote peers.
+ *
+ * @return instance of ILocator.
+     */</font>
+ <font color=#7F0055>public static</font> ILocator getLocator();
+
+    <font color=#3F5FBF>/**
+ * Return an array of all open channels.
+ * @return an array of IChannel
+     */</font>
+ <font color=#7F0055>public static</font> IChannel[] getOpenChannels();
+
+    <font color=#3F5FBF>/**
+ * Interface to be implemented by clients willing to be notified when
+ * new TCF communication channel is opened.
+     */</font>
+ <font color=#7F0055>public interface</font> ChannelOpenListener {
+ <font color=#7F0055>public void</font> onChannelOpen(IChannel channel);
+ }
+
+    <font color=#3F5FBF>/**
+ * Add a listener that will be notified when new channel is opened.
+ * @param listener
+     */</font>
+ <font color=#7F0055>public static void</font> addChannelOpenListener(ChannelOpenListener listener);
+
+    <font color=#3F5FBF>/**
+ * Remove channel opening listener.
+ * @param listener
+     */</font>
+ <font color=#7F0055>public static void</font> removeChannelOpenListener(ChannelOpenListener listener);
+
+    <font color=#3F5FBF>/**
+ * Transmit TCF event message.
+ * The message is sent to all open communication channels – broadcasted.
+     */</font>
+ <font color=#7F0055>public static void</font> sendEvent(String service, String name, byte[] data);
+
+    <font color=#3F5FBF>/**
+ * Call back after TCF messages sent by this host up to this moment are delivered
+ * to their intended target. This method is intended for synchronization of messages
+ * across multiple channels.
+ *
+ * Note: Cross channel synchronization can reduce performance and throughput.
+ * Most clients don't need cross channel synchronization and should not call this method.
+ *
+ * @param done will be executed by dispatch thread after communication
+ * messages are delivered to corresponding targets.
+     */</font>
+ <font color=#7F0055>public static void</font> sync(Runnable done);
+}
+
+<font color=#3F5FBF>/**
+ * IChannel represents communication link connecting two endpoints (peers).
+ * The channel asynchroniously transmits messages: commands, results and events.
+ * A single channel may be used to communicate with multiple services.
+ * Multiple channels may be used to connect the same peers, however no command or event
+ * ordering is guaranteed across channels.
+ */</font>
+<font color=#7F0055>public interface</font> IChannel {
+   
+    <font color=#3F5FBF>/**
+     * Channel state IDs
+     */</font>
+    <font color=#7F0055>static final</font> int
+        <i><font color=#0000C0>STATE_OPENNING</font></i> = 0,
+        <i><font color=#0000C0>STATE_OPEN</font></i> = 1,
+        <i><font color=#0000C0>STATE_CLOSED</font></i> = 2;
+   
+    <font color=#3F5FBF>/**
+     * <font color=#7F9FBF>@return</font> channel current state, see STATE_*
+     */</font>
+    int getState();
+
+    <font color=#3F5FBF>/**
+     * Send command message to remote peer for execution. Commands can be queued
+     * locally before transmission. Sending commands too fast can fill up
+     * communication channel buffers. Calling thread will be blocked until
+     * enough buffer space is freed up by transmitting pending messages.
+     */</font>
+    IToken sendCommand(IService service, String name, <font color=#7F0055>byte</font>[] args,
+        ICommandListener done);
+
+    <font color=#3F5FBF>/**
+     * Command listener interface. Clients implement this interface
+     * to receive command results.
+     */</font>
+    <font color=#7F0055>interface</font> ICommandListener {
+       
+        <font color=#3F5FBF>/**
+         * Called when progress message (intermediate result) is received
+         * from remote peer.
+         */</font>
+        <font color=#7F0055>void</font> progress(<font color=#7F0055>byte</font>[] data);
+       
+        <font color=#3F5FBF>/**
+         * Called when command result received from remote peer.
+         */</font>
+        <font color=#7F0055>void</font> result(<font color=#7F0055>byte</font>[] data);
+    }
+
+    <font color=#3F5FBF>/**
+     * Send result message to remote peer. Messages can be queued locally before
+     * transmission. Sending messages too fast can fill up communication channel
+     * buffers. Calling thread will be blocked until enough buffer space is
+     * freed up by transmitting pending messages.
+     */</font>
+    <font color=#7F0055>void</font> sendResult(IToken token, <font color=#7F0055>byte</font>[] results);
+
+    <font color=#3F5FBF>/**
+     * Get current level of outbound traffic congestion.
+     *
+     * <font color=#7F9FBF>@return</font> integer value in range –100..100, where –100 means no pending
+     * messages (no traffic), 0 means optimal load, and positive numbers
+     * indicate level of congestion.
+     *
+     * Note: inbound traffic congestion is detected by framework and reported to
+     * remote peer without client needed to be involved.
+     */</font>
+    int getCongestion();
+
+    <font color=#3F5FBF>/**
+     * Channel listener interface.
+     */</font>
+    <font color=#7F0055>interface</font> IChannelListener {
+
+        <font color=#3F5FBF>/**
+         * Notifies listeners about congestion level changes. When level &gt; 0
+         * client should delay sending more messages.
+         */</font>
+        <font color=#7F0055>void</font> congestionLevel(int level);
+    }
+
+    <font color=#3F5FBF>/**
+     * Subscribe a channel listener. The listener will be notified about changes of
+     * outbound traffic congestion level.
+     */</font>
+    <font color=#7F0055>void</font> addChannelListener(IChannelListener listener);
+
+    <font color=#3F5FBF>/**
+     * Remove a channel listener.
+     */</font>
+    <font color=#7F0055>void</font> removeChannelListener(IChannelListener listener);
+
+    <font color=#3F5FBF>/**
+     * Command server interface.
+     * This interface is to be implemented by service providers.
+     */</font>
+    <font color=#7F0055>interface</font> ICommandServer {
+
+        <font color=#3F5FBF>/**
+         * Called every time a command is received from remote peer.
+         */</font>
+        <font color=#7F0055>void</font> command(IToken token, String name, <font color=#7F0055>byte</font>[] data);
+    }
+   
+    <font color=#3F5FBF>/**
+     * Subscribe a command server. The server will be notified about command
+     * messages received through this channel for given service.
+     */</font>
+    <font color=#7F0055>void</font> addCommandServer(IService service, ICommandServer listener);
+
+    <font color=#3F5FBF>/**
+     * Remove a command server.
+     */</font>
+    <font color=#7F0055>void</font> removeCommandServer(IService service, ICommandServer listener);
+
+ <font color=#3F5FBF>/**
+     * A generic interface for service event listener.
+     * Services usually define a service specific event listener interface,
+     * which is implemented using this generic listener.
+     * Service clients should use service specific listener interface,
+     * unless no such interface is defined.
+     */</font>
+    <font color=#7F0055>interface</font> IEventListener {
+        <font color=#7F0055>void</font> event(String name, <font color=#7F0055>byte</font>[] data);
+    }
+
+    <font color=#3F5FBF>/**
+     * Subscribe an event message listener for given service.
+     */</font>
+    <font color=#7F0055>void</font> addEventListener(IService service, IEventListener listener);
+
+    <font color=#3F5FBF>/**
+     * Unsubscribe an event message listener for given service.
+     */</font>
+    <font color=#7F0055>void</font> removeEventListener(IService service, IEventListener listener);
+
+ <font color=#3F5FBF>/**
+     * <font color=#7F9FBF>@return</font> IPeer object representing local endpoint of communication channel.
+     */</font>
+    IPeer getLocalPeer();
+
+    <font color=#3F5FBF>/**
+     * <font color=#7F9FBF>@return</font> IPeer object representing remote endpoint of communication channel.
+     */</font>
+    IPeer getRemotePeer();
+
+    <font color=#3F5FBF>/**
+     * <font color=#7F9FBF>@return</font> map of services available on local peer. It maps service names to
+     * IService implemetations.
+     */</font>
+    Map&lt;String, IService&gt; getLocalServices();
+
+    <font color=#3F5FBF>/**
+     * <font color=#7F9FBF>@return</font> map of services available on removte peer. It maps service names to
+     * IService implemetations.
+     */</font>
+    Map&lt;String, IService&gt; getRemoteServices();
+
+    <font color=#3F5FBF>/**
+     * Close communication channel.
+     */</font>
+    <font color=#7F0055>void</font> close();
+
+    <font color=#3F5FBF>/**
+     * Close channel in case of communication error.
+     * <font color=#7F9FBF>@param error</font>
+     */</font>
+    <font color=#7F0055>void</font> terminate(Throwable error);
+   
+    <font color=#3F5FBF>/**
+     * Redirect this channel to given peer using this channel remote peer
+     * locator service as a proxy.
+     * <font color=#7F9FBF>@param peer_id</font>
+     */</font>
+    <font color=#7F0055>void</font> redirect(String peer_id);
+}
+
+
+<font color=#3F5FBF>/**
+ * Object implemeting IToken interface is created by framework for every
+ * command sent over communication channel. It is used to match command to its
+ * results, and also can be used to cancel commands.
+ */</font>
+<font color=#7F0055>public</font> interface IToken {
+   
+    <font color=#3F5FBF>/**
+     * Try to cancel a command associated with given token. A command can be
+     * canceled by this method only if it was not transmitted yet to remote peer
+     * for execution. Successfully canceled command does not produce any result
+     * messages.
+     *
+     * <font color=#7F9FBF>@return</font> true if successful.
+     */</font>
+    <font color=#7F0055>boolean</font> cancel();
+}
+
+</pre>
+
+<h1><a name='JSON'>Preferred Marshaling</a></h1>
+
+<p>TCF messages data format is service specific. Since services specifications are
+separate from protocol specification, a service designer can choose any data format that
+suits the service requirements best. However, to promote better compatibility and to
+simplify service design and implementation, we recommend to use <b>JSON</b> for data formatting.</p>
+
+<p><b>JSON</b> (pronounced like the
+English given name <i>Jason</i>), which stands for "<b>J</b>ava<b>S</b>cript <b>O</b>bject
+<b>N</b>otation", is a lightweight, text-based, language-independent computer data
+interchange format. <b>JSON</b> is a subset of the object literal notation of JavaScript
+but its use does not require JavaScript.</p>
+
+<p><b>JSON</b> represents data with the same basic types that programming languages
+use. <b>JSON</b>'s basic types are:</p>
+
+<ul type='disc'>
+ <li>Number (integer, real, or floating-point)
+
+ <li>String (double-quoted with backslash escapement)
+
+ <li>Boolean (<code>true</code> and <code>false</code>)
+
+ <li>Array (an ordered sequence of values)
+
+ <li>Object (collection of key/value pairs)
+
+ <li><code>null</code>
+ </ul>
+
+<p>The structures used in most programming languages easily map directly onto JSON's
+structures, and back again.</p>
+
+<p>JSON maps data onto Unicode string. Then the string is mapped onto array of bytes
+using UTF-8 encoding.</p>
+
+<p>JSON specification:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+<i>&lt;object&gt;</i>
+ <font face=Wingdings>Ψ</font> {}
+ <font face=Wingdings>Ψ</font> { <i>&lt;members&gt;</i> }
+<i>&lt;members&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;string&gt;</i> : <i>&lt;value&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;members&gt;</i> , <i>&lt;string&gt;</i> : <i>&lt;value&gt;</i>
+
+<i>&lt;array&gt;</i>
+ <font face=Wingdings>Ψ</font> []
+ <font face=Wingdings>Ψ</font> [ <i>&lt;elements&gt;</i> ]
+
+<i>&lt;elements&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;value&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;elements</i>&gt; , <i>&lt;value&gt;</i>
+
+<i>&lt;value&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;string&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;number&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;object&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;array&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;boolean&gt;</i>
+ <font face=Wingdings>Ψ</font> null
+
+<i>&lt;boolean&gt;</i>
+ <font face=Wingdings>Ψ</font> true
+ <font face=Wingdings>Ψ</font> false
+
+<i>&lt;string&gt;</i>
+ <font face=Wingdings>Ψ</font> ""
+ <font face=Wingdings>Ψ</font> " <i>&lt;chars&gt;</i> "
+
+<i>&lt;chars&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;char&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;chars&gt; &lt;char&gt;</i>
+
+<i>&lt;char</i>&gt;
+ <font face=Wingdings>Ψ</font> <i>&lt;any Unicode except " or \ or control&gt;</i>
+ <font face=Wingdings>Ψ</font> \"<i></i>
+ <font face=Wingdings>Ψ</font> \\<i></i>
+ <font face=Wingdings>Ψ</font> \/<i></i>
+ <font face=Wingdings>Ψ</font> \b<i></i>
+ <font face=Wingdings>Ψ</font> \f<i></i>
+ <font face=Wingdings>Ψ</font> \n<i></i>
+ <font face=Wingdings>Ψ</font> \r<i></i>
+ <font face=Wingdings>Ψ</font> \t<i></i>
+ <font face=Wingdings>Ψ</font> \u <i>&lt;four-hex-digits&gt;</i>
+
+<i>&lt;number</i>&gt;
+ <font face=Wingdings>Ψ</font> <i>&lt;int&gt;</i>
+ <font face=Wingdings>Ψ</font> &lt;<i>int&gt; &lt;fraction&gt;</i>
+ <font face=Wingdings>Ψ</font> &lt;<i>int&gt; &lt;exponent&gt;</i>
+ <font face=Wingdings>Ψ</font> &lt;<i>int&gt; &lt;fraction&gt; &lt;exponent&gt;</i>
+<i>&lt;int&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;digit&gt;</i>
+ <font face=Wingdings>Ψ</font> &lt;<i>digit 1-9&gt; &lt;digits&gt;</i>
+ <font face=Wingdings>Ψ</font> - &lt;<i>digit&gt;</i>
+ <font face=Wingdings>Ψ</font> - &lt;<i>digit 1-9&gt; &lt;digits</i>&gt;
+
+<i>&lt;fraction&gt;</i>
+ <font face=Wingdings>Ψ</font> . <i>&lt;digits&gt;</i>
+
+<i>&lt;exponent&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;e&gt;</i> <i>&lt;digits&gt;</i>
+
+<i>&lt;digits&gt;</i>
+ <font face=Wingdings>Ψ</font> <i>&lt;digit&gt;</i>
+ <font face=Wingdings>Ψ</font> &lt;<i>digits&gt;</i> &lt;<i>digit&gt;</i>
+
+<i>&lt;e&gt;</i>
+ <font face=Wingdings>Ψ</font> e
+ <font face=Wingdings>Ψ</font> e+
+ <font face=Wingdings>Ψ</font> e-
+ <font face=Wingdings>Ψ</font> E
+ <font face=Wingdings>Ψ</font> E+
+ <font face=Wingdings>Ψ</font> E-
+
+</font></b></pre>
+
+<p>See <a href='http://www.json.org/'>www.json.org</a> for more details.</p>
+
+<h2><a name='JSONExamples'>Examples</a></h2>
+
+<p>This is a JSON array containing two objects:</p>
+
+<pre>
+   [
+       {
+          "Precision": "zip",
+          "Latitude":  37.7668,
+          "Longitude": -122.3959,
+          "City":      "SAN FRANCISCO",
+          "State":     "CA",
+          "Zip":       "94107",
+          "Country":   "US"
+       },
+       {
+          "Precision": "zip",
+          "Latitude":  37.371991,
+          "Longitude": -122.026020,
+          "City":      "SUNNYVALE",
+          "State":     "CA",
+          "Zip":       "94085",
+          "Country":   "US"
+       }
+   ]
+</pre>
+
+<h1><a name='Locator'>Locator Service</a></h1>
+
+<p>Locator Service uses transport layer to search for peers and to collect data about
+peer’s attributes and capabilities (services).  Discovery mechanism depends on transport
+protocol and is part of that protocol handler. Targets, known by other hosts, are
+added to local list of peers. <font color=red>Security? </font>Automatically discovered
+targets require no further configuration. Additional targets can be configured manually.</p>
+
+<p>All TCF peers must implement Locator service. The implementation is part of the framework itself.
+It is the only required service, all other services are optional and, formally, not part of the framework.</p>
+
+<h2><a name='LocatorPeer'>Peer Atributes</a></h2>
+
+<p><i>&lt;object: peer data&gt;</i> is collection of peer attributes. It should, at least, contain member
+<b><font face="Courier New" size=2 color=#333399>"ID" : <i>&lt;string&gt;</i></font></b>.
+It can also contain a number of components describing peer properties and capabilities.
+Predefined attributes are:</p>
+
+<ul>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ID" : <i>&lt;string&gt;</i></font></b></code>
+ - ID of the peer.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Name" : <i>&lt;string&gt;</i></font></b></code>
+ - human readable peer name.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"OSName" : <i>&lt;string&gt;</i></font></b></code>
+ - peer OS name, if applicable.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"TransportName" : <i>&lt;string&gt;</i></font></b></code>
+ - name of a trasport protocol to use to connect to this peer, for example: TCP.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Host" : <i>&lt;string&gt;</i></font></b></code>
+ - peer host name, if transport is TCP or UDP.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Aliases" : <i>&lt;string&gt;</i></font></b></code>
+ - peer host name aliases, if transport is TCP or UDP.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Addresses" : <i>&lt;string&gt;</i></font></b></code>
+ - peer IP addresses, if transport is TCP or UDP.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Port" : <i>&lt;string&gt;</i></font></b></code>
+ - peer port number, if transport is TCP or UDP.
+</ul>
+
+<p>Most clients dont need to know peer attributes other then ID and Name. Clients are expected to call IPeer.openChannel()
+method and let the framework to check peers attributes and create appropriate communication cahnnel that is best suited for
+communication with the peer. After a channel is established, a client can learn peer capabilities by looking
+at services it implements (use IChannel.getRemoteServices() method to get a map of services).</p>
+
+<h2><a name='LocatorCommands'>Locator Service Commands</a></h2>
+
+<h3><a name='LocatorCommandRedirect'>redirect</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Locator • redirect • <i>&lt;string: peer ID&gt;</i> •
+</font></b></pre>
+
+<p>The command redirects the channel to become connected to given peer.
+Locator service starts acting as a proxy.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> • <i>&lt;error report&gt;</i> •
+</font></b></pre>
+
+<h3><a name='LocatorCommandSync'>sync</a></h3>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+C • <i>&lt;token&gt;</i> • Locator • sync •
+</font></b></pre>
+
+<p>Sync command does nothing and simply returns back an empty result. The command is used for
+cross channel synchronization. Since commands are executed in order they were issued, by waiting
+for sync result a client makes sure that all commands, that were issued before sync, are fully processed.</p>
+
+<p>Reply:</p>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+R • <i>&lt;token&gt;</i> •
+</font></b></pre>
+
+<h2><a name='LocatorEvents'>Locator Service Events</a></h2>
+
+<pre><b><font face="Courier New" size=2 color=#333399>
+E • Locator • Hello • <i>&lt;array: service names&gt;</i> •
+E • Locator • peerAdded • <i>&lt;object: peer data&gt;</i> •
+E • Locator • peerChanged • <i>&lt;object: peer data&gt;</i> •
+E • Locator • peerRemoved • <i>&lt;string: peer ID&gt;</i> •
+</font></b></pre>
+
+<dl>
+ <dt><b>Hello</b>
+ <dd>is the first message sent by the framework after establishing a communication channel.
+ The message lets other side of the channel to know capabilities of this peer.
+ Message data consists of an array of service names that are provided by the peer.
+ Service names list is a complete and unambiguous declaration of peer's capabilities.
+ To avoid ambiguity, different services (even slightly different, like versions of same service)
+ must have different names. Framework delays all other communications between peers until exchange
+ of Hello messages is complete.
+ <dt><b>peerAdded</b>
+ <dd>is sent when the service discovers a new peer.
+ <dt><b>peerChanged</b>
+ <dd>is sent when peer attributes change.
+ <dt><b>peerRemoved</b>
+ <dd>is sent when the service deletes information about a peer.
+</dl>
+
+<h2><a name='LocatorAPI'>Locator Service API</a></h2>
+
+<pre>
+<font color=#3F5FBF>/**
+ * Base interface for all service interfaces.
+ * A client can get list of available services by
+ * calling IPeer.getLocalServices or IPeer.getRemoteServives
+ */</font>
+<font color=#7F0055>public</font> interface IService {
+
+    <font color=#3F5FBF>/**
+     * Get unique name of this service.
+     */</font>
+    String getName();
+}
+
+<font color=#3F5FBF>/**
+ * Both hosts and targets are represented by objects
+ * implementing IPeer interface. A peer can act as host or
+ * target depending on services it implements.
+ * List of currently known peers can be retrieved by
+ * calling ILocator.getPeers
+ */</font>
+<font color=#7F0055>public interface</font> IPeer {
+   
+    <font color=#7F0055>static final</font> String
+        <i><font color=#0000C0>ATTR_ID</font></i> = <font color=#2A00FF>"ID"</font>,
+        <i><font color=#0000C0>ATTR_NAME</font></i> = <font color=#2A00FF>"Name"</font>,
+        <i><font color=#0000C0>ATTR_OS_NAME</font></i> = <font color=#2A00FF>"OSName"</font>,
+        <i><font color=#0000C0>ATTR_TRANSPORT_NAME</font></i> = <font color=#2A00FF>"TransportName"</font>,
+        <i><font color=#0000C0>ATTR_IP_HOST</font></i> = <font color=#2A00FF>"Host"</font>,
+        <i><font color=#0000C0>ATTR_IP_ALIASES</font></i> = <font color=#2A00FF>"Aliases"</font>,
+        <i><font color=#0000C0>ATTR_IP_ADDRESSES</font></i> = <font color=#2A00FF>"Addresses"</font>,
+        <i><font color=#0000C0>ATTR_IP_PORT</font></i> = <font color=#2A00FF>"Port"</font>;
+           
+   
+    <font color=#3F5FBF>/**
+     * <font color=#7F9FBF>@return</font> map of peer attributes
+     */</font>
+    Map&lt;String, String&gt; getAttributes();
+
+    <font color=#3F5FBF>/**
+     * <font color=#7F9FBF>@return</font> peer unique ID, same as getAttributes().get(ATTR_ID)
+     */</font>
+    String getID();
+
+    <font color=#3F5FBF>/**
+     * <font color=#7F9FBF>@return</font> peer name, same as getAttributes().get(ATTR_NAME)
+     */</font>
+    String getName();
+
+    <font color=#3F5FBF>/**
+     * Same as getAttributes().get(ATTR_OS_NAME)
+     */</font>
+    String getOSName();
+
+    <font color=#3F5FBF>/**
+     * Same as getAttributes().get(ATTR_TRANSPORT_NAME)
+     */</font>
+    String getTransportName();
+
+    <font color=#3F5FBF>/**
+     * Open channel to communicate with this peer.
+     * Note: the channel is not fully open yet when this method returns.
+     * It’s state is IChannel.STATE_OPENNING.
+     * Protocol.Listener will be called when the channel will be opened or closed.
+     */</font>
+    IChannel openChannel() <font color=#7F0055>throws</font> IOException;
+}
+
+<font color=#3F5FBF>/**
+ * ILocator service uses transport layer to search for peers and to collect data about
+ * peer’s attributes and capabilities (services). Discovery mechanism depends on
+ * transport protocol and is part of that protocol handler. Targets, known by other
+ * hosts, are added to local list of peers.
+ * Automatically discovered targets require no further configuration. Additional targets
+ * can be configured manually.
+ *
+ * Clients should use Protocol.getLocator() to obtain local instance of ILocator,
+ * then ILocator.getPeers() can be used to get of available peers (hosts and targets).
+ */</font>
+<font color=#7F0055>public interface</font> ILocator <font color=#7F0055>extends</font> IService {
+   
+    <font color=#7F0055>static final</font> String <i><font color=#0000C0>NAME</font></i> = <font color=#2A00FF>"Locator"</font>;
+
+ <font color=#3F5FBF>/**
+ * Auto-configuration command and response codes.
+ */</font>
+ <font color=#7F0055>static final int</font>
+ <i><font color=#0000C0>CONF_REQ_INFO</font></i> = 1,
+ <i><font color=#0000C0>CONF_PEER_INFO</font></i> = 2;
+
+    <font color=#3F5FBF>/**
+     * <font color=#7F9FBF>@return</font> Locator service name: "Locator"
+     */</font>
+    String getName();
+
+    <font color=#3F5FBF>/**
+ * Get map (ID -> IPeer) of available peers (hosts and targets).
+ * The method return cached (currently known to the framework) list of peers.
+ * The list is updated according to event received from transport layer
+     */</font>
+    Map&lt;String,IPeer&gt; getPeers();
+
+    <font color=#3F5FBF>/**
+     * Redirect this service channel to given peer using this service as a proxy.
+     */</font>
+    IToken redirect(String peer_id, DoneRedirect done);
+   
+    <font color=#7F0055>interface</font> DoneRedirect {
+        <font color=#7F0055>void</font> doneRedirect(IToken token, Exception error);
+    }
+
+    <font color=#3F5FBF>/**
+ * Call back after TCF messages sent to this target up to this moment are delivered.
+ * This method is intended for synchronization of messages
+ * across multiple channels.
+ *
+ * Note: Cross channel synchronization can reduce performance and throughput.
+ * Most clients don't need channel synchronization and should not call this method.
+ *
+ * @param done will be executed by dispatch thread after communication
+ * messages are delivered to corresponding targets.
+ *
+ * This is internal API, TCF clients should use {@code com.windriver.tcf.api.protocol.Protocol}.
+ */</font>
+ IToken sync(DoneSync done);
+
+ <font color=#7F0055>interface</font> DoneSync {
+ <font color=#7F0055>void</font> doneSync(IToken token);
+ }
+
+    <font color=#3F5FBF>/**
+     * Add a listener for locator service events.
+     */</font>
+    <font color=#7F0055>void</font> addListener(Listener listener);
+
+    <font color=#3F5FBF>/**
+     * Remove a listener for locator service events.
+     */</font>
+    <font color=#7F0055>void</font> removeListener(Listener listener);
+
+    <font color=#7F0055>interface</font> Listener {
+        <font color=#7F0055>void</font> peerAdded(IPeer peer);
+
+        <font color=#7F0055>void</font> peerRemoved(IPeer peer);
+
+        <font color=#7F0055>void</font> peerChanged(IPeer peer);
+    }
+}
+</pre>
+
+</body>
+</html>
+ \ No newline at end of file
diff --git a/docs/TCF_Launch_Dialog.jpg b/docs/TCF_Launch_Dialog.jpg
new file mode 100644
index 000000000..837bd6f53
--- /dev/null
+++ b/docs/TCF_Launch_Dialog.jpg
Binary files differ
diff --git a/docs/TCF_RSE_Files.jpg b/docs/TCF_RSE_Files.jpg
new file mode 100644
index 000000000..c1088b0fc
--- /dev/null
+++ b/docs/TCF_RSE_Files.jpg
Binary files differ
diff --git a/docs/TCF_RSE_Processes.jpg b/docs/TCF_RSE_Processes.jpg
new file mode 100644
index 000000000..e17a15817
--- /dev/null
+++ b/docs/TCF_RSE_Processes.jpg
Binary files differ
diff --git a/docs/index.html b/docs/index.html
new file mode 100644
index 000000000..ce61a25d6
--- /dev/null
+++ b/docs/index.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <title>Target Communication Framework</title>
+</head>
+<body>
+<h1>Target Communication Framework </h1>
+
+<p>Copyright (c) 2007 Wind River Systems, Inc. Made available under the EPL v1.0
+<p>Direct comments, questions to the <a href="mailto:dsdp-tm-dev@eclipse.org">dsdp-tm-dev@eclipse.org</a> mailing list
+
+<h2>Available Documentation</h2>
+
+<table border=1 cellpadding=8>
+ <tr>
+ <td><a href='TCF Project.html'>TCF Project Overview</a>
+ <td width=500>TCF project goals and results
+ <tr>
+ <td><a href='TCF Getting Started.html'>TCF: Getting Started</a>
+ <td width=500>Getting started with TCF - creating Eclipse workspace, building agent, making a first connection
+ <tr>
+ <td><a href='TCF Specification.html'>TCF Specifications</a>
+ <td width=500>Design goals, requirements and format of TCF communication protocol,
+ framework API and software design considerations
+ <tr>
+ <td><a href='TCF Services.html'>TCF Services Definitions</a>
+ <td width=500>TCF communication model is based on the idea of services.
+ A service is a group of related commands, events and semantics.
+ New services are expected to be defined by developers of tools and target agents.
+ To achieve certain level of compatibility of tools/targets TCF inclides definitions
+ of common services
+ <tr>
+ <td><a href='TCF Context Identifier Explanation.html'>TCF Context Identifier Explanation</a>
+ <td width=500>Most if not all TCF services functions need some way to identify what entity e.g. process,
+ thread, task, device on JTAG scan chain, etc they should operate on.
+ To do this TCF uses a context identifier (aka ContextId). This document is attempting to explain how
+ ContextIds are intended to be used
+ <tr>
+ <td><a href='TCF Linux Agent Prototype.html'>TCF Agent Prototype</a>
+ <td width=500>Brief description of the TCF target agent prototype implementation
+</table>
+
+</body>
+</html>

Back to the top