Jacil Technical Report

Total Page:16

File Type:pdf, Size:1020Kb

Jacil Technical Report JaCIL: A CLI to JVM Compiler Technical Report Almann T. Goo [email protected] Rochester Institute of Technology Department of Computer Science July 25, 2006 Abstract Both the .NET Framework via the Common Language Infrastructure (CLI) [15] and the Java Virtual Machine (JVM) [14] provide a managed, virtual exe- cution environment for running high-level virtual machine code. As these two platforms become ubiquitous, it is of pragmatic and academic interest to have the capability of running CLI code on the JVM and vice-versa. This report describes JaCIL (pronounced “jackal”), a project that implements a CLI assembly to JVM class file byte-code compiler framework. Also pro- vided by JaCIL, is a user-land tool interfacing this framework, and a run- time library to support translated code. Contents 1 Introduction 11 1.1 The Java Virtual Machine ..................... 11 1.2 The Common Language Infrastructure .............. 12 1.3 Related Work ............................. 13 1.3.1 Previous Translation Efforts and Platform Comparisons 13 1.3.2 IKVM.NET Java Virtual Machine ............ 13 1.3.3 Visual MainWin for J2EE ................. 14 1.3.4 Retroweaver ......................... 14 1.3.5 The Mono and DotGNU Projects ............. 14 2 JaCIL Software Design 16 2.1 Functional Specification ...................... 16 2.1.1 JaCIL Compiler Framework ................ 16 2.1.2 JaCIL Run-time Library .................. 17 2.2 Technical Design and Architecture ................ 17 2.2.1 Compiler Framework Overview .............. 18 2.2.2 The Compiler API ...................... 18 2.2.3 The Context API ....................... 21 2.2.3.1 Standard Context API Implementation .... 23 1 2.2.4 The Translator API ..................... 23 2.2.4.1 Standard Translator API Implementation .. 26 2.2.5 The Utility API ....................... 28 2.2.6 The jacilc Application .................. 28 3 CLI Feature Specification 30 3.1 Assemblies .............................. 30 3.1.1 Assembly Translation Limitations ............ 31 3.2 Assembly Entry Points ....................... 31 3.2.1 Entry Point Translation Limitations ........... 31 3.3 Modules ................................ 32 3.4 Types ................................. 32 3.4.1 Type Translation Limitations ............... 33 3.4.1.1 Name Mangling .................. 33 3.4.1.2 Array Support ................... 33 3.4.1.3 Generics ...................... 34 3.4.1.4 Inner Classes ................... 34 3.4.1.5 Enumerations ................... 34 3.4.1.6 Delegates ..................... 34 3.5 Managed Pointers .......................... 34 3.5.1 Managed Pointer Translation Limitations ........ 35 3.6 Value Types ............................. 35 3.6.1 Value Type Translation Limitations ........... 35 3.7 Type Definitions ........................... 35 3.7.1 Value Type Definitions ................... 37 3.7.2 Type Definition Translation Limitations ......... 37 2 3.8 Field Definitions ........................... 37 3.8.1 Field Definition Translation Limitations ......... 37 3.9 Method Definitions ......................... 39 3.9.1 Method Name Mangling .................. 39 3.9.2 Local Variables ....................... 41 3.9.3 Exception Handling Support ................ 42 3.9.4 Constructors ......................... 42 3.9.5 Method Definition Translation Limitations ....... 43 3.10 JaCIL Implementation of Standard CLI API .......... 44 3.10.1 System.Object Implementation ............. 44 3.10.2 System.Type Implementation .............. 45 3.10.3 Other Classes ........................ 45 3.11 Instruction Set Support ....................... 45 3.11.1 Non-operation Instructions ................ 45 3.11.2 Stack Instructions ...................... 48 3.11.2.1 Stack Duplication of Value Types ........ 48 3.11.3 Local Variable and Argument Instructions ....... 48 3.11.3.1 Implicit Conversions ............... 49 3.11.3.2 Loading and Storing to Boxed Local Variables 49 3.11.3.3 Value Type Loading ............... 50 3.11.4 Constant Loading Instructions .............. 50 3.11.5 Arithmetic Instructions .................. 50 3.11.5.1 Arithmetic Instruction Translation Limitations 52 3.11.6 Numeric Conversion Instructions ............. 53 3.11.7 Branch and Comparison Instructions .......... 53 3.11.7.1 Unconditional Branches ............. 55 3 3.11.7.2 The switch Instruction ............. 55 3.11.7.3 Comparison and Other Conditional Branches 55 3.11.8 Method Invocation and Return Instructions ....... 57 3.11.8.1 Method Invocation on Value Types ....... 57 3.11.8.2 Method Invocation Translation Limitations . 58 3.11.9 Static and Instance Field Access Instructions ...... 58 3.11.9.1 Field Access on Value Types ........... 59 3.11.10Object Creation and Initialization ............ 59 3.11.11Vector Instructions ..................... 60 3.11.11.1Vector Element Access .............. 60 3.11.11.2Vector Creation .................. 62 3.11.11.3Vector Length ................... 62 3.11.12Exception Instructions ................... 62 3.11.12.1Exception Throwing ............... 62 3.11.12.2Leaving Protected Blocks ............ 62 3.11.12.3Leaving Finally Blocks .............. 63 3.11.13Indirection Instructions .................. 63 3.11.14Address Load Instructions ................. 64 3.11.14.1Local Variable Address Load .......... 64 3.11.14.2Static and Instance Field Address Load .... 65 3.11.14.3Array Element Address Load .......... 65 3.11.15Value Type and Reference Type Instructions ...... 65 3.11.15.1Boxing and Unboxing .............. 65 3.11.15.2The initobj instruction ............ 66 3.11.15.3Reference Type Checking and Conversion ... 66 3.12 Translation Examples ....................... 67 4 3.12.1 Basic Operations ...................... 67 3.12.2 Exceptions .......................... 67 3.12.3 Value Types and Managed Pointers ........... 68 4 JaCIL User Guide 77 4.1 Building JaCIL ........................... 77 4.2 Using the Compiler Tool ...................... 78 4.3 Running Compiled Code ...................... 80 5 Performance and Benchmarking 82 5.1 Blowfish Cipher ........................... 83 5.2 MD5 Message Digest ........................ 84 5.3 Line Drawing Algorithm with Value Types ........... 84 5.4 Bresenham’s Line Drawing Algorithm with Managed Pointers 85 6 Conclusions 86 6.1 Lessons Learned ........................... 86 6.2 Future Work ............................. 87 6.2.1 Missing Compiler Features ................ 87 6.2.2 CLI Standard API ...................... 87 6.2.3 JaCIL on the JVM ...................... 87 6.2.4 CLI Implementation .................... 87 5 List of Figures 2.1 Compiler API class relationships ................. 20 2.2 Context API interface hierarchy .................. 22 2.3 Cross-section of the Context API interface relationships .... 23 2.4 Standard Context API control flow ................ 24 2.5 Cross-section of Translator API interface relationships .... 25 2.6 IInstructionTranslator creation flow in standard factory implementation ........................... 27 2.7 jacilc control flow ......................... 29 3.1 Value type translation memory diagram for local variables .. 36 3.2 Sample C# method definition with basic operations ...... 69 3.3 CIL code compiled from source in figure 3.2 ........... 70 3.4 Java byte-code generated by JaCIL from the code in figure 3.3 71 3.5 Sample C# method definition with a catch handler ....... 72 3.6 CIL code compiled from source in figure 3.5 ........... 73 3.7 Java byte-code generated by JaCIL from the code in figure 3.6 74 3.8 Sample C# method definition with value type operations ... 75 3.9 CIL code compiled from source in figure 3.8 ........... 75 3.10 Java byte-code generated by JaCIL from the code in figure 3.9 76 6 4.1 jacilc.exe output with -? switch ............... 79 4.2 Using jacilc.exe to compile an assembly to a JAR file ... 80 4.3 Running translated code ...................... 80 4.4 Sample C# “Hello World” type program ............. 81 7 List of Tables 2.1 JaCIL Compiler Framework namespaces ............ 18 2.2 ICompiler primary methods ................... 19 2.3 ITypeTranslator translation methods ............. 26 2.4 JaCIL Compiler utility primary classes ............. 28 3.1 JaCIL built-in type mapping .................... 32 3.2 JaCIL managed pointer type mapping .............. 33 3.3 Supported CLI type attributes and their JVM translations .. 36 3.4 Supported CLI field attributes and their JVM translations .. 38 3.5 Supported CLI method attributes and their JVM translations 40 3.6 Supported CLI implementation attributes and their JVM trans- lations ................................. 41 3.7 java.lang.Object method overrides in System.Object .. 44 3.8 JaCIL supported instructions add through ldelem.u1 .... 46 3.9 JaCIL supported instructions ldelem.u2 through xor .... 47 3.10 CIL Local variable and argument load instructions ...... 48 3.11 JVM Local variable load instructions ............... 49 3.12 CIL Local variable and argument store instructions ...... 49 3.13 JVM Local variable store instructions .............. 49 3.14 CIL field access instruction translation semantics ....... 50 8 3.15 JVM numeric instruction prefixes ................. 51 3.16 JaCIL translations for CIL arithmetic operations on integers and floating point values ...................... 52 3.17 CIL Arithmetic Instructions for integer types only ....... 52 3.18 CIL conversion instruction target types ............. 53 3.19 CIL conversion instruction target JVM stack types ....... 54 3.20 Additional operations for small integer conversion ....... 54 3.21 Translation semantics
Recommended publications
  • Ironpython in Action
    IronPytho IN ACTION Michael J. Foord Christian Muirhead FOREWORD BY JIM HUGUNIN MANNING IronPython in Action Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> IronPython in Action MICHAEL J. FOORD CHRISTIAN MUIRHEAD MANNING Greenwich (74° w. long.) Download at Boykma.Com Licensed to Deborah Christiansen <[email protected]> For online information and ordering of this and other Manning books, please visit www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact Special Sales Department Manning Publications Co. Sound View Court 3B fax: (609) 877-8256 Greenwich, CT 06830 email: [email protected] ©2009 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Recognizing also our responsibility to conserve the resources of our planet, Manning books are printed on paper that is at least 15% recycled and processed without the use of elemental chlorine.
    [Show full text]
  • IJIRT | Volume 2 Issue 6 | ISSN: 2349-6002
    © November 2015 | IJIRT | Volume 2 Issue 6 | ISSN: 2349-6002 .Net Surbhi Bhardwaj Dronacharya College of Engineering Khentawas, Haryana INTRODUCTION as smartphones. Additionally, .NET Micro .NET Framework (pronounced dot net) is Framework is targeted at severely resource- a software framework developed by Microsoft that constrained devices. runs primarily on Microsoft Windows. It includes a large class library known as Framework Class Library (FCL) and provides language WHAT IS THE .NET FRAMEWORK? interoperability(each language can use code written The .NET Framework is a new and revolutionary in other languages) across several programming platform created by Microsoft for languages. Programs written for .NET Framework developingapplications. execute in a software environment (as contrasted to hardware environment), known as Common It is a platform for application developers. Language Runtime (CLR), an application virtual It is a Framework that supports Multiple machine that provides services such as Language and Cross language integration. security, memory management, and exception handling. FCL and CLR together constitute .NET IT has IDE (Integrated Development Framework. Environment). FCL provides user interface, data access, database Framework is a set of utilities or can say connectivity, cryptography, web building blocks of your application system. application development, numeric algorithms, .NET Framework provides GUI in a GUI and network communications. Programmers manner. produce software by combining their own source code with .NET Framework and other libraries. .NET is a platform independent but with .NET Framework is intended to be used by most new help of Mono Compilation System (MCS). applications created for the Windows platform. MCS is a middle level interface. Microsoft also produces an integrated development .NET Framework provides interoperability environment largely for .NET software called Visual between languages i.e.
    [Show full text]
  • NET Framework
    Advanced Windows Programming .NET Framework based on: A. Troelsen, Pro C# 2005 and .NET 2.0 Platform, 3rd Ed., 2005, Apress J. Richter, Applied .NET Frameworks Programming, 2002, MS Press D. Watkins et al., Programming in the .NET Environment, 2002, Addison Wesley T. Thai, H. Lam, .NET Framework Essentials, 2001, O’Reilly D. Beyer, C# COM+ Programming, M&T Books, 2001, chapter 1 Krzysztof Mossakowski Faculty of Mathematics and Information Science http://www.mini.pw.edu.pl/~mossakow Advanced Windows Programming .NET Framework - 2 Contents The most important features of .NET Assemblies Metadata Common Type System Common Intermediate Language Common Language Runtime Deploying .NET Runtime Garbage Collection Serialization Krzysztof Mossakowski Faculty of Mathematics and Information Science http://www.mini.pw.edu.pl/~mossakow Advanced Windows Programming .NET Framework - 3 .NET Benefits In comparison with previous Microsoft’s technologies: Consistent programming model – common OO programming model Simplified programming model – no error codes, GUIDs, IUnknown, etc. Run once, run always – no "DLL hell" Simplified deployment – easy to use installation projects Wide platform reach Programming language integration Simplified code reuse Automatic memory management (garbage collection) Type-safe verification Rich debugging support – CLR debugging, language independent Consistent method failure paradigm – exceptions Security – code access security Interoperability – using existing COM components, calling Win32 functions Krzysztof
    [Show full text]
  • Understanding CIL
    Understanding CIL James Crowley Developer Fusion http://www.developerfusion.co.uk/ Overview Generating and understanding CIL De-compiling CIL Protecting against de-compilation Merging assemblies Common Language Runtime (CLR) Core component of the .NET Framework on which everything else is built. A runtime environment which provides A unified type system Metadata Execution engine, that deals with programs written in a Common Intermediate Language (CIL) Common Intermediate Language All compilers targeting the CLR translate their source code into CIL A kind of assembly language for an abstract stack-based machine, but is not specific to any hardware architecture Includes instructions specifically designed to support object-oriented concepts Platform Independence The intermediate language is not interpreted, but is not platform specific. The CLR uses JIT (Just-in-time) compilation to translate the CIL into native code Applications compiled in .NET can be moved to any machine, providing there is a CLR implementation for it (Mono, SSCLI etc) Demo Generating IL using the C# compiler .method private hidebysig static void Main(string[] args) cil managed { .entrypoint // Code size 31 (0x1f) Some familiar keywords with some additions: .maxstack 2 .locals init (int32 V_0, .method – this is a method int32 V_1, hidebysig – the method hides other methods with int32 V_2) the same name and signature. IL_0000: ldc.i4.s 50 cil managed – written in CIL and should be IL_0002: stloc.0 executed by the execution engine (C++ allows IL_0003: ldc.i4.s
    [Show full text]
  • Working with Ironpython and WPF
    Working with IronPython and WPF Douglas Blank Bryn Mawr College Programming Paradigms Spring 2010 With thanks to: http://www.ironpython.info/ http://devhawk.net/ IronPython Demo with WPF >>> import clr >>> clr.AddReference("PresentationFramework") >>> from System.Windows import * >>> window = Window() >>> window.Title = "Hello" >>> window.Show() >>> button = Controls.Button() >>> button.Content = "Push Me" >>> panel = Controls.StackPanel() >>> window.Content = panel >>> panel.Children.Add(button) 0 >>> app = System.Windows.Application() >>> app.Run(window) XAML Example: Main.xaml <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x="http://schemas.microsoft.com/winfx/2006/xaml" Title="TestApp" Width="640" Height="480"> <StackPanel> <Label>Iron Python and WPF</Label> <ListBox Grid.Column="0" x:Name="listbox1" > <ListBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding Path=title}" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </StackPanel> </Window> IronPython + XAML import sys if 'win' in sys.platform: import pythoncom pythoncom.CoInitialize() import clr clr.AddReference("System.Xml") clr.AddReference("PresentationFramework") clr.AddReference("PresentationCore") from System.IO import StringReader from System.Xml import XmlReader from System.Windows.Markup import XamlReader, XamlWriter from System.Windows import Window, Application xaml = """<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Title="XamlReader Example" Width="300" Height="200"> <StackPanel Margin="5"> <Button
    [Show full text]
  • The Zonnon Project: a .NET Language and Compiler Experiment
    The Zonnon Project: A .NET Language and Compiler Experiment Jürg Gutknecht Vladimir Romanov Eugene Zueff Swiss Fed Inst of Technology Moscow State University Swiss Fed Inst of Technology (ETH) Computer Science Department (ETH) Zürich, Switzerland Moscow, Russia Zürich, Switzerland [email protected] [email protected] [email protected] ABSTRACT Zonnon is a new programming language that combines the style and the virtues of the Pascal family with a number of novel programming concepts and constructs. It covers a wide range of programming models from algorithms and data structures to interoperating active objects in a distributed system. In contrast to popular object-oriented languages, Zonnon propagates a symmetric compositional inheritance model. In this paper, we first give a brief overview of the language and then focus on the implementation of the compiler and builder on top of .NET, with a particular emphasis on the use of the MS Common Compiler Infrastructure (CCI). The Zonnon compiler is an interesting showcase for the .NET interoperability platform because it implements a non-trivial but still “natural” mapping from the language’s intrinsic object model to the underlying CLR. Keywords Oberon, Zonnon, Compiler, Common Compiler Infrastructure (CCI), Integration. 1. INTRODUCTION: THE BRIEF CCI and b) to experiment with evolutionary language HISTORY OF THE PROJECT concepts. The notion of active object was taken from the Active Oberon language [Gut01]. In addition, two This is a technical paper presenting and describing new concurrency mechanisms have been added: an the current state of the Zonnon project. Zonnon is an accompanying communication mechanism based on evolution of the Pascal, Modula, Oberon language syntax-oriented protocols , borrowed from the Active line [Wir88].
    [Show full text]
  • Languages and Compilers (Sprog Og Oversættere)
    Languages and Compilers (SProg og Oversættere) Bent Thomsen Department of Computer Science Aalborg University With acknowledgement to Microsoft, especially Nick Benton,whose slides this lecture is based on. 1 The common intermediate format nirvana • If we have n number of languages and need to have them running on m number of machines we need m*n compilers! •Ifwehave onecommon intermediate format we only need n front-ends and m back-ends, i.e. m+n • Why haven’t you taught us about the common intermediate language? 2 Strong et al. “The Problem of Programming Communication with Changing Machines: A Proposed Solution” C.ACM. 1958 3 Quote This concept is not particularly new or original. It has been discussed by many independent persons as long ago as 1954. It might not be difficult to prove that “this was well-known to Babbage,” so no effort has been made to give credit to the originator, if indeed there was a unique originator. 4 “Everybody knows that UNCOL was a failure” • Subsequent attempts: – Janus (1978) • Pascal, Algol68 – Amsterdam Compiler Kit (1983) • Modula-2, C, Fortran, Pascal, Basic, Occam – Pcode -> Ucode -> HPcode (1977-?) • FORTRAN, Ada, Pascal, COBOL, C++ – Ten15 -> TenDRA -> ANDF (1987-1996) • Ada, C, C++, Fortran – .... 5 Sharing parts of compiler pipelines is common • Compiling to textual assembly language • Retargetable code-generation libraries – VPO, MLRISC • Compiling via C – Cedar, Fortran, Modula 2, Ada, Scheme, Standard ML, Haskell, Prolog, Mercury,... • x86 is a pretty convincing UNCOL – pure software translation
    [Show full text]
  • Programming with Windows Forms
    A P P E N D I X A ■ ■ ■ Programming with Windows Forms Since the release of the .NET platform (circa 2001), the base class libraries have included a particular API named Windows Forms, represented primarily by the System.Windows.Forms.dll assembly. The Windows Forms toolkit provides the types necessary to build desktop graphical user interfaces (GUIs), create custom controls, manage resources (e.g., string tables and icons), and perform other desktop- centric programming tasks. In addition, a separate API named GDI+ (represented by the System.Drawing.dll assembly) provides additional types that allow programmers to generate 2D graphics, interact with networked printers, and manipulate image data. The Windows Forms (and GDI+) APIs remain alive and well within the .NET 4.0 platform, and they will exist within the base class library for quite some time (arguably forever). However, Microsoft has shipped a brand new GUI toolkit called Windows Presentation Foundation (WPF) since the release of .NET 3.0. As you saw in Chapters 27-31, WPF provides a massive amount of horsepower that you can use to build bleeding-edge user interfaces, and it has become the preferred desktop API for today’s .NET graphical user interfaces. The point of this appendix, however, is to provide a tour of the traditional Windows Forms API. One reason it is helpful to understand the original programming model: you can find many existing Windows Forms applications out there that will need to be maintained for some time to come. Also, many desktop GUIs simply might not require the horsepower offered by WPF.
    [Show full text]
  • Using Powershell and Reflection API to Invoke Methods from .NET
    Using Powershell and Reflection API to invoke methods from .NET Assemblies written by Khai Tran | October 14, 2013 During application assessments, I have stumbled upon several cases when I need to call out a specific function embedded in a .NET assembly (be it .exe or .dll extension). For example, an encrypted database password is found in a configuration file. Using .NET Decompiler, I am able to see and identify the function used to encrypt the database password. The encryption key appears to be static, so if I could call the corresponding decrypt function, I would be able to recover that password. Classic solution: using Visual Studio to create new project, import encryption library, call out that function if it’s public or use .NET Reflection API if it’s private (or just copy the class to the new workspace, change method accessibility modifier to public and call out the function too if it is self-contained). Alternative (and hopeful less-time consuming) solution: Powershell could be used in conjunction with .NET Reflection API to invoke methods directly from the imported assemblies, bypassing the need of an IDE and the grueling process of compiling source code. Requirements Powershell and .NET framework, available at http://www.microsoft.com/en-us/download/details.aspx?id=34595 Note that Powershell version 3 is used in the below examples, and the assembly is developed in C#. Walkthrough First, identify the fully qualified class name (typically in the form of Namespace.Classname ), method name, accessibility level, member modifier and method arguments. This can easily be done with any available .NET Decompiler (dotPeek, JustDecompile, Reflector) Scenario 1: Public static class – Call public static method namespace AesSample { public class AesLibStatic { ..
    [Show full text]
  • NET Reverse Engineering
    .NET.NET ReverseReverse EngineeringEngineering Erez Metula, CISSP Application Security Department Manager Security Software Engineer 2B Secure ErezMetula @2bsecure.co.il Agenda • The problem of reversing & decompilation • Server DLL hijacking • Introduction to MSIL & the CLR • Advanced techniques • Debugging • Patching • Unpacking • Reversing the framework • Exposing .NET CLR vulnerabilities • Revealing Hidden functionality • Tools! The problem of reversing & decompilation • Code exposure • Business logic • Secrets in code – passwords – connection strings – Encryption keys • Intellectual proprietary (IP) & software piracy • Code modification • Add backdoors to original code • Change the application logic • Enable functionality (example: “only for registered user ”) • Disable functionality (example: security checks) Example – simple reversing • Let ’s peak into the code with reflector Example – reversing server DLL • Intro • Problem description (code) • Topology • The target application • What we ’ll see Steps – tweaking with the logic • Exploiting ANY server / application vulnerability to execute commands • Information gathering • Download an assembly • Reverse engineer the assembly • Change the assembly internal logic • Upload the modified assembly, overwrite the old one. • Wait for some new action • Collect the data … Exploiting ANY server / application vulnerability to execute commands • Example application has a vulnerability that let us to access th e file system • Sql injection • Configuration problem (Open share, IIS permissions,
    [Show full text]
  • Diploma Thesis
    Faculty of Computer Science Chair for Real Time Systems Diploma Thesis Porting DotGNU to Embedded Linux Author: Alexander Stein Supervisor: Jun.-Prof. Dr.-Ing. Robert Baumgartl Dipl.-Ing. Ronald Sieber Date of Submission: May 15, 2008 Alexander Stein Porting DotGNU to Embedded Linux Diploma Thesis, Chemnitz University of Technology, 2008 Abstract Programming PLC systems is limited by the provided libraries. In contrary, hardware-near programming needs bigger eorts in e. g. initializing the hardware. This work oers a foundation to combine advantages of both development sides. Therefore, Portable.NET from the DotGNU project has been used, which is an im- plementation of CLI, better known as .NET. The target system is the PLCcore- 5484 microcontroller board, developed by SYS TEC electronic GmbH. Built upon the porting, two variants to use interrupt routines withing the Portabe.NET runtime environment have been analyzed. Finally, the reaction times to occuring interrupt events have been examined and compared. Die Programmierung für SPS-Systeme ist durch die gegebenen Bibliotheken beschränkt, während hardwarenahe Programmierung einen gröÿeren Aufwand durch z.B. Initialisierungen hat. Diese Arbeit bietet eine Grundlage, um die Vorteile bei- der Entwicklungsseiten zu kombinieren. Dafür wurde Portable.NET des DotGNU- Projekts, eine Implementierung des CLI, bekannter unter dem Namen .NET, be- nutzt. Das Zielsystem ist das PLCcore-5484 Mikrocontrollerboard der SYS TEC electronic GmbH. Aufbauend auf der Portierung wurden zwei Varianten zur Ein- bindung von Interrupt-Routinen in die Portable.NET Laufzeitumgebung untersucht. Abschlieÿend wurden die Reaktionszeiten zu eintretenden Interrupts analysiert und verglichen. Acknowledgements I would like to thank some persons who had inuence and supported me in my work.
    [Show full text]
  • Mono on F&S Boards
    Mono on F&S Boards Version 0.2 (2020-06-16) © F&S Elektronik Systeme GmbH Untere Waldplätze 23 D-70569 Stuttgart Germany Phone: +49(0)711-123722-0 Fax: +49(0)711-123722-99 About This Document This document describes how to run .NET framework applications via Mono on F&S Boards. Remark The version number on the title page of this document is the version of the document. It is not related to the version number of any software release! The latest version of this document can always be found at http://www.fs-net.de. How To Print This Document This document is designed to be printed double-sided (front and back) on A4 paper. If you want to read it with a PDF reader program, you should use a two-page layout where the title page is an extra single page. The settings are correct if the page numbers are at the outside of the pages, even pages on the left and odd pages on the right side. If it is reversed, then the title page is handled wrongly and is part of the first double-page instead of a single page. Titlepage 8 9 Typographical Conventions We use different fonts and highlighting to emphasize the context of special terms: File names Menu entries Board input/output Program code PC input/output Listings Generic input/output Variables History Date V Platform A,M,R Chapter Description Au 2020-05-18 0.1 ALL A ALL Initial version PG 2020-06-09 0.2 ALL M ALL Correct typos and footer PG 2020-06-09 0.2 ALL A 2 Add System requirements chapter PG 2020-06-09 0.2 ALL M 8 Add GTK# tutorial directly into this document PG V Version A,M,R Added, Modified, Removed
    [Show full text]