Presentation is loading. Please wait.

Presentation is loading. Please wait.

Making Windows CE.net Work With Custom Platforms James Y. Wilson.

Similar presentations


Presentation on theme: "Making Windows CE.net Work With Custom Platforms James Y. Wilson."— Presentation transcript:

1 Making Windows CE.net Work With Custom Platforms James Y. Wilson

2 Brief Biography Lead software engineer for integration of CE on various custom platforms Lead software engineer for integration of CE on various custom platforms Various publications on Windows CE system development Various publications on Windows CE system development Coauthor of Building Powerful Platforms With Windows CE published by Addison-Wesley in Q Coauthor of Building Powerful Platforms With Windows CE published by Addison-Wesley in Q Microsoft Embedded MVP Microsoft Embedded MVP Developer of Windows 3.x/9x/NT device drivers Developer of Windows 3.x/9x/NT device drivers

3 Agenda Introduction to CE Introduction to CE OS Architecture OS Architecture Steps to adaptation for custom platforms Steps to adaptation for custom platforms Tool-chain Tool-chain Real-time capabilities and limitations Real-time capabilities and limitations Licensing options Licensing options

4 Windows CE (In a Nut Shell) 32 bit, preemptive, multithreaded 32 bit, preemptive, multithreaded Real-Time Real-Time Used for implementation of PocketPC devices (PDAs, Phone Edition, SmartPhone devices) Used for implementation of PocketPC devices (PDAs, Phone Edition, SmartPhone devices) Platform configurations for: Platform configurations for: Industrial controllers Industrial controllers Web pads Web pads Gateways Gateways Internet appliances Internet appliances PDAs PDAs Mobile/IP Phones Mobile/IP Phones Set top boxes Set top boxes

5 Available Apps and Services End user apps End user apps Viewers (Excel, Word, PowerPoint, Image, and PDF) Viewers (Excel, Word, PowerPoint, Image, and PDF) Inbox Inbox Pocket Internet Explorer (PIE) Pocket Internet Explorer (PIE) Internet Explorer (based on IE 6.0) Internet Explorer (based on IE 6.0) Remote Desktop Remote Desktop Terminal Emulation Terminal Emulation VoIP VoIP Windows Messenger Windows Messenger WordPad WordPad MediaPlayer MediaPlayer Installers Installers More! More! Service components Service components C/C++ libraries and runtime (exception handling, RTTI) C/C++ libraries and runtime (exception handling, RTTI) COM/DCOM COM/DCOM Active Template Library Active Template Library.NET CF.NET CF SNMP SNMP LDAP LDAP Microsoft Message Queuing Microsoft Message Queuing MFC MFC OBEX OBEX SOAP, XML (HTTP, XQL, XSLT, SAX) SOAP, XML (HTTP, XQL, XSLT, SAX) SQL Server CE SQL Server CE Shells (console, graphical, skinnable, speech) Shells (console, graphical, skinnable, speech)

6 Windows CE Versions Windows CE 1.0 Windows CE 1.0 Released fall 1996 Released fall 1996 Windows CE 2.0 Windows CE 2.0 Released 1997 Released (service pack for 2.0) 2.01 (service pack for 2.0) Windows CE 2.1 Upgrade from Windows CE 2.0 Windows CE 2.1 Upgrade from Windows CE Introduced in Introduced in 1998 Windows CE 3.0 Windows CE 3.0 Released 2000 Released 2000 Windows CE.net 4.0 Windows CE.net 4.0 Released 2002 Released 2002 Windows CE.net 4.2 Windows CE.net 4.2 Released 2003 Released 2003

7 Target Hardware Minimum hardware requirements Minimum hardware requirements Memory Management Unit for paged virtual memory Memory Management Unit for paged virtual memory Timer Timer Certified 32 bit processor (ARM cores, MIPS, PPC, SH, x86) Certified 32 bit processor (ARM cores, MIPS, PPC, SH, x86) Reference Platforms Reference Platforms Priced from $200 for x86 platform Priced from $200 for x86 platform Provides Board Support Package Provides Board Support Package Many single board computers and reference designs Many single board computers and reference designs

