Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unit OS9: Real-Time and Embedded Systems

Similar presentations


Presentation on theme: "Unit OS9: Real-Time and Embedded Systems"— Presentation transcript:

1 Unit OS9: Real-Time and Embedded Systems
9.3. Embedded Systems with Windows XP Embedded Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze

2 Copyright Notice © 2000-2005 David A. Solomon and Mark Russinovich
These materials are part of the Windows Operating System Internals Curriculum Development Kit, developed by David A. Solomon and Mark E. Russinovich with Andreas Polze Microsoft has licensed these materials from David Solomon Expert Seminars, Inc. for distribution to academic organizations solely for use in academic environments (and not for commercial use) NOTE: slides in this module are based on the Windows XP Embedded Training course materials from the Microsoft Curriculum Repository; see:

3 Roadmap for Section 9.3 Windows XP Embedded Design Goals
Development Tool Support OS Configuration Process Overview XP Embedded vs. Windows CE XP Embedded Enabling Features Windows XP Embedded is the embedded operating system that delivers the power of Windows in componentized form to allow developers to rapidly build reliable and advanced embedded devices. Based on the same binaries as Windows XP Professional, Windows XP Embedded contains over 10,000 individual feature components so developers can choose and achieve optimum functionality while managing or reducing footprint in a customized device image. Popular device categories for building operating systems using Windows XP Embedded include retail point-of-sale terminals, thin clients and advanced set-top boxes. Windows XP Embedded delivers reliability, security, and performance features and enhancements. The operating system software also provides the latest multimedia and Web browsing capabilities and contains extensive device support. In addition, Windows XP Embedded incorporates embedded-enabling capabilities, such as support for multiple boot, storage, deployment and management technologies.

4 Windows XP Embedded Design Goals
Binary Compatibility with Windows XP Rich Operating System Functionality Small Operating System Size Modular and Compact Embedded Enabling Features Development Tool Support Windows XP Embedded is based on unmodified XP Professional binaries – this provides application and driver compatibility for Windows XP Embedded (i.e. no porting of code, little or no testing) Windows XP Embedded ships with over 10,000 components, (using Target Designer) you get to choose which components are needed for your device XP Embedded also ships with a number of Embedded enabling features, including ‘Headless’ support, boot from Read/Only media (such as Flash or CD-Rom), and remote management. The windows XP Embedded build process can be broken into 4 distinct sections. Analyze hardware (using Target Analyzer or Target Analyzer Probe) Create a component from the output of TA Select components from the Target Designer catalog, and add the ‘TA’ generated component Build and deploy the o/s image – the whole process takes around 30 minutes to complete.

5 Binary Compatibility with Windows XP
Windows API Support By including the proper components in a build, any application that can run on Windows XP can also run on Windows XP Embedded Windows Driver Model (WDM) Allows the use of existing Windows XP drivers on a Windows XP Embedded build Componentized XP Functionality Includes a database containing components Components contain all the necessary information required for the development tools to include their specific functionality into the operating system Windows XP Embedded is built from the same files as Windows XP. Because of this, Windows XP Embedded inherits most of its features from Windows XP. Below are the key benefits of building XP Embedded in this way: Windows API Support Windows XP Embedded uses the same API as Windows XP, which is the Windows API. Therefore, by including the proper components in a build, any application that can run on Windows XP can also run on Windows XP Embedded. Windows Driver Model (WDM) Windows XP Embedded uses the same driver model as Windows XP. This allows you to easily use existing Windows XP drivers on a Windows XP Embedded build. Componentized XP Functionality Windows XP Embedded Studio includes a database containing components which can be included in the Windows XP Embedded operating system. Components contain all the necessary information required for the development tools to include their specific functionality into the operating system.

6 Rich Operating System Functionality
Features of Windows XP - built on Windows NT/2000/XP code base Protected Memory Model Scalable Memory / SMP Support Security Multimedia support Management Communications / Networking support Windows XP Embedded is built from the same binaries as Windows XP and therefore, it inherits many of its core features. Windows XP is built on the proven code base of Windows NT® and Windows 2000, which features a 32-bit computing architecture and a fully protected memory model. Windows XP is designed to allow multiple applications to run simultaneously, while ensuring great system response and stability. Windows XP Professional currently supports up to 4 gigabytes (GB) of RAM and up to two symmetric multiprocessors. The following list describes the various security features in Windows XP: Encrypting File System (EFS) EFS with multi-user support encrypts each file with a randomly generated key. The encryption and decryption processes are transparent to the user. In Windows XP Professional, EFS can provide multiple users access to an encrypted document. IP Security (IPSec) IPSec helps protect data transmitted across a network. IPSec is an important part of providing security for virtual private networks (VPNs), which allow organizations to transmit data securely over the Internet. Kerberos Kerberos provides industry-standard and high-strength authentication with fast, single logon to Windows 2000—based enterprise resources. Kerberos is an Internet standard, which makes it especially effective for networks that include different operating systems such as UNIX.

