EMB426 Windows CE Memory Architecture Steve Maillet CEO/Chief Software Architect EmbeddedFusion.

Slides:



Advertisements
Similar presentations
MHK200 Module 1: Introduction to Windows CE. MHK200 Overivew Windows CE Design Goals Windows CE Architecture Supported Technologies, Libraries, and Tools.
Advertisements

Memory Management: Overlays and Virtual Memory
EMB306 Building Windows CE Devices With DX Support John L. Marcantonio Program Manager Windows CE Multimedia Microsoft Corporation.
EMB304 Building Trustworthy Windows CE Embedded Devices and Applications Ganapathy Raman Program Manager Windows CE Security Team Microsoft Corporation.
Lesson 15 – INSTALL AND SET UP NETWARE 5.1. Understanding NetWare 5.1 Preparing for installation Installing NetWare 5.1 Configuring NetWare 5.1 client.
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
OS Spring’03 Introduction Operating Systems Spring 2003.
Chapter 6 - Implementing Processes, Threads and Resources Kris Hansen Shelby Davis Jeffery Brass 3/7/05 & 3/9/05 Kris Hansen Shelby Davis Jeffery Brass.
Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access memory.
EMB321 How To Write A Windows CE SDIO Client
EMB313 Increasing Developer Productivity With Windows CE 5.0 Matt Young Windows Mobile Joint Development Program (JDP) Microsoft.
Future Directions For The Windows CE Operating System Architecture John Hatch Program Manager.
EMB425 Using Advanced Platform Builder Debugger Features James Stulz Program Manager Windows CE Core Tools Microsoft Corporation.
EMB313 Increasing Developer Productivity With Windows CE 5.0
Tanenbaum 8.3 See references
Programming mobile devices Part II Programming Symbian devices with Symbian C++
Chapter 3.1:Operating Systems Concepts 1. A Computer Model An operating system has to deal with the fact that a computer is made up of a CPU, random access.
Windows 2000 Memory Management Computing Department, Lancaster University, UK.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
hardware and operating systems basics.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 11 Case Study 2: Windows Vista Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
EMB318 Improve Product Quality Using Windows CE Error Reporting (Watson) James Stulz Program Manager Windows CE Core Tools Microsoft Corporation.
EMB315 Non-Volatile Object Store And Hive Based Registry Design For Windows CE Rick Austin Principle Engineer Intermec Corporation.
Windows CE 5.0 Memory Architecture Li-Ming Fan Escalation Engineer Microsoft GCR-GTSC.
Protection and the Kernel: Mode, Space, and Context.
CLI324 Tablet PC Platform Advanced Topics Software Design Engineer/Test Lead
BIZ208 Windows CE 5.0 Bringing to Market a Broad Range of Devices Dan Javnozon Product Manager MEDG Microsoft Corporation Business Track Presentation.
EMB423 Creating A Trusted Environment For Windows CE 5.0 Nat Frampton President Real Time Development
EMB320 Windows CE 5.0 Image Configuration, Boot Loaders, And Security
Architecture Support for OS CSCI 444/544 Operating Systems Fall 2008.
Laface Operating System Design Booting a PC to run a kernel from Low memory VGA display.
Windows 2000 Course Summary Computing Department, Lancaster University, UK.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Windows Memory Architecture 井民全製作. A Process ’ s Virtual Address Space Every Process has its own private virtual address 32-bits processes  4 GB address.
ME-I-US Windows CE The next version Base on Presentations at Medc 2006 by Boar-Ming Hsieh and John Hatch Avi Kcholi Mobile&Embedded Israeli User Society.
Chapter 4 Memory Management Virtual Memory.
EMB424 Implementing Fault Tolerant Systems in Windows CE 5.0 Nat Frampton President Real Time Development
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
Rob Tiffany Mobility Architect Microsoft Corporation MOB401.
© 2004, D. J. Foreman 1 Implementing Processes and Threads.
© 2004, D. J. Foreman 1 Computer Organization. © 2004, D. J. Foreman 2 Basic Architecture Review  Von Neumann ■ Distinct single-ALU & single-Control.
EMB427 Writing Real-Time Applications On Windows CE 5.0 Nat Frampton President Real Time Development Corporation
Kernel Architecture Process Management Memory Management.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
Best Practices Steve Maillet Chief Software Architect EmbeddedFusion ECE401 Best Practices For Driver Development.
Processes and Virtual Memory
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Memory Management: Overlays and Virtual Memory. Agenda Overview of Virtual Memory –Review material based on Computer Architecture and OS concepts Credits.
CLI210 Introduction To Managed Development For Devices With Visual Studio 2005 Scott D. Smith Program Manager Visual Studio for Devices Microsoft Corporation.
Advanced Memory Management Douglas Boling President Boling Consulting Inc.
Windows CE Services Douglas Boling President Boling Consulting Inc.
Lecture 5 Rootkits Hoglund/Butler (Chapters 1-3).
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
Running Commodity Operating Systems on Scalable Multiprocessors Edouard Bugnion, Scott Devine and Mendel Rosenblum Presentation by Mark Smith.
Chap. 4 ARM Boot Loader Internals. 2 S3C2500 ARM940T Core module ARM9TDMI CoreIC.
Introduction to Operating Systems Concepts
Chapter 3: Windows7 Part 5.
Virtualization.
Memory Management.
Hardware and OS Design and Layout.
Implementing Processes and Threads
OS Virtualization.
Chapter 3: Windows7 Part 2.
Chapter 3: Windows7 Part 5.
Windows Internals Brown-Bag Seminar Chapter 1 – Concepts and Tools
Module IV Memory Organization.
Chapter 3: Windows7 Part 2.
Lecture Topics: 11/1 General Operating System Concepts Processes
CSE 153 Design of Operating Systems Winter 2019
COMP755 Advanced Operating Systems
Presentation transcript:

EMB426 Windows CE Memory Architecture Steve Maillet CEO/Chief Software Architect EmbeddedFusion

Part I Architecture and concepts Virtual Memory Kernel Mode versus User Mode Statically mapped memory Process memory System API Calls Access Permissions

Virtual Memory Model Single 32-bit (4 Gigabyte) flat virtual memory address space Permits efficient use of physical memory with protection Virtual addresses translated to physical addresses by MMU A valid virtual address maps to a physical address Static or Dynamically mapped virtual addressing

Virtual Memory 2 GB User Space Slot 97: NK.EXE Reserved Statically Mapped Virtual Addresses: Un-Cached Statically Mapped Virtual Addresses: Cached Slot 0 – Current Process Slot 1 – XIP DLL code Slots Processes Slots Object Store and Memory-Mapped Files FFFF FFFF E C C C A FFF FFFF Total 4 GB Virtual Space 2 GB Kernel Space User Space Reserved Kernel Addresses: KPAGE, Trap Area, Others

Kernel Mode Versus User Mode ONLY Difference is access to different regions Kernel mode code has full access to all memory Process protection still applies! User Mode code only has access to User Space Kernel Space (0x – 0xFFFFFFFF) Used only by Kernel-mode code with privileged access (“Kmode”) SetKMode() protected API or ROMFLAGS Setting for ALL threads in the system User Space (0x – 0x7FFFFFFF) Organized as 64 slots of 32 MB (225 bytes) each Applications, DLLs and Data located here

Statically Mapped Memory 2 GB User 512 MB Uncached 512 MB Cached 32 MB Flash Physical Memory Virtual Memory A C MB RAM MB RAM 32 MB Flash 64 MB RAM FFFF FFFF Address Translation 32 MB Flash Kernel Space User Space

Statically Mapped Memory x86, ARM OEM provides OEMAddressTable in OAL to define initial mappings MIPS, SHx Mapping is fixed in the MMU architecture

Process Memory 01FF FFFF MB Process Space Free Virtual Space Slot 30 Slot 31 Slot Slot Current Process XIP ROM DLLs nk.exe filesys.exe shell.exe device.exe gwes.exe Resource DLLs Slot 2 Slot 3 Slot 4 Slot 5 Slot 1 Slot 0... Slot 97 C C A E C C E

System API Calls Application Win32 API Thunks Local Process Services PSL Process Switching filesys.exegwes.exedevice.exe Virtual Memory Process/Thread Exception Handling Scheduling Loader Synchronization Initialization Process Switching Memory-Mapped File Hardware Abstraction Memory Map Interrupts Bus Map Function Call Traps Process Interface DLL Interface Interrupt Handling OAL Heap Coredll.dll N.EXE Nk.lib services.exeshell.exe

System API Calls Coredll.dll Located at the top of every process slot Fields system API calls from user mode threads Implements some system API calls directly Causes an exception (trap) to pass on system API request Kernel Catches system API request exception traps Dispatches to a system EXE to fulfill request User mode thread migrated to system EXE process space Access rights of user mode thread inherits current process rights

System API Calling Mechanism User mode thread Win32 API Thunks Function Call Coredll.dll App.exe Kernel Trap Win32 API Dispatch Nk.exe Jump Function Code system EXE Return Call

Access Permissions Process Access Permissions Access permissions set on per-thread basis GetProcPermissions() / SetProcPermissions() Threads accessing other process slots require permission Violations cause exceptions reported to the Kernel Structured exception handling allows process to trap its faults

Access Permissions Resource DLLs and Memory-Mapped files Accessible by threads in all processes Shared Heaps Writable by threads in creating process Read Only by threads in other processes Object Store (Optional) Accessible only by kernel file system (filesys.exe)