8 OS Architecture OEM Hardware Embedded Shell Applications WIN32 APIs COREDLL, WINSOCK, OLE, COMMCTRL, COMMDLG, WININET, TAPI Windows CE Shell Services Remote Connectivity Kernel IrDA GWES Device Manager FileManager TCP/IP OALBootloaderDrivers Device drivers File drivers Microsoft OEM ISV, OEM

9 Modular OS OS divided into.exe/.dll modules (NK.exe contains kernel) OS divided into.exe/.dll modules (NK.exe contains kernel) Modules further divided using.lib files Modules further divided using.lib files Modules run in Flash (uncompressed) or RAM (compressed in Flash, uncompressed in RAM) Modules run in Flash (uncompressed) or RAM (compressed in Flash, uncompressed in RAM) ROM image sizes: ROM image sizes: 400K minimum: executive and file system 400K minimum: executive and file system 1200K: networking (IPv6, RTP, SMB/CIFS, RAS/PPP, WLAN, BT), no graphics 1200K: networking (IPv6, RTP, SMB/CIFS, RAS/PPP, WLAN, BT), no graphics 4MB: +graphics, basic shell 4MB: +graphics, basic shell 6MB: +hand writing recognition, etc. 6MB: +hand writing recognition, etc.

10 Virtual Address Space Slot 1 Slot 0 Slot 2 Slot 3 Slot 32 Kernel Space E FFFF DLLs Process 2 Process 3 Process 31 Process 32 Act. Process Large Memory Area (memory mapped files) Slot 31 NK Slot C COREDLL.DLL Read only data 03FF FFFF Code Read write data reserved Other ROM DLLs Resources Stack (reserved space) Heap (reserved space) Free virtual space XIP DLL space non-ROM DLLs

11 Steps for Adaptation to a Custom Platform 1. Boot loader development 2. OEM Adaptation Layer (OAL) 3. Device driver development 4. Selection/development of application suite 5. Test and validation 6. Platform SDK generation

12 Bootloader Technically not required for production build Technically not required for production build Performs minimal processor and memory initialization Performs minimal processor and memory initialization Configures debug ports Configures debug ports Downloads OS image into RAM if debug (from TFTP server, serial, or parallel ports) Downloads OS image into RAM if debug (from TFTP server, serial, or parallel ports) Vector to ROM if production or disconnected, otherwise RAM Vector to ROM if production or disconnected, otherwise RAM Optionally provide OS update utility Optionally provide OS update utility Many examples provided in Platform Builder (dialup bootloader with security) Many examples provided in Platform Builder (dialup bootloader with security)

13 OEM Adaptation Layer Contains platform specific code Contains platform specific code Performs platform initialization Performs platform initialization ISR (support for nested interrupts) ISR (support for nested interrupts) Implements power management Implements power management Provides specified services called by Kernel Provides specified services called by Kernel Statically linked at build time to kernel (NK.exe) Statically linked at build time to kernel (NK.exe)

14 OEM Adaptation Layer (2/2) Source examples provided for various reference platforms Source examples provided for various reference platforms Available from 3 rd parties in Board Support Package (BSP) Available from 3 rd parties in Board Support Package (BSP)

15 Device Classes Defined: Devices which share common attributes grouped to form a category or class Defined: Devices which share common attributes grouped to form a category or class Enables congregation of common driver code (class/miniport model) Enables congregation of common driver code (class/miniport model) New device classes defined by Microsoft New device classes defined by Microsoft Because primary calling module, GWES, not provided in source form Because primary calling module, GWES, not provided in source form

16 Device Classes (continued)

