The URL for OCL is http://sourceforge.net/projects/ocl
Intel Labs has implemented
portions of the CLI (Common Language Infrastructure) runtime library as defined
in the final draft ECMA CLI specification
(To access the final public draft ECMA documents, see http://www.intel.com/ids/ecma). Objectives for this development effort are
to:
License
The source code in this
release is a snapshot of current OCL development efforts. It is distributed under Intel Open Source
License for OCL:
The Intel Open Source License for OCL (Open CLI
Library)
(BSD License with Export Notice)
Copyright
(c) 2002 Intel Corporation
All
rights reserved.
Redistribution
and use in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
· Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
·
Redistributions
in binary form must reproduce the above copyright notice, this list of
conditions and the following disclaimer in the documentation and/or other
materials provided with the distribution.
·
Neither the name
of the Intel Corporation nor the names of its contributors may be used to
endorse or promote products derived from this software without specific prior
written permission.
THIS
SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE INTEL OR CONTRIBUTORS BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
EXPORT
LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF YOUR
JURISDICTION. It is licensee's responsibility to comply with any export
regulations applicable in licensee's jurisdiction. Under CURRENT (May 2000)
U.S. export regulations this software is eligible for export from the U.S. and
can be downloaded by or otherwise exported or reexported
worldwide EXCEPT to U.S. embargoed destinations which include Cuba, Iraq,
Libya, North Korea, Iran, Syria, Sudan, Afghanistan and any other country to
which the U.S. has embargoed goods and services.
The following release contains software made available by a Ximian under the following terms:
Copyright (c) 2001,2002 Ximian, Inc., Marcel Narings, Jason Diamond, Martin Weindel, Ximian Inc., Vladimir Vukicevic, Marcin Szczepanski, Sergey Chaban
Permission
is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The
above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE
SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1)
Kernel
and Compact Profile (BCL, RIL, XML, Networking, and Reflection) Implementation: This package
contains a current snapshot of Intel Labs Kernel and Compact Profile library
implementations. The BCL (Base Class
Library), RIL (Runtime Infrastructure Library) are part of the Kernel Profile
as defined in the final draft ECMA CLI specification. The XML, Networking, and Reflection libraries
are part of the Compact Profile as defined in the final draft ECMA CLI
specification. The status of this
implementation is included in a table at the end of this document for
reference. Please note the following:
o Some classes in this released code are not fully
implemented.
o Intel Labs automatically generated stub code for ECMA
standard class libraries using the final draft XML ECMA CLI library definition
file. The code baseline was generated
using the OCXT (Open CLI XML Transformation) tool. For more information regarding OCXT see: http://sourceforge.net/projects/ocxt. This approach offered the following benefits:
§
Intel Labs code
matches the BCL, RIL, XML, Networking, and Reflection library definitions
available in the final draft ECMA CLI specification. All class, interface, enum,
property, method, parameter, etc. names are aligned with what is defined in the
final draft ECMA standard.
§
Summary
information available in the final draft ECMA specification was generated in
comment format preceding all classes, interfaces, enums,
properties, and methods.
§
Method parameter
information available in the final draft ECMA specification was generated in
comment format preceding all method definitions.
§
Method exception
information available in the final draft ECMA specification was generated in
comment format preceding all method definitions.
§
Method return
value information available in the final draft ECMA specification was generated
in comment format preceding all method definitions.
§
As a guide to
developers, an associated ‘throw’ stub statement is generated in each method
for every exception thrown by that method, followed by a comment explaining the
exceptional condition. Example:
if (false)
{
throw
new System.XYZException(); // Statement describing the exceptional condition as worded
in the draft ECMA library definition.");
}
§
Also note that
automatically generated stub methods returning a non-void value return zero,
false, null, or a new object of the return type. Implementations should change these return
values to what it appropriate for the method.
§
The format of
comments within the code banners is consistent for use with Microsoft's Visual
Studio .Net Document generator. To
generate the documentation for all the provided CLI classes, open the System.sln project that is included with this release using
Visual Studio .Net and select Tools -> Build Comment Web Pages. This action
will generate web based browse-able documentation for all Kernel and Compact
Profile classes. Documentation in this
form is included with release 0.4.0, but developers may want to regenerate the
documentation after future source code modifications.
§
Definitions of
classes within the final draft ECMA specification contain information about
additional methods that must be implemented if implementing the Extended Numerics or Extended Array libraries. As a convenience to developers who may want
to add these libraries, those methods have been generated in the Kernel and
Compact Profile classes. The methods are
omitted by the compiler using pre-processor directives. A comment is also included in each method
explaining which library requires the method to be implemented.
#if ExtendedNumerics // Define this
directive to compile methods required by the Extended Numeric library
#if ExtendedArray
// Define this directive to compile methods required by the Extended
Array library
§
Aesthetically
consistent code formatting throughout the entire library set.
o The CLI classes cannot be developed entirely in
C#. Intel Labs factored platform
specific (Operating System and Virtual Execution System) functionality into a
PAL (Platform Abstraction Layer) to consolidate OS/VES dependencies and provide
a focus point for porting OCL to other platforms. Developers should implement these OS/VES
interfaces to provide integration with their target OS and VES. This layer will obviously continue to evolve
as the Library/OS/VES interaction is better understood – especially when the
libraries are integrated with a functional VES. All known OS/VES dependent
methods in BCL have been forwarded to the PAL, and dependent methods within
RIL, XML, NET, and Reflection libraries are being addressed as they are
identified. Note that in some cases,
exception handling within OS/VES dependent methods will need to be moved to the
PAL, where information regarding the exceptional condition is available. The PAL currently consists of the following
classes/interfaces:
§
System.PlatformAbstractionLayer.IVirtualExecutionSystem – Definition of functionality needed by the library that
can only be provided by the VES. VES
dependent methods are added to this interface as they are identified.
§
System.PlatformAbstractionLayer.IntelORP – Class that implements IVirtualExecutionSystem,
providing the requested functionality through integration with ORP (this class
contains only stub functionality at this time).
§
System.PlatformAbstractionLayer.IOperatingSystem - Definition of functionality needed by the library
that can only be provided by the underlying OS.
OS dependent methods are added to this interface as they are identified.
§
System.PlatformAbstractionLayer.Windows – Class that implements IOperatingSystem,
providing the requested functionality through calls into APIs available in
Windows (this class is a work in progress).
Examples include accessing the console and file system.
As defined in the final draft ECMA CLI specification, accessing native APIs is
done through a mechanism called P/Invoke, and its library counterpart is an
attribute called System.Runtime.InteropServices.DllImport.
Currently, the Windows platform (Windows.cs) is
dependent on three DLLs (kernel32.dll, msvcrt.dll, ws2_32.dll) – all of which
are installed in the System32 directory on a Windows 2000 build. Kernel32 and msvcrt are used mainly for I/O functionality while ws2_32
is used for networking functionality. In some cases, unsafe code is used in Windows.cs to interface with the underlying operating
system services in order to perform operations on pointers, convert between
pointers and integral types, and access addresses of variables. These DLL dependencies are subject to change
based on future library development.
§
System.PlatformAbstractionLayer.Linux – Class that implements IOperatingSystem,
providing the requested functionality through calls into APIs available in Linux (this class
contains only stub functionality at this time).
§
System.PlatformAbstractionLayer.Platform – Constructs the concrete classes implementing IVirtualExecutionSystem and IOperatingSystem
for the target platform and provides static methods to access them.
o Three additional preprocessor directives are used
within OCL
#if
DEBUG // Define
this directive to include code used for debug purposes only
#if
NOSTDLIB //
Define this directive to compile the code with the /nostdlib
compiler flag under Microsoft .NET compiler. Defining this directive to allow
compilation of stub classes found in the ForNoStdLib.cs
file within the Helper folder, which are currently
required by the Microsoft VS.NET C# compiler.
#if SystemNameSpace // Intel Labs
develop within a SystemX namespace rather than System
namespace to allow testing under the Microsoft development environment. This
directive is used to include code that is required under the SystemX namespace. Since OCL is released under the System
namespace rather than the SystemX, it is required
that this directive be defined for proper compilation of OCL.
1)
Extended Numerics Stub Code: This package contains stub code for the Extended Numerics
library as defined in the final draft ECMA CLI library definition. No effort was made to compile this package,
so minor syntactical errors may exist.
This package is provided as a starting point for developers wanting to
implement the Extended Numerics library.
2)
Hyperlinked
Source Code Documentation (download OCL-V0.4.0-Docs.zip): This
package contains hyperlinked HTML documentation for all ECMA CLI Compact and
Kernel Profile classes. The
documentation is organized by namespace for easy navigation. The documentation
was extracted from the OCL code banners using Microsoft's Visual Studio .Net
Document generator. To use, download the ‘OCL-V0.4.0-Docs.zip’ file, extract
its contents, and open ‘OCL-V0.4.0-Docs\System\System.htm’ or
‘OCL-V0.4.0-Docs\Solution_System.HTM’.
To sign up for a mailing
list for OCL, visit http://sourceforge.net/projects/ocl
and click ‘lists’. For now, the ocl-general list can be used to ask questions, submit bugs,
post patches, and exchange experiences between OCL users.
OCL-V0.4.0.zip File Content
Unzip the contents of
OCL-V0.4.0.zip on your local drive. This
will create the following tree:
OCL-V0.4.0 //
Root Directory
|
Contrib-license.txt //
License for code contributors
|
License.txt //
Intel Open Source License Agreement
|
ExtendedNumerics.zip // Release item (2) described above
|
Readme-OCL-V0.4.0.htm //
this file
|
DevelopersGuideForOCL.doc //
Rev 0.2.0 OCL usage guide
|
\---OCLSourceCode
\---System // Root of source code tree for all
code contained within release item (1) described above
The System.sln
and System.csproj found under the
‘\OCL-V0.4.0\OCLSourceCode\System’ directory are Visual Studio .Net project
files that allow developers to build the BCL library on a Windows .Net
platform. To build a System.dll under this platform, open the System.sln file in VS .Net and select Build -> Rebuild
All. Alternatively, developers can create platform specific makefiles
that include and compile all the .cs files found in
‘\OCL-V0.4.0\OCLSourceCode\System’. For
a sample makefile that compiles OCL outside the VS
environment, please refer to the file named compile_notstdlib.bat
found under the System directory.
The following tables show
the status of each item within the Compact and Kernel profile classes. RIL is not reflected in these tables. All RIL classes are 5% completed.
|
BCL
Item |
%Complete as of 6/28 |
|
System.ApplicationException |
100% |
|
System.ArgumentException |
100% |
|
System.ArgumentNullException |
100% |
|
System.ArgumentOutOfRangeException |
100% |
|
System.ArithmeticException |
100% |
|
System.ArrayTypeMismatchException |
100% |
|
System.AsyncCallback |
100% |
|
System.Char |
100% |
|
System.Collections.ICollection |
100% |
|
System.Collections.IComparer |
100% |
|
System.Collections.IDictionary |
100% |
|
System.Collections.IDictionaryEnumerator |
100% |
|
System.Collections.IEnumerable |
100% |
|
System.Collections.IEnumerator |
100% |
|
System.Collections.IHashCodeProvider |
100% |
|
System.Collections.IList |
100% |
|
System.Collections+B48.Comparer |
100% |
|
System.Convert |
100% |
|
System.DivideByZeroException |
100% |
|
System.DuplicateWaitObjectException |
100% |
|
System.EventHandler |
100% |
|
System.ExecutionEngineException |
100% |
|
System.FormatException |
100% |
|
System.Globalization.DateTimeStyles |
100% |
|
System.ICloneable |
100% |
|
System.IComparable |
100% |
|
System.IDisposable |
100% |
|
System.IFormatProvider |
100% |
|
System.IFormattable |
100% |
|
System.IndexOutOfRangeException |
100% |
|
System.InvalidCastException |
100% |
|
System.InvalidOperationException |
100% |
|
System.InvalidProgramException |
100% |
|
System.IO.DirectoryNotFoundException |
100% |
|
System.IO.EndOfStreamException |
100% |
|
System.IO.FileAccess |
100% |
|
System.IO.IOException |
100% |
|
System.IO.PathTooLongException |
100% |
|
System.MarshalByRefObject |
100% |
|
System.MulticastNotSupportedException |
100% |
|
System.NotSupportedException |
100% |
|
System.NullReferenceException |
100% |
|
System.OutOfMemoryException |
100% |
|
System.OverflowException |
100% |
|
System.StackOverflowException |
100% |
|
System.SynchronizationLockException |
100% |
|
System.SystemException |
100% |
|
System.Threading.ThreadAbortException |
100% |
|
System.Threading.ThreadPriority |
100% |
|
System.Threading.ThreadStart |
100% |
|
System.Threading.ThreadState |
100% |
|
System.Threading.ThreadStateException |
100% |
|
System.Threading.Timeout |
100% |
|
System.Threading.TimerCallback |
100% |
|
System.Console |
95% |
|
System.IO.Directory |
95% |
|
System.IO.File |
95% |
|
System.IO.FileStream |
95% |
|
System.IO.StringReader |
95% |
|
System.IO.StringWriter |
95% |
|
System.NameValueCollection |
95% |
|
System.Boolean |
90% |
|
System.IO.FileLoadException |
90% |
|
System.IO.FileNotFoundException |
90% |
|
System.IO.MemoryStream |
90% |
|
System.IO.Stream |
90% |
|
System.IO.TextReader |
90% |
|
System.IO.TextWriter |
90% |
|
System.RankException |
90% |
|
System.Threading.Interlocked |
90% |
|
System.Threading.Timer |
90% |
|
System.TimeSpan |
90% |
|
System.TypeInitializationException |
90% |
|
System.ValueType |
90% |
|
System.String |
85% |
|
System.IO.Path |
80% |
|
System.IO.StreamReader |
80% |
|
System.IO.StreamWriter |
80% |
|
System.Object |
80% |
|
System.Byte |
75% |
|
System.Enum |
75% |
|
System.Int16 |
75% |
|
System.Int32 |
75% |
|
System.Int64 |
75% |
|
System.Array |
60% |
|
System.Exception |
60% |
|
System.GC |
60% |
|
System.Type |
50% |
|
System.Collections.ArrayList |
45% |
|
System.DateTime |
40% |
|
System.Threading.Thread |
40% |
|
System.Environment |
25% |
|
System.Delegate |
15% |
|
System.Globalization.DateTimeFormatInfo |
10% |
|
System.Attribute |
5% |
|
System.AttributeTargets |
5% |
|
System.AttributeUsageAttribute |
5% |
|
System.CLSCompliantAttribute |
5% |
|
System.Collections.DictionaryEntry |
5% |
|
System.Collections.Hashtable |
5% |
|
System.Diagnostics.ConditionalAttribute |
5% |
|
System.EventArgs |
5% |
|
System.FlagsAttribute |
5% |
|
System.Globalization.NumberStyles |
5% |
|
System.Globalization.UnicodeCategory |
5% |
|
System.IAsyncResult |
5% |
|
System.IBuiltInPermission |
5% |
|
System.IO.FileMode |
5% |
|
System.IO.FileShare |
5% |
|
System.IO.SeekOrigin |
5% |
|
System.Monitor |
5% |
|
System.ObsoleteAttribute |
5% |
|
System.Random |
5% |
|
System.SByte |
5% |
|
System.Security.CodeAccessPermission |
5% |
|
System.Security.IPermission |
5% |
|
System.Security.Permissions.CodeAccessSecurityAttribute |
5% |
|
System.Security.Permissions.EnvironmentPermission |
5% |
|
System.Security.Permissions.EnvironmentPermissionAccess |
5% |
|
System.Security.Permissions.EnvironmentPermissionAttribute |
5% |
|
System.Security.Permissions.FileIOPermission |
5% |
|
System.Security.Permissions.FileIOPermissionAccess |
5% |
|
System.Security.Permissions.FileIOPermissionAttribute |
5% |
|
System.Security.Permissions.PermissionState |
5% |
|
System.Security.Permissions.SecurityAction |
5% |
|
System.Security.Permissions.SecurityAttribute |
5% |
|
System.Security.Permissions.SecurityPermission |
5% |
|
System.Security.Permissions.SecurityPermissionAttribute |
5% |
|
System.Security.Permissions.SecurityPermissionFlag |
5% |
|
System.Security.PermissionSet |
5% |
|
System.Security.SecurityElement |
5% |
|
System.Security.SecurityException |
5% |
|
System.Security.VerificationException |
5% |
|
System.Text.ASCIIEncoding |
5% |
|
System.Text.Decoder |
5% |
|
System.Text.Encoder |
5% |
|
System.Text.Encoding |
5% |
|
System.Text.StringBuilder |
5% |
|
System.Text.UnicodeEncoding |
5% |
|
System.Text.UTF8Encoding |
5% |
|
System.Threading.WaitHandle |
5% |
|
System.UInt16 |
5% |
|
System.UInt32 |
5% |
|
System.UInt64 |
5% |
|
System.Version |
5% |
|
System.Globalization.NumberFormatInfo |
0% |
|
NET
Item |
%Complete as of 6/28 |
|
System.Net.EndPoint |
100% |
|
System.Net.HttpStatusCode |
100% |
|
System.Net.HttpVersion |
100% |
|
System.Net.IPHostEntry |
100% |
|
System.Net.IWebProxy |
100% |
|
System.Net.IWebRequestCreate |
100% |
|
System.Net.NetworkAccess |
100% |
|
System.Net.ProtocolViolationException |
100% |
|
System.Net.Sockets.AddressFamily |
100% |
|
System.Net.Sockets.ProtocolType |
100% |
|
System.Net.Sockets.SelectMode |
100% |
|
System.Net.Sockets.SocketException |
100% |
|
System.Net.Sockets.SocketFlags |
100% |
|
System.Net.Sockets.SocketOptionLevel |
100% |
|
System.Net.Sockets.SocketOptionName |
100% |
|
System.Net.Sockets.SocketShutdown |
100% |
|
System.Net.Sockets.SocketType |
100% |
|
System.Net.TransportType |
100% |
|
System.Net.WebExceptionStatus |
100% |
|
System.Net.WebResponse |
100% |
|
System.Uri |
100% |
|
System.UriFormatException |
100% |
|
System.UriHostNameType |
100% |
|
System.UriPartial |
100% |
|
System.Collections.Specialized.NameValueCollection |
95% |
|
System.Net.IPAddress |
95% |
|
System.Net.SocketAddress |
95% |
|
System.Net.ServicePoint |
90% |
|
System.Net.Sockets.LingerOption |
90% |
|
System.Net.Sockets.NetworkStream |
90% |
|
System.Net.WebProxy |
90% |
|
System.Net.WebRequest |
90% |
|
System.Net.Dns |
85% |
|
System.Net.IPEndPoint |
85% |
|
System.Net.Sockets.MulticastOption |
85% |
|
System.Net.WebHeaderCollection |
85% |
|
System.Net.Sockets.Socket |
75% |
|
System.Net.HttpWebRequest |
35% |
|
System.Net.ServicePointManager |
35% |
|
System.Net.AuthenticationManager |
0% |
|
System.Net.Authorization |
0% |
|
System.Net.CredentialCache |
0% |
|
System.Net.DnsPermission |
0% |
|
System.Net.DnsPermissionAttribute |
0% |
|
System.Net.GlobalProxySelection |
0% |
|
System.Net.HttpContinueDelegate |
0% |
|
System.Net.HttpWebResponse |
0% |
|
System.Net.IAuthenticationModule |
0% |
|
System.Net.ICredentials |
0% |
|
System.Net.NetworkCredential |
0% |
|
System.Net.SocketPermission |
0% |
|
System.Net.SocketPermissionAttribute |
0% |
|
System.Net.Sockets.MulticastOption |
0% |
|
System.Net.WebClient |
0% |
|
System.Net.WebException |
0% |
|
System.Net.WebPermission |
0% |
|
System.Net.WebPermissionAttribute |
0% |
|
System.UriBuilder |
0% |
|
XML
Item |
%Complete as of 6/28 |
|
System.Xml.Formatting |
100% |
|
System.Xml.ReadState |
100% |
|
System.Xml.WhitespaceHandling |
100% |
|
System.Xml.WriteState |
100% |
|
System.Xml.XmlException |
100% |
|
System.Xml.XmlNameTable |
100% |
|
System.Xml.XmlNodeType |
100% |
|
System.Xml.XmlResolver |
100% |
|
System.Xml.XmlSpace |
100% |
|
System.Xml.XmlParserContext |
95% |
|
System.Xml.XmlWriter |
95% |
|
System.Xml.NameTable |
90% |
|
System.Xml.XmlConvert |
90% |
|
System.Xml.XmlReader |
90% |
|
System.Xml.XmlTextWriter |
90% |
|
System.Xml.XmlNamespaceManager |
85% |
|
System.Xml.XmlTextReader |
80% |
|
System.Xml.XmlUrlResolver |
75% |
|
Reflection
Item |
%Complete as of 6/28 |
|
System.Reflection.AmbiguousMatchException |
100% |
|
System.Reflection.BindingFlags |
100% |
|
System.Reflection.EventAttributes |
100% |
|
System.Reflection.FieldAttributes |
100% |
|
System.Reflection.MethodAttributes |
100% |
|
System.Reflection.ParameterAttributes |
100% |
|
System.Reflection.ParameterModifier |
100% |
|
System.Reflection.PropertyAttributes |
100% |
|
System.Reflection.TargetException |
100% |
|
System.Reflection.TargetInvocationException |
100% |
|
System.Reflection.TargetParameterCountException |
100% |
|
System.Reflection.TypeAttributes |
100% |
|
System.Reflection.MemberInfo |
70% |
|
System.Reflection.MethodBase |
70% |
|
System.Reflection.ConstructorInfo |
40% |
|
System.Reflection.Module |
40% |
|
System.Reflection.ParameterInfo |
40% |
|
System.Reflection.Binder |
30% |
|
System.Reflection.MethodInfo |
30% |
|
System.Globalization.CultureInfo |
0% |
|
System.Reflection.EventInfo |
0% |
|
System.Reflection.FieldInfo |
0% |
|
System.Reflection.PropertyInfo |
0% |
|
System.Security.Permissions.ReflectionPermission |
0% |
|
System.Security.Permissions.ReflectionPermissionAttribute |
0% |
|
System.Security.Permissions.ReflectionPermissionFlag |
0% |
|
System.Void |
0% |