1 / 29

Agenda

Platform Architecture Mike Zintel Development Manager .NET Compact Framework Microsoft Corporation. Agenda. Design goals Internals of the platform Key features that enable applications. Platform Design Goals. Portable & small .NET Common Language Runtime Leverage .NET tools

shina
Download Presentation

Agenda

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Platform Architecture Mike ZintelDevelopment Manager.NET Compact FrameworkMicrosoft Corporation

  2. Agenda • Design goals • Internals of the platform • Key features that enable applications

  3. Platform Design Goals • Portable & small .NET Common Language Runtime • Leverage .NET tools • Run .EXEs generated by .NET tools • Cross-debug with VS.NET • Peacefully co-exist with host OS • Scheduling, UI display surface & input, resource contention • Enable rich client Web Services apps • GUI, local storage, networking

  4. .NET Terminology • Execution Engine (EE) • Common Language Runtime (CLR) • .NET Compact Framework • Programming Frameworks • Class Libraries • Native Code, Managed Code, IL • Common Language Runtime Applications • OEM Application

  5. Developing A .NET App

  6. .NET CLR Features • Verifiable typesafe execution • No unsafe casts, no uninitialized variables, no out of bounds array indexing, no bad pointer math • Garbage Collection • No ref-counting, no leaks • JIT compilation • Portable & fast • Common type system • Call, inherit, and source-level debug across different languages

  7. .NET API Design • Code and data are expressed as classes • Described in metadata, no .h or idl files • Inheritance can be used to extend a class • APIs work across languages • APIs are organized in namespaces with strong naming conventions • Garbage Collection eliminates memory ownership issues

  8. .NET Error Handling • Error handling through exceptions • Not bools or HRESULTS • Error handling is mandatory • Default isn’t to “muddle on” • Descriptive exception messages • Not cryptic HRESULTS

  9. Language Support • Plans for… • C# • VB.NET • JScript (ECMAScript) • Will deliver in staggered fashion • Platform extensible to other languages • VS.NET packages planned for C#, VB

  10. Different Types of Host O/S • Static address space • System image defined at manufacturing time • pSOS, OSE, many custom O/S • Boot loader only • No “application” loader or interactive shell • CLR adds app loader, makes system extensible • Apps run in “App Domains” • Dynamic address space • Boot loader & application loader • Windows, Unix • Shell is provided by the O/S

  11. System Architecture

  12. Execution Engine • Class loader, verifier, JIT, GC, exception handling, code access security, debugging • Provides hardware and O/S independent program execution • No MMU required on the target CPU • Garbage collection eliminates reference counting and leaks • JIT architecture for fast execution

  13. I1 (SByte) 8-bit 2's complement signed value U1 (Boolean , Byte) 8-bit unsigned binary value I2 (Int16) 16-bit 2's complement signed value U2 (Uint16, Char) 16-bit unsigned binary value I4 (Int32) 32-bit 2’s complement signed value U4 (UInt32) 32-bit unsigned binary value I8 (Int64) 64-bit 2’s complement signed value U8 (UInt64) 64-bit unsigned binary value R4 (Float) 32-bit IEEE 754 floating point value R8 (Double) 64-bit IEEE 754 floating point value O natural size object reference to managed memory & natural size managed pointer (may point into managed memory) * Natural size unmanaged pointer Array String Unicode string class Supported Data Types Same as on the full .NET Framework

  14. Native Code Interoperability • Issues • Calling conventions • Garbage collection • Security Vs. extensibility • Platform Invoke (P/Invoke) • Managed  Native • IL_CallDelegate • Native  Managed • Inter-App Domain Message Passing

  15. App Domains • Runtime construct that supports a running application • Logical container of application threads • Provides memory isolation • Single execution engine instance can support multiple app domains • Execution engine ensures all resources are released on app termination

  16. App Domain Hosts • Bootstrap the execution engine • Written in C, call C APIs to start, pause and stop CLR applications • Few constraints on execution models • Loader hooks on Windows & Windows CE • Web server in ASP.NET • SQL uses CLR for stored procedures • Graphical shell or browser as shell

  17. Security • Type-safety • On-device verification for software isolation • Code Access Security with simple policy • Evidence determines access permission buckets • Evidence includes location, signing, banned list • Protocol for remote policy configuration • Add/remove apps from banned list • User Identity/authentication • Exposed through the PAL • Network security • SSL for Web Services, secure email, commerce • System quality

  18. Remote Debugging, VS.NET • File copy and run (F5) • Source code breakpoints • Source code single-step • Stack trace • Variable inspection • Thread suspend/resume • Data watchpoints • Multiple device transports

  19. Application Installation • Install • Copy files, perform configuration tasks • Uninstall • Deletes files • Dynamic dependency walk removes orphaned shared components • Perform configuration tasks • Shared class lib versioning • “Never break a functioning app” • Apps are written to specific class lib version or “latest”

  20. GUI Architecture • Two flavors • Generic – provides cross-OS portability • Drawing primitives • Controls and Forms • OEM-customizable look and feel • Windows Forms • Supersets generic functionality • Available for Windows CE devices • Consistent with WinForms on .NET Framework • Drag n’ drop UI designer in Visual Studio

  21. Drawing

  22. Basic Networking

  23. Network Threading • Apps can make synchronous (blocking) or asynchronous calls • Synchronous calls run on the caller’s thread • The system spins threads to support asynchronous calls • Threads terminate after a short no-use timeout

  24. Web Services & Devices • Clean, protocol level separation of publishing and usage • Many producers, many consumers • Separation of data from presentation enables rich client applications • Client applications can aggregate web services from multiple sources • Client applications can control “chunkiness” of transfers • .NET CF can execute VS.NET generated client proxy code

  25. Performance • JIT compilation • Focus on resource constrained devices • Scalable to more capable devices • Tunable • Tradeoff different memory types

  26. Memory Usage

  27. Questions?

More Related