7 Small Operating System Size
Kernel Baseline Configuration Kernel, No Network, No Explorer Shell ~5 MBytes of Disk Space Minlogin Networking Support, Shell ~15 MBytes of Disk Space (12MBytes NTFS compressed) Winlogon ~56 MBytes of Disk Space (37MBytes NTFS compressed)

8 Modular and Compact Componentized Windows XP What is a component?
Components created during development What is a component? The smallest individually selectable piece of functionality that can be included or excluded from a run-time image. 10,000+ Components in Component Database Example of Components: MatroxMillennium G400 (Display Adapter) Basic TCP/IP Networking (Networking and Communication) Explorer Shell (User Interface) Component Groups Display Adapters Network Protocols Network Adapters Tools and Utilities

9 Development Tool Support - Windows Embedded Studio
Target Designer Builds custom operating system Component Designer Customize and expand the capabilities of the operating system Component Database Manager Provides management functions for the component database and the repositories Development Utilities Target Analyzer Used to discover target hardware BootPrep Used to prepare target media

10 Windows Embedded Studio Installation Options
Supported Installation Scenarios Standalone User Install Tools Only Install Shared Component Database Install The complete product is contained in two separate installation packages Tools Installation Package Component Database Installation Package The tools and component database can be configured to run in stand alone (single user) or shared database, installing the component database onto a shared development PC – this is great for working in a team environment – all engineers can ‘check in’ components and directly use the newly installed components.

11 Windows Embedded Studio Detecting Target Hardware
TAP.exe Most functional Target Analyzer probe Runs only on Windows 2000 or XP Generates a small hardware definition file TA.exe Basic Target Analyzer probe Runs on MS DOS (via boot floppy disk) Step one for building a device based on Windows XP Embedded is to examine the underlying hardware – there are two ways in which this can be done. From MS-DOS, running a 16-bit application called ‘TA’ – Target Analyzer – this will take a basic snapshot of your underlying hardware, note that TA is not able to enumerate all Busses on your device, for example, USB cannot be enumerated using TA. From Windows 2000 or Windows XP Pro run TAP (Target Analyzer Probe), this will enumerate ALL hardware on the device In both cases TA/TAP will generate an output file ‘Devices.pmq’ which is an XML file that can be imported to the Component Designer and then imported to Target Designer – this ‘macro component’ describes all of the underlying hardware for your device.

12 Windows Embedded Studio Component Designer
Primary tool used to author custom components Generates a ‘Component Definition’ file (.SLD) Captures file, registry, and dependency information for a discrete set of functionality Importing of .INF files is supported for easy creation of driver components Component designer is used to create custom components for applications, drivers, services etc… Component designer can directly import .PMQ files (from TA/TAP), or .INF files – INF files are used to describe device drivers, therefore creating a component based on a Windows 2000 or Windows XP Pro driver is a snap. A component definition file (.SLD) contains the list of files needed for the component, the registry information, and any dependency on other portions of the o/s.

13 Windows Embedded Studio Component Database Manager
Provides functionality to allow management of the component collection Allows importing of .SLD files into the database (for Target Designer use) Management of Repository locations Management of Component Packages View complete database contents Change the Component Database Server name The component database manager is used to add additional components to the component catalog, whether this be a shared or stand-alone tools install. In the shared database scenario ‘checking in’ a component will make the component available to ALL developers using the same SQL Server. Management of components is also handled by the CDM, including importing (as above), and deleting.