Access Permissions System call process contexts GetCurrentProcess() Process context in which the current thread is running GetOwnerProcess() Original process that created the current thread GetCallerProcess Process that thread most recently migrated from MapCallerPtr() Adjusts a pointer to a specific process slot while validating caller has access to the data Typically maps a Slot 0 relative address to the owing processes slot so a driver can use it

Access Permissions Security Violation

Part II Build Configuration BIB Files BIB Memory Types ROMOFFSET Example System

BIB Files MEMORY section Defines the platform memory information Partitions the physical memory into Data memory and Program memory ;NameStart address Size (bytes)Type ; NK E00000 RAMIMAGE ; (30M) "ROM" RAM E00000 RAM ; (30M) ;NameStart address Size (bytes)Type ; NK E00000 RAMIMAGE ; (30M) "ROM" RAM E00000 RAM ; (30M)

BIB Memory Section Types TypeDescription RAMIMAGE OS Image (Read + Execute ONLY) MUST start on a 64K boundary! RAM RAM for OS to partition RESERVED Reserved region OS won’t use NANDIMAGE Used with BINFS to mark memory region for paging Files From NAND storage devices FIXUPVAR Used to set the value of a variable during image build time

BIB Files Indicate the modules and components that should be included in the image Text files with four types of sections The FILES section: Memory reservation for static data files ;NamePathMemory Type Tahoma.ttf $(_FLATRELEASEDIR)\Tahoma.ttf NK SHU ;NamePathMemory Type Tahoma.ttf $(_FLATRELEASEDIR)\Tahoma.ttf NK SHU Taskman.exe$(_FLATRELEASEDIR)\Taskman.exe NK  The MODULES section: Specifies object module to be loaded in memory

BIN File Format Header Block B0000F Start Address Image Length StartLengthChecksumData… 0 Starting IP 0 BIN Record(s) Terminating Record

ROMOFFSET ROMOFFSET is used to adjust the address of records in the Microsoft BIN file format Boot loader uses physical memory Boot loader copies image from flash to RAM Boot loader copies image from disk

ROMOFFSET ROMIMAGE pseudo code WriteBinRecord(UINT32 StartAddress, UINT32 RomOffset, UINT32 Length, UINT8* pData) { Write(StartAddress + RomOffset); Write(Length); UINT32 ChkSum = WriteBinData(pData, Length); Write(ChkSum); }

Example System ARM core CPU OEMAddressTable required 32M Ram at physical address 0x M Flash at physical address 0x M Block of “On-Chip” devices at physical address 0x

Static Mapped Memory Cached RAMIMAGE RAM... 0x x SDRAM 0x9FFFFFFF 0x9FF00000 On-Chip Devices

Static Mapped Memory Uncached RAMIMAGE RAM... 0xA xA SDRAM 0xBFFFFFFF 0xBFF00000 On-Chip Devices

OEMAddressTable Cached Address Physical Address Size (MB) Description 0x x RAM 0x9CD000000x FLASH 0x9FF000000x On Chip Devices 000 NULL Terminator

Summary Virtual memory central to Windows CE Configuration controlled by OEMs CONFIG.BIB Device developers need to understand and keep total system in mind when configuring their device images

While At MEDC 2005… Fill out an evaluation for this session Randomly selected instant WIN prizes! Randomly selected instant WIN prizes! Use real technology in a lab Instructor led Reef E/F & Breakers L Self-paced Reef B/C Self-paced Reef B/C Visit the Microsoft Product Pavilion in the Exhibit Hall Shorelines B in the Exhibit Hall Shorelines B

After The Conference… Develop Build InstallBuildJoin Install Enter Enter Join Full-featured trial versions of Windows CE and/or Windows XP Embedded Cool stuff & tell us about it: msdn.microsoft.com/embedded/community msdn.microsoft.com/embedded/community Windows Embedded Partner Program: Windows Mobile 5.0 Eval Kit including Visual Studio 2005 Beta 2 Mobile2Market Contest and win up to $25000: mobile2marketcontest.com mobile2marketcontest.com Microsoft Solutions Partner Program: partner.microsoft.com partner.microsoft.com

Tools & Resources msdn.microsoft.com/ embedded microsoft.public. windowsxp.embedded windowsce.platbuilder windowsce.platbuilder windowsce.embedded.vc windowsce.embedded.vc blogs.msdn.com/ mikehall Windows CE 5.0 Eval Kit Windows XP Embedded Eval Kit msdn.microsoft.com/ mobility microsoft.public. pocketpc.developer smartphone.developer dotnet.framework.compactframework blogs.msdn.com/ windowsmobile vsdteam netcfteam Windows Mobile 5.0 Eval Kit Websites Newsgroups Blogs Tools Build Develop

© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.