现在的位置: 首页 > 综合 > 正文

Shared Source CLI 2.0 Directory Layout Overview

2018年01月21日 ⁄ 综合 ⁄ 共 7638字 ⁄ 字号 评论关闭
文章目录

sscli20 is the top-level directory

To build the SSCLI, you must be running within a command window in Microsoft Windows®. The build procedure is detailed in the document

building_sscli.html
; but to summarize, you first set up your environment by running one of the env scripts with one of the build options (checked, debug, or free) and then run the buildall.bat batch file. 

Key files in this directory:

  • license.txt and license_banner_for_sources.txt
  • env.bat
  • buildall.cmd
  • readfirst.html

sscli20/binaries.x86*.rotor contains build binary output

This directory is generated during the build process and contains the build output, including managed and unmanaged executables and shared dynamic link libraries and class libraries, as well as debugging symbols and the directory used as the global assembly
cache.  Note that some core build output can be found in the sscli20/binaries.x86*.rotor root directory, while tools are mostly in sdk/bin directory.

Each target that you build (debug, checked, or free) will generate a separate set of build output subdirectories. The "*" character will be replaced with "dbg" on debug builds, "chk" on checked builds and "fre" on free builds.

Note: The sscli20/binaries.x86*.rotor directory will only exist after a build has completed.

sscli20/clr/src contains the core CLI and base class library implementations

The sscli20/clr/src directory contains a substantial amount of the CLI and all the base class library code. The following table contains a detailed description of the key subdirectories.
 

Subdirectory Subdirectory Description
vm subdirectory Contains the bulk of the CLI core implementation, including the garbage collector, the class loader, the type system, error reporting, application domains, assemblies, delegate support, reflection, security, and the code manager.

The vm subdirectory contains numerous valuable files to review. (For those curious about the build process, note that vm has a
dirs file, but the sources file can be found in the vm/wks subdirectory.)

csharp subdirectory Contains the sources for the C# compiler (csc.exe) and the Assembly Linker.
classlibnative subdirectory Contains common types and internationalization routines.
dacupdatedll subdirectory Build scripts to autogenerate tables describing layout for the SOS debugger extension.
jit64 subdirectory Contains the source for the implementation of the standalone verifier. Sorry, no actual 64bit JIT here.
inc subdirectory Common include files.
ipcman subdirectory Contains the sources for interprocess communication.
managedlibraries subdirectory Contains source for remoting and the soapserializer.
utilcode subdirectory Contains core routines used throughout the runtime, the tools, and the C# compiler.

Includes code for path handling and parsing, array and hashtable management, C runtime routines, character case support, library and assembly loading, debugging and logging instrumentation, and synchronization, as well as utility code for many miscellaneous
tasks such as formatting, GUID creation, error handling, and registry and configuration access.

md subdirectory Contains a metadata reader and writer.
fjit subdirectory Contains the SSCLI JIT compiler and its verifier.
fusion subdirectory Contains code that implements binding to assemblies, policy checking for the binding process, and the global assembly cache.
bcl subdirectory Contains C# code for the ECMA base class libraries. Most of the interesting code is in
system and its sub-directories.
debug subdirectory Contains the source code for the Runtime Debugger.
ilasm subdirectory Contains the source code for the CIL Assembler.
ildasm subdirectory Contains the source code for the CIL Disassembler.
tools subdirectory Contains source code for the PEVerify tool, a managed code launch tool (clix.exe), a metadata dump tool (metainfo.exe), a reader/writer for managed debugger symbols, and numerous other tools.
toolbox subdirectory Contains source code for caspol, strike and other tools.
dlls subdirectory Contains subdirectories for all of the native shared libraries that are linked as a part of the build process.

These directories are useful for utility functions for building tools.

xmlparser subdirectory Contains source for the XML parser.

sscli20/docs is documentation for the Shared Source CLI

The sscli20/docs directory contains the documentation for the SSCLI.

Some points of interest in this directory:

  • relnotes.html - release notes.
  • testing_overview.html - overview of the testing infrastructure.
  • glossary.html - glossary of terms used in the documentation and source code.
  • index.html - index of documentation.

The subdirectories contain additional documentation.  See the index.html for the full details.

sscli20/fx/src contains C# code that implements fundamental managed class libraries

The sscli20/fx/src directory contains several subdirectories with implementations of major namespaces, such as regular expression support, XML support, and networking. There is also code in the subdirectories for other miscellaneous features.

sscli20/jscript/engine contains the sources for a JScript compiler

The JScript compiler is written entirely in C#, so it is interesting both as an example of a large C# project and as an example of how to compile against the CLI intermediate language. The compiler uses the
System.Reflection classes extensively in producing its managed executable output. JScript is also a very dynamic language, and as such, demonstrates many useful compiler techniques for generating CIL and runtime structures on the fly.

sscli20/pal contains implementations of the Platform Adaptation Layer (PAL)

Within the pal subdirectory there are two subdirectories,
unix
and win32. The unix directory contains the implementation of the PAL for UNIX system-based platforms and, logically enough, the win32 directory contains the Windows PAL. There is also an important
header file, rotor_pal.h, which declares all of the APIs that a developer building a new PAL would have to implement. See the
PAL Specification for more details on this topic.

The Win32 PAL is primarily a thin wrapper over the underlying Win32 API with some logging and parameter-checking functionality in some cases. The code for doing portable exception handling (in
exception.c) might be useful to read.

The PAL for UNIX system-based platforms, on the other hand, contains a substantial amount of significant code.  This code serves to map from Win32 API calls into equivalent functionality on UNIX system-based platforms where this exists, or implements that
functionality where it does not exist.  Some examples of the mapping work include Unicode support, exception handling, memory-mapped files, debugger support, sockets, and file I/O as well as other core functionality.

sscli20/palrt/src contains the implementation of the PAL runtime

To make life simpler for developers who wish to create new PAL implementations, some of the more generic or reusable implementation details have been split out into a separate library, called the PAL runtime.  Even if you are not implementing a PAL the sscli20/palrt/src
directory still might be of interest because it contains a number of useful odds and ends, including:

  • Implementation of the simple COM APIs used in SSCLI.
  • Cryptographic code used to support strong names and the CLI.
  • C runtime functions.
  • Math and decimal math routines.
  • Support for streaming over memory.
  • String, URL, and path name parsing and manipulation.
  • Configuration and resource loading.
  • Code used when calling from platform-native code to managed code.

The PAL runtime is used by the PAL on UNIX system-based platforms. Note the reduced set of Windows header files in
sscli20/palrt/inc subdirectory; these are included in order to pull in these API helpers. If you wish to implement a new PAL, you will probably want to use the same technique.

sscli20/samples contains source code for samples

The sscli20/samples directory contains samples that demonstrate SSCLI functionality.

sscli20/tests contains numerous tests and test suites

The sscli20/tests directory contains a large number of small tests that can be used, once you have built the sources, to avoid regressions while modifying the code. The file
rrun.pl is a Perl driver containing useful comments embedded within it that can be used to run the tests for the runtime itself, while the
palsuite subdirectory contains tests for the PAL implementation for UNIX system-based platforms.

sscli20/tools contains source code for portable build tools

Once a PAL has been created, using the native tool chain for whatever platform is being built, a set of portable build tools are then built against the PAL. This is the bootstrap that enables the bulk of the build process; these tools use the PAL APIs to
accomplish their work. Documentation for all of these tools can be found in the
sscli20/docs/buildtools
directory; see in particular build.exe, binplace.exe, and nmake.exe.

 

抱歉!评论已关闭.