14 Windows Embedded Studio Target Designer
Target Designer is the tool used to build runtime images Generates a ‘Configuration’ file (.SLX) Import a hardware definition file Matches components in the database with PnP IDs found by TAP/TA and adds them to the configuration Disable non-critical devices in the configuration Can significantly reduce footprint by removing devices (and their associated dependencies) from the runtime image Target designer is the tool used to configure, build, and deploy the Windows XP Embedded image. Target Designer ships with a number of ‘macro components’, these can be considered to be starting points for a project and contain the core components needed for a number of categories of device, including Set Top Box, Windows Based Terminal, and others, of course, you can create your own completely custom device by selecting the components needed from the catalog. Target Designer will run a full dependency analysis on your workspace to ensure that all components are included that are needed to deploy and run the Windows XP Embedded image – the output of Target Designer is a ‘flat file system’, including \Windows, \Windows\System32, \Program Files etc…. All components can be selected/de-selected from the configuration so that you create a completely customized o/s image that matches the configuration needed for your device.

15 Design Templates Project Starting Points Advanced Set Top Box
Basic Set Top Box Digital Set Top Box Home Gateway Information Appliance Kiosk/Gaming Console Network Attached Storage Retail Point of Sale Terminal Windows Based Terminal Professional Starting point templates for your project – you can either use these, or create your own custom platform.

16 Add Features to Base OS Config
Target Analyzer Process Overview Target Designer Base OS configuration Auto-generated You begin by probing your target hardware with the Target Analyzer tool to determine the all the necessary information for the OS image to boot and run properly. This XML output from Target Analyzer gets dropped into Target Designer where you drag and drop all the components and features you need to build your base OS configuration. This is the step where you can choose to use one of the many Design Templates built into the product for selected device categories. You then use Component Designer to convert your own custom applications and features into components and add them into your base configuration. After this, you check dependencies to verify that all component relationships are complete. If there are incomplete relationships, a task list is automatically generated that outlines step-by-step exactly what the embedded developer needs to add in order to establish proper relationships. You’re in the home stretch now in terms of the build process – final checks verify that all components are present and in the proper order – once this step is complete, you download your Windows Xp Embedded based image onto your target device. Add Features to Base OS Config >10,000 individual components Macro Components Design Templates Add your components: Component Designer .SLD’s contain information for component to “build itself”: Properties, Resources, etc. Auto-conversion of .INF’s Check Dependencies Verify relationships, add/delete components Build order established Task Lists Build Process Ensures components built in right order Allows special case logic and fully scripted build process Runtime OS Image

17 XP Embedded vs. Windows CE 3.0
Feature Windows XP Embedded Windows CE 3.0 Disk Space 5MB -56MB 500 k –16MB API Support Full Windows API Best of Windows API plus CE Specific enhancements CPU Support x86 x86, MIPS, SHx, ARM, PPC Device Drivers 100% compatibility with XP Professional Fine-tuned for size derivative of NT Driver Real-Time Required 3rdParty Add-Ons Yes Development Tools Target Designer and Component Designer / Visual Studio Platform Builder / eMVT

18 XP Embedded - Target System Requirements
Intel Pentium II or higher CPU required ACPI PnP BIOS recommended Storage Flash / DiskOnChip/ CD-ROM 5 MB Minimum (depends upon functionality) Memory Requirements 64 MB Minimum (depends upon functionality)

19 Application Development
Utilize existing off-the-shelf applications Full Windows API support Little or no porting required Rapid application development Use familiar tools to write applications

20 Embedded Enabling Features
Alternative Non-Volatile Boot Media CD-ROM, DiskOnChip, Flash Enhanced Write Filter Technology Allows the Windows XP Embedded operating system to boot from any read-only media Remote Management Facility that can be used to acknowledge system error dialogs without requiring user interaction Headless Operation Install, configure, maintain and run diagnostics on the system in a manner that does not require user intervention Custom Shell Allows the default shell to be replaced with another application

21 Headless Operation A system without Display, Keyboard, Mouse
Null Driver required Must be supported by BIOS Replace user input from the console with another input method Operating system and Applications may still create message boxes Solution: System Message Interception Management Solution: Remote Administration Required Components: Headless VGA Driver -or- Terminal Services Core VGA Boot Driver Component

