1 / 35

Introduzione a Micro Framework

Smart Personal Objects Technology (SPOT). Dario Airoldi Developer & Platform Evangelism Italy darioa@microsoft.com http://blogs.msdn.com/darioa http://blogs.msdn.com/darioait. Introduzione a Micro Framework. Team Developer & platform. Mission

aizza
Download Presentation

Introduzione a Micro Framework

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. Smart Personal Objects Technology (SPOT) Dario Airoldi • Developer & Platform Evangelism Italy darioa@microsoft.com http://blogs.msdn.com/darioa http://blogs.msdn.com/darioait Introduzione a Micro Framework

  2. Team Developer & platform • Mission • Favorire la conoscenza e la diffusione delle tecnologie innovative, creare casi di utilizzo che rendano evidente il valore della piattaforma Microsoft. • Iniziative e attività: • La redazione dei contenuti sul sito MSDN Italy. • Newsletter e Webcast registrati • Seminari e conferenze • Incontri presso le aziende http://www.microsoft.com/italy/msdn/contattaci/default.mspx

  3. La vision di Micro Framework • Piccoli dispositivi elettronici controllati da microprocessori sono sempre più diffusi ma: • Pochi tool ne supportano lo sviluppo • Richiedono forti skill per fare cose semplici • Sono realizzati con codice unmanaged • Microframework si propone per il mondo embedded come VB6 per lo sviluppo delle vecchie applicazioni desktop.

  4. Posizionamento di Micro framework MF è un .Net Runtime piccolo per processori embedded 32bit, economici e a basso consuno • Ha Memory footprint ridotto (~256K RAM) • Non richiede Memory Management Unit • Permette lo sviluppo embedded con Visual Studio 2005 • L’ambiente Include un emulatore completo e funzionale • Permette lo sviluppo con linguaggio C# e .Net framework • Esegue codice managed controllato e sicuro

  5. Le piattaforme embedded di microsoft Windows CE Windows XP Embedded .NET Micro Framework Pocket PC Phone Wearable Devices Auxiliary Displays Windows Mobile Smartphone WindowsAutomotive Windows-based Terminals Retail Point-of-Sale Health Monitoring Portable Media Center VoIP phones Remote Controls Entertainment devices Medical devices Set-top boxes Sensor Networks Gateways Mobile handhelds

  6. Le piattaforme embedded a confronto

  7. Un po’ di storia

  8. Caratteristichedi micro framework Microframework è: • Bootable • Puòeseguire boot autonomamente • Puòessereospitatosusistemioperativiesistenti • Safe • L’accesso alle risorse avviene tramite oggetti • Secure • Utilizza assemblies firmati • Extensible • A livello software ed Hardware • Portable • Il Porting Kit permette di portarlo su HW non supportato

  9. Runtime features • Runtime grafico Windows Presentation Foundation (WPF): • Graphics primitives • BMP and JPG image support • Text manipulation • Unified Programming model covering All devices • Runtime engine: • Thread support • Garbage collection • Globalized language support • Funzionidiinterazione con l’hardware • Managed drivers for LCDs • Universal Asynchronous Receiver/Transmitter (USART) • I2C™ • General-purpose I/O (GPIO) • Pulse-Width modulation (PWM)

  10. Tool di sviluppo • Microsoft Visual Studio 2005 • Project System/templates • PostBuild processing • Intellisense support • Deployment to device (seriale, usb o emulatore) • Debugging interattivodall’IDE (Breakpoints, tracing, variable inspection) • Device Emulator • Personalizzabile per simulare la configurazione delle periferiche

  11. schema architetturale

  12. Piattaformesupportate • Come bootable runtime supporta: • ARM7TDMI @ 27MHz (384K RAM, 1M Flash) • ARM7TDMI @ 50MHz (4M RAM, 2M Flash) • ARM920T @ 96MHz (4M RAM, 2M Flash) • ARM Cortex M3 • Motorola 68K (implementazioni custom) • … • Come hosted runtimesupporta: • Dual ARM7TDMI @100Mhz (32M RAM, 1G Flash) • NetOS/ThreadX per CONNECTME , WinCE • Intel x86 • Windows XP • … • Il Porting a nuovi devices: • Porting to new HW richiede 80-100 APIs • Porting to new Platform richiede 20-40 APIs

  13. Web Site: “www.aboutnetmf.com” Attending Partners

  14. Create a new application and the graphical components Demo: TripComputer Sample

  15. Framework .Net System.web System.Windows.Forms System.Drawing • UI • HTML Controls • Web Controls Component Model • Services • Description • Discovery • protocol Design Printing Cache Security Drawing 2D Configuration Session State Text Imaging System.Data System.Xml ADO.Net SQL Client XML Document Serialization Design SQL Server CE XslT/XPath Reader/Writers System • Runtime • Interop Services • Remoting • Serialization Collections IO Configuration Security Net Service process Text Reflection Diagnostics Globalization Resources Threading

  16. Compact FrameworK System.web System.Windows.Forms System.Drawing • UI • HTML Controls • Web Controls Component Model • Services • Description • Discovery • protocol Design Printing Cache Security Drawing 2D Configuration Session State Text Imaging System.Data System.Xml ADO.Net SQL Client XML Document Serialization Design SQL Server CE XslT/XPath Reader/Writers System • Runtime • Interop Services • Remoting • Serialization Collections IO Configuration Security Net Service process Text Reflection Diagnostics Globalization Resources Threading

  17. Micro Framework System.web System.Windows.Forms System.Drawing • UI • HTML Controls • Web Controls Component Model • Services • Description • Discovery • protocol Design Printing Cache Security Drawing 2D Configuration Session State Text Imaging System.Data System.Xml ADO.Net SQL Client XML Document Serialization Design SQL Server CE XslT/XPath Reader/Writers System • Runtime • Interop Services • Remoting • Serialization Collections IO Configuration Security Net Service process Text Reflection Diagnostics Globalization Resources Threading

  18. Micro framework è una implementazione .Net! • Implementa un sottoinsieme delle core libraries • Permette diversi linguaggi di programmazione • Rispetta Common Language Specification (CLS) • Derivato da Common Language Infrastructure (CLI) v1.0 • Supporta Common Intermediate Language (CIL) Execution.

  19. note sullaimplementazione del Runtime • Serialization: • Implementazionespecifica per mf • 60%piùefficiente in spaziorispetto a .Net Framework • Remote Procedure Call (RPC) • Implementazionespecifica per mf • Permettediinvocaremetodisuoggettiremoti • Encryption: • SupportaRSA algorithm (Asymmetrico) tramite la classeKey_RSA. • supportaExtednedTiny Encryption Algorithm (XTEA, symmetric) tramite la classeKey_TinyEncryptionAlgorithm. • Permette algoritmi custom derivando dalla classe Key. • Delegates: permetteprogrammazione ad eventiinveceche per polling. • Exception handling • Reflection

  20. Runtime features – Dettaglio

  21. Add the clock and other trip control features to the TripComputer Demo the TripComputer sample

  22. Runtime grafico • Object model Basatosu Windows Presentation foundation (WPF) • Supporta routed events e context properties • Supporta layout system (content sizing, text flow, nested controls) • Supporta bitmap fonts • Gestisce Images • Gestisce Pens, brushes, colors • Gestisce Vector primitives • Gestisce Alpha blending

  23. Hardware Abstraction Layer • Permette il boot del runtime • Permette una astrazione delle risorse • Gestisce gli interrupts • Supportaasynchronous cooperative multi-tasking. • È realizzatotramite queued Workitems • È compatto (Occupa 40K inclusi i base drivers)

  24. Loader ed interpreter • Assembly loader • esegue validazione al caricamento degli assemblies. • registra i tipi con il type system (in tabella globale dei tipi) • Microsoft Intermediate Language (MSIL) interpreter • Supporta TUTTE le msil instructions (tranne le istruzioni unsafe) • È ottimizzato per minimizzare la latenza • Permette esecuzione “virtuale pura”

  25. Execution engine and garbage collector • Execution engine: • No native thread scheduler • Manages native work queues • Invokes native code • Permette non traditional interoperability • Garbage collector • Non incremental Mark and Sweep. • Colleziona 50ms per 1M, variabile a seconda del numero di oggetti • Supporto per storage non volatile. • dispone di un meccanismo di persistenza di oggetti

  26. Micro framework Footprint • ROM/Flash footprint • Runtime: ~120K • Runtime + framework minimale: ~250K • Runtime + framework completo: ~500K • RAM requirements • ~70K system overhead • ~256K per full-featured application

  27. Device Esterni • Permette di gestire da codice managed (Managed drivers): • General-purpose I/O (GPIO) pins • Serial peripheral interface (SPI) bus • Serial ports • Universal Asynchronous Receiver/Transmitter (USART) • I2C™ • Pulse-Width modulation (PWM) • GPIO Interrupts sono dispatched alla applicazione managed in forma di eventi.

  28. Quali Device si possono gestire?

  29. Codice di un Managed Driver using System.Threading; usingMicrosoft.SPOT.Hardware; … InterruptPortmyButton = newInterruptPort( (Cpu.Pin)12, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow ); MyButton.OnInterrupt+= newGPIOInterruptEventHandler( this.MyInterruptHandler ); … } public voidMyInterruptHandler(Cpu.Pin id, bool edge, TimeSpan time) { // handle the interrupt event here }

  30. Emulatore • L’emulatore è una windows application che esegue codice micro framework • Una collezione di classi che permette di comporre epersonalizzare l’emulatore • Un file di configurazione (XML) che permette di configurare ed inizializzare tutti i componenti

  31. Architettura dell’Emulatore • Windows application che esegue codice Micro Framework • Una collezione di classi permette di comporre e personalizzare i componenti da emulare • Un file di configurazione (XML) permette di configurare ed inizializzare tutti i componenti

  32. Customize the emulator to simulate buttons and IO on the TripComputer Demo the TripComputer sample

  33. Maggiori informazioni • Sito microframework: http://msdn.microsoft.com/embedded/netmf. • Sito embedded development: http://msdn2.microsoft.com/embedded. • Sito per download http://www.microsoft.com/downloads. • Webcasts • http://Www.microsoft.com/Webcasts • http://www.microsoft.com/italy/eventi/webcast/

More Related