17 Device Driver Models Defined: Common mechanism for constructing interfaces between identified driver layers Defined: Common mechanism for constructing interfaces between identified driver layers Not an API, but a mechanism supported by a defined API Not an API, but a mechanism supported by a defined API CE supports certain Windows 9x/NT driver models, other driver models unique to CE CE supports certain Windows 9x/NT driver models, other driver models unique to CE ISVs and IHVs may define new driver models ISVs and IHVs may define new driver models

18 Device Driver Models (continued) Stream-interface Stream-interface NDIS 4.0 NDIS 4.0 Printer Miniport (partial) Printer Miniport (partial) Native Native Windows NT ACM Windows NT ACM USB USB Windows CE supported driver models Windows CE supported driver models

19 Device Driver Architecture Device Manager Stream-interface Driver Card Services USBD HCD Stream-interface Native Driver Stream-interface MDD PDD DDSI USB Driver USB Interface Stream-interface NDIS Card Services Stream-interface NDIS Miniport NDIS Wrapper

20 Device Driver Architecture (Continued) Native Driver DDI MDD PDD DDSI Monolithic Device Driver DDI GWE Subsystem Defined by Microsoft

21 Consists of DLLs and object module libraries Consists of DLLs and object module libraries Drivers run in user mode Drivers run in user mode Allows access to application level resources (MFC, COM, ATL, etc.) Allows access to application level resources (MFC, COM, ATL, etc.) Prevents kernel crashes due to driver exceptions Prevents kernel crashes due to driver exceptions Supports software assisted driver debugging Supports software assisted driver debugging Device Driver Architecture (Continued)

22 Device Manager Primarily dedicated to Stream- interface Drivers Primarily dedicated to Stream- interface Drivers Loading and unloading Loading and unloading Translation of application level calls Translation of application level calls Power management notifications Power management notifications Enumeration of PC Card devices Enumeration of PC Card devices Exists in a separate process space Exists in a separate process space Implications for buffer pointers Implications for buffer pointers Single driver instance shared by all calling applications Single driver instance shared by all calling applications

23 Stream-interface Driver Model Used most commonly Used most commonly Basis of certain driver models (ex.: USB and NDIS) Basis of certain driver models (ex.: USB and NDIS) Supports installable devices Supports installable devices Standard Win32 file I/O interface Standard Win32 file I/O interface Exposed only through the Device Manager Exposed only through the Device Manager Often used in combination with the Native Driver Model Often used in combination with the Native Driver Model

24 Required entry points (XXX = Device File Name) in approximate order of initialization: Required entry points (XXX = Device File Name) in approximate order of initialization: Stream-interface Driver Model (Continued) XXX_Init XXX_IoControl XXX_Open XXX_Read XXX_Write XXX_Seek XXX_PowerUp XXX_Deinit XXX_Close XXX_PowerDown

25 Native Driver Model Supports onboard devices only Supports onboard devices only Provides class/miniport layering Provides class/miniport layering Model Device Driver (MDD) layer Model Device Driver (MDD) layer Provided by Microsoft Provided by Microsoft Communicates with GWES and kernel Communicates with GWES and kernel Handles interrupts Handles interrupts Platform Dependent Driver (PDD) layer Platform Dependent Driver (PDD) layer Contains code to access the hardware Contains code to access the hardware Focus of changes for integration of CE with a custom platform Focus of changes for integration of CE with a custom platform

26 Other Device Driver Models Services.exe, intended for non-device related modules Services.exe, intended for non-device related modules USB Driver Model USB Driver Model NDIS 4.0 miniport NDIS 4.0 miniport Printer miniport Printer miniport Audio Compression Manager Audio Compression Manager Many drivers implemented using a hybrid driver model (ex.: RS-232 serial driver) Many drivers implemented using a hybrid driver model (ex.: RS-232 serial driver) Implementation of custom driver models possible Implementation of custom driver models possible Driver Control Program (DCP) must be defined (ex.: USBD.dll) Driver Control Program (DCP) must be defined (ex.: USBD.dll)