22 System Message Interception
Acknowledges message box Selection of default reply Re-direct to Event Log Custom Application To implement System Message Interception, you can use two methods. The first method is to take advantage of the ability of the operating system to automatically intercept message boxes which is a native NTUSER feature. To instruct NTUSER to intercept messages, additional key and values are required in the HKLM\System\CurrentControlSet\Control registry key. You might need to create the registry key and values on your system. The following instructions assume the required registry entries do not already exist on your target system. To set up your system to automatically reply to a message box without displaying it: In the HKLM\System\CurrentControlSet\Control registry key, create a new key named Error Message Instrument. Under the Error Message Instrument key, add values of type REG_DWORD EnableDefaultReply (0x ), and/or EnableLogging (0x ). Under the Error Message Instrument registry key, add a LogSeverity value of type REG_DWORD: EMI_SEVERITY_ALL (0x ), EMI_SEVERITY_USER (0x ), EMI_SEVERITY_INFORMATION (0x ), … In the HKLM\System\CurrentControlSet\Services\EventLog\Application registry key, create a new key named Error Instrument. Under the Error Instrument key, add registry values TypesSupported (REG_DWORD 0x ) and EventMessageFile (REG_EXPAND_SZ %SystemRoot%\System32\User32.dll ) Reboot your target system.

23 System Message Interception (Continued)
Intercept message boxes only Provided by User32.dll Requires proper registry settings Write a custom service to monitor all windows Build a Windows Service to scan desktop System Message Interception – Custom Service The second method to deal with system messages is to write a custom service. You can create a Windows service that periodically scans the desktop for displayed windows. This method provides greater flexibility than the Enable Default Reply method because you can search for any window attribute, such as whether the window is visible, if it is a modal dialog window and so on. The Enable Default Reply method can only respond to message boxes. By using Windows API functions, you can systematically step through windows to obtain information.

24 Enhanced Write Filter Allows booting from read-only media
Protects operating system partition Not necessary to redesign applications Enhanced Write Filter Overlays EWF redirects information from the disk to overlays If the information redirected to the overlay is later requested, it is obtained from the overlay instead of from the actual protected media Enhanced Write Filter Components

25 Overlay Options EWF can be configured by applying to multiple volumes, each of which may have multiple overlays Disk Overlay Using EWF Volume EWF Master Volume Table, Overlay stack and Overlay data are stored in the EWF volume After reboot information retained RAM Overlay Enables stateless operation –After reboot all changes lost Run without any read/write storage

26 Enhanced Write Filter Settings
EWF Volume Settings Specify the number of protected volumes, the maximum number of overlay levels, the EWF partition size, and whether overlay configurations are stored in the system registry or in the EWF partition Protected Volume Settings Enable Lazy Write Optimal Performance Use less overlay space Use less overlay space & less writes

27 Bootable CD-ROM & Flash Media
Bootable CD-ROM appears as a hard-drive Requires: A BIOS which supports the El Torito Spec. El Torito Component Enhanced Write Filter Component DiskOnChip Requires: “M-Systems DiskOnChip2000” Component CompactFlashTM, PCMCIA Flash cards, flash drives Appear as an ATA drive Requires no special components Enhanced Write Filter / FAT File System recommended

28 Remote Management Telnet Server FTP Server
Provides a gateway for Telnet clients When Telnet Server is running on a computer, users can use Telnet clients to connect to it from a remote computer FTP Server Used to copy files to and from remote computer systems on a network using TCP/IP, such as the Internet Remote Desktop –Terminal Services Provides remote access for the desktop of a computer that is running Terminal Services Windows Management Instrumentation (WMI) Provides management information and control in an enterprise environment Simple Network Management Protocol (SNMP) Configures remote devices, monitor network performance, audit network usage, and detect network faults or inappropriate access

29 Shell Customization Windows XP Embedded allows you to have the system use a custom shell Explorer Shell Command Shell Task Manager Shell Building Custom Shell Components

30 Further Reading James Beau Cseri, Windows XP Embedded Step by Step: Hands-On Exercises for Real World Engineering, Annabooks/RTC Books, 2003. Sean D. Liming, Windows XP Embedded Advanced, Annabooks/RTC Books, 2003. Mark E. Russinovich and David A. Solomon, Microsoft Windows Internals, 4th Edition, Microsoft Press, 2004. Chapter 2 - System Architecture (from pp. 35)

31 Source Code References
Windows Research Kernel sources do not include Embedded XP-specific components However, since Embedded XP uses the same kernel image (Ntoskrnl.exe) as XP, the kernel sources in \base\ntos are applicable For more specific source code references, see the last slide in the relevant CRK units


Download ppt "Unit OS9: Real-Time and Embedded Systems"

Similar presentations


Ads by Google