Self contained cli assemblies
This presentation is the property of its rightful owner.
Sponsored Links
1 / 15

Self-Contained CLI Assemblies PowerPoint PPT Presentation


  • 70 Views
  • Uploaded on
  • Presentation posted in: General

Self-Contained CLI Assemblies. Dipl.-Inf. Bernhard Rabe Operating Systems & Middleware Group Hasso-Plattner-Institute University of Potsdam. Outline. Motivation Self-contained Assemblies Micro.NET Adaptive Linking Conclusions. Motivation.

Download Presentation

Self-Contained CLI Assemblies

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Self contained cli assemblies

Self-Contained CLI Assemblies

Dipl.-Inf. Bernhard Rabe

Operating Systems & Middleware Group

Hasso-Plattner-Institute

University of Potsdam


Outline

Outline

  • Motivation

  • Self-contained Assemblies

    • Micro.NET

    • Adaptive Linking

  • Conclusions

.NET Technologies'2006, Plzeň


Motivation

Motivation

  • Common Language Infrastructure (CLI) features:

    • Loose coupling

      • Dynamic linking is required at load time

      • fusion engine (.dll vs. .exe)

    • Byte code consistency is verifiable

      • Execution behavior depends on Base Class Library (BCL) implementation (.NET, Rotor, Mono, …)

    • Comprehensive class library

      • High memory requirements of runtime environment

.NET Technologies'2006, Plzeň


C example

C# Example

public static int Main(string[] args)

{

Object obj=new Object();

return 1;

}

.NET Technologies'2006, Plzeň


Dynamic linking

AssemblyRef

Assembly

mscorlib B7 7A 5C 56 19 34 E0 89

mscorlib

TypeDef

TypeRef

System.Object

System.Array

System.Object

MemberRef

.ctor

MethodDef

Equals

.ctor

ret

Dynamic Linking

usercode.exe

mscorlib.dll

newobj 0x0a000001

pop

ldc.i4.1

ret

Main

.ctor

.NET Technologies'2006, Plzeň


Micro net

Micro.NET

  • CLR library independent deployment format

    • Self-contained assemblies

  • IL interpreter for small embedded devices (Lego Mindstorm)

  • Micro.NET deals with .NET for resource limited systems

    • memory

    • processing power

.NET Technologies'2006, Plzeň


Runtime memory footprint

Runtime Memory Footprint

  • Assembly

  • Custom Library assemblies

  • Base Class Library

  • CLR

Self-contained Assembly

.NET Technologies'2006, Plzeň


Self contained assemblies

Self-contained Assemblies

  • No external references

    • BCL independent

  • Fewer memory consumption

    • Metadata of assemblies

  • Reduced startup delay

    • type resolving

  • Optimizations under investigation

    • Whole program analysis

    • Metadata

  • Optimizations without Common Language Runtime (CLR) modifications

.NET Technologies'2006, Plzeň


Avoiding dynamic linking

Avoiding Dynamic Linking

  • Compile to native code e.g. CIL front-end

    • no VM features: gc, sandbox

    • code verification is challenging

    • platform dependent

  • Reduce the number of assemblies/references

    • combine assemblies

    • Streamlining dynamic linking

.NET Technologies'2006, Plzeň


Adaptive linking

Configuration

Linker tool

Adaptive Linking

library

library

usercode.exe

self-contained

assembly

Base Class Library

.NET Technologies'2006, Plzeň


Adaptive linking1

Adaptive Linking

  • PERWAPI library* based linker tool

  • Combine referenced types into a self-contained assembly

  • Types are processed recursively

  • Fine granular linking (type level)

    *Queensland University of Technology (QUT), Australia

.NET Technologies'2006, Plzeň


Cil of c example excerpt

CIL of C# example (excerpt)

.class a{

.method public hidebysig specialname rtspecialname instance void .ctor() cil managed {…}

.method public hidebysig static void Main(string[] args) cil managed{

.entrypoint

.maxstack 1

newobj instance void [mscorlib]System.Object::.ctor()

pop

ldc.i4.1

ret

}

}

.NET Technologies'2006, Plzeň


Self contained excerpt

Self-contained (excerpt)

.class Hello {

.method public hidebysig specialname rtspecialname instance void .ctor() cil managed {…}

.method public hidebysig static void Main(string[] args) cil managed{

newobj instance void System.Object::.ctor()

}

}

.class System.Object{

.method public hidebysig specialname rtspecialname instance void .ctor() cil managed {…}

.method family hidebysig virtual instance void Finalize() cil managed{…}

}

.NET Technologies'2006, Plzeň


Results

Results

  • PoCs run on Rotor, Mono, and Portable.NET without CLR modfications

  • None CLR portable features

    • internalcall

      • System.Object::Equals(object obj) .NET vs. Mono

    • runtime

    • pinvokeimpl

  • Necessity for an highly portable BCL

    • Source for Self-contained Assemblies

.NET Technologies'2006, Plzeň


Conclusion

Conclusion

  • Self-contained assemblies

    • .NET on resource constrained systems

    • reduced resource consumption

    • Optimized deployment format for resource limited systems

  • No CLR modifications required

.NET Technologies'2006, Plzeň


  • Login