27 Processing Interrupts Different for installable devices (ex.: PC Card and USB) Different for installable devices (ex.: PC Card and USB) For onboard devices, first processed by an ISR in the OAL For onboard devices, first processed by an ISR in the OAL Lower priority interrupts disabled while in ISR, with nesting of higher priority interrupts Lower priority interrupts disabled while in ISR, with nesting of higher priority interrupts Interrupt Service Thread (IST) is signaled Interrupt Service Thread (IST) is signaled IST generally running at high priority, do not block on resources in lower priority threads IST generally running at high priority, do not block on resources in lower priority threads

28 Processing Interrupts

29 Accessing Physical Resources Must request user mode address mapped to physical memory Must request user mode address mapped to physical memory May use functions available in CEDDK.LIB May use functions available in CEDDK.LIB Other driver models provide similar functions Other driver models provide similar functions Example source... Example source...

30 Accessing Physical Resources #define UNCACHED_OFFSET 0x #define UNCACHEDMEMORY(address) (address |\ UNCACHED_OFFSET) #define MY_DEVICE_FRAME_BUFFER 0xB0000 #define MY_DEVICE_FRAME_BUFFER_LENGTH 0x20000 PVOID pMappedMemory = MmMapIoSpace((PHYSICAL_ADDRESS) UNCACHEDOFFSET(MY_DEVICE_FRAME_BUFFER), (ULONG)MY_DEVICE_FRAME_BUFFER_LENGTH, FALSE); ASSERT(pMappedMemory != NULL);... MmUnmapIoSpace(pMappedMemory, (ULONG)MY_DEVICE_FRAME_BUFFER_LENGTH);

31 Platform Builder Platform Configuration Platform Configuration Used to select modules in OS image Used to select modules in OS image Configures link and locate Configures link and locate Wizard provided to begin with reference platform Wizard provided to begin with reference platform Module Development Module Development Supports device driver and application development Supports device driver and application development Built separately from OS image Built separately from OS image

32 Platform Builder (2/3) Debugging Debugging Configurable connections to platform (TCP/IP, ActiveSync, Serial, or custom) Configurable connections to platform (TCP/IP, ActiveSync, Serial, or custom) Single step and conditional break points Single step and conditional break points Support for hardware-assisted debugging (useful for OAL) Support for hardware-assisted debugging (useful for OAL) Process, thread, module, and memory windows Process, thread, module, and memory windows Tracking of kernel state Tracking of kernel state Call profiling Call profiling

33 Platform Builder (3/3) Builds ROMable OS image Builds ROMable OS image Provides emulation to load and test OS image Provides emulation to load and test OS image Supports creation of custom Platform SDK Supports creation of custom Platform SDK Demo: Emulator, Break point, process viewer, Kernel Tracker, call profiling Demo: Emulator, Break point, process viewer, Kernel Tracker, call profiling

34 Platform Builder Demo

35 Other Tools eMbedded Visual C eMbedded Visual C Used for Pocket PC 2002 (CE 3.0 devices) and earlier Used for Pocket PC 2002 (CE 3.0 devices) and earlier eMbedded Visual C eMbedded Visual C Used for Pocket PC 2003 (CE 4.0 devices) and later Used for Pocket PC 2003 (CE 4.0 devices) and later Visual Studio.net Visual Studio.net Used for managed code development (.net Compact Framework) Used for managed code development (.net Compact Framework) Both eVC products to be merged with Visual Studio Both eVC products to be merged with Visual Studio Free download status of eVC in question Free download status of eVC in question Windows CE Test Kit (CETK, see downloads) for scriptable application and system testing Windows CE Test Kit (CETK, see downloads) for scriptable application and system testing

36 Real Time Capabilities 256 priority levels 256 priority levels Scheduler granularity of 1 millisecond Scheduler granularity of 1 millisecond Thread Quantum defined independent of timer tick (set to 0 for run to completion) Thread Quantum defined independent of timer tick (set to 0 for run to completion) Decouples thread quantum (time slice) from timer tick Decouples thread quantum (time slice) from timer tick Nested interrupts Nested interrupts ROM compression optional (avoids page faults) ROM compression optional (avoids page faults) Multiple XIP regions Multiple XIP regions Full kernel mode supported Full kernel mode supported Priority Boosting Priority Boosting

