Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 50ec8e8fee4246c84c68f3cd915b614e95bcb516 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
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>

Back to the top