37 Real-Time Capabilities* (2/2) SH4 198MHz Windows CE 3.0 Pentium 100 MHz Windows CE 3.0 Pentium 100 MHz Windows CE 3.0+QFE ISR Min [us] ISR Max ISR Average IST Min IST Max IST Average Jitter Max *Source: us/dnce30/html/realtimecapabilities.asphttp://msdn.microsoft.com/library/default.asp?url=/library/en- us/dnce30/html/realtimecapabilities.asp

38 Licensing Options Platform Builder cost $995/seat Platform Builder cost $995/seat Windows CE Royalty begins at $3 Windows CE Royalty begins at $3 Shared Source Licensing Shared Source Licensing Allows non commercial derivatives Allows non commercial derivatives Allows debugging commercial products Allows debugging commercial products Redistribution program available CE devices Redistribution program available CE devices See Web Sites for additional reference See Web Sites for additional reference

39 Downloads Platform Builder Evaluation Kit tion/trial/evalkit.asp Platform Builder Evaluation Kit tion/trial/evalkit.asp tion/trial/evalkit.asp tion/trial/evalkit.asp eMbedded Visual C eMbedded Visual C ad.aspx eMbedded Visual C eMbedded Visual C ad.aspx ad.aspx ad.aspx All other downloads (including CETK) ads/default.asp All other downloads (including CETK) ads/default.asp ads/default.asp ads/default.asp

40 Documents CE Real Time research docs CE Real Time research docs Real-Time Evaluation by Dedicated Systems: catedsys.asp Real-Time Evaluation by Dedicated Systems: catedsys.asp catedsys.asp catedsys.asp Real-Time and Windows Embedded: ton.asp Real-Time and Windows Embedded: ton.asp ton.asp ton.asp Windows Embedded Real-Time: e.asp Windows Embedded Real-Time: e.asp e.asp e.asp Performance Test Methodologies for Windows CE.NET us/dncenet/html/perfmethod.asp?frame=true Performance Test Methodologies for Windows CE.NET us/dncenet/html/perfmethod.asp?frame=true us/dncenet/html/perfmethod.asp?frame=true us/dncenet/html/perfmethod.asp?frame=true Designing and Optimizing Microsoft Windows CE.NET for Real-Time Performance us/dncenet/html/rtnetdesigning.asp Designing and Optimizing Microsoft Windows CE.NET for Real-Time Performance us/dncenet/html/rtnetdesigning.asp us/dncenet/html/rtnetdesigning.asp us/dncenet/html/rtnetdesigning.asp

41 Web Sites Product Overview Product Overview w/default.asp w/default.asp w/default.asp w/default.asp Shared Source License Information Shared Source License Information source/default.asp source/default.asp source/default.asp source/default.asp Runtime Licensing Model for CE.NET 4.2 Runtime Licensing Model for CE.NET 4.2 p p p p Development Community Web Sites Development Community Web Sites WindowsForDevices.com: WindowsForDevices.com: Pocket PC Developer Network: Pocket PC Developer Network: The Code Project: The Code Project: Evangelist Web Sites Evangelist Web Sites Pocket PC Passion: Pocket PC Passion: CE Windows.NET: CE Windows.NET:

42 Conclusion Modular operating system Modular operating system Various driver models with nested interrupts Various driver models with nested interrupts Custom Kernel Image through PB Custom Kernel Image through PB Flexible Real-Time performance characteristics Flexible Real-Time performance characteristics Low cost licensing Low cost licensing CEs total integration advantage CEs total integration advantage


Download ppt "Making Windows CE.net Work With Custom Platforms James Y. Wilson."

Similar presentations


Ads by Google