Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2003 Wayne Wolf Overheads for Computers as Components Operating systems zWindows CE (WinCE).

Similar presentations


Presentation on theme: "© 2003 Wayne Wolf Overheads for Computers as Components Operating systems zWindows CE (WinCE)."— Presentation transcript:

1 © 2003 Wayne Wolf Overheads for Computers as Components Operating systems zWindows CE (WinCE).

2 © 2003 Wayne Wolf Overheads for Computers as Components Goals zSupport lightweight consumer devices: yPDAs. ySet-top boxes. zSimplify porting existing Windows applications to the new platforms.

3 © 2003 Wayne Wolf Overheads for Computers as Components WinCE architecture OEM hardware OAL bootload drivers Device drivers File drivers Network drivers Kernel library GWES Device manager File manager IrDATCP/IP Win32 APIs WinCE shell services Embedded shell Remote connectivity Applications

4 © 2003 Wayne Wolf Overheads for Computers as Components Virtual memory zWinCE uses virtual memory. yMost devices don’t have disk drive. zCode can be paged from ROM, etc. zWinCE suports a flat 32-bit virtual address space. zVirtual address may be: yStatically mapped (kernel-mode code). yDynamically mapped (user-mode and some kernel- mode code).

5 © 2003 Wayne Wolf Overheads for Computers as Components Address space zBottom half is user space. zTop half is kernel space. User space 2 GB Kernel space 2 GB

6 © 2003 Wayne Wolf Overheads for Computers as Components Kernel address space zOperating system (nk.exe). zStatically mapped virtual addresses. yUp to 512 MB of physical resources can be statically mapped. zControl of static mapping varies: yOEM control for ARM and x86. yCPU control for SHx and MIPS.

7 © 2003 Wayne Wolf Overheads for Computers as Components User address space z64 slots of 32 MB each. zSlot 0 is currently running process. zSlots 1-33 are the processes. y32 processes max. zObject store, memory mapped files, resource mappings. Slot 0: current process Slot 1: DLLs Slot 2: process Slot 3: process … Slots 33-62: object store, memory mapped files Slot 63: resource mappings

8 © 2003 Wayne Wolf Overheads for Computers as Components Process slot zIncludes code, DLL and virtual allocations. zVirtual allocations are 64 KB-aligned; 4KB pages can be committed within an allocation. zMovement: yDLL allocations start at the top and grow down. yProcess and general allocations start at the bottom and grow up. Guard section (64K) User code: Stack, heap per thread DLL virtual memory allocations

9 © 2003 Wayne Wolf Overheads for Computers as Components API calls zSystem call may be to DLL, another EXE. zCOREDLL provides link between system API and EXE. zSystem call: yException caught by kernel. yKernel determines which EXE gets the call.

10 © 2003 Wayne Wolf Overheads for Computers as Components Driver structure zA driver is a DLL with particular interface points. zHosted by a device manager process space (may be GWES). zHandle interrupts by dedicated IST thread. zSynchronize driver and application via critical sections and MUTEXes.

11 © 2003 Wayne Wolf Overheads for Computers as Components Driver architecture Device I/O RM GWES PCI busdisplay touch mouse Notification LED batterynetworkaudioFirewire USB host PCMCIA host

12 © 2003 Wayne Wolf Overheads for Computers as Components Device manager zAlways-running user-level process. zContains the I/O Resource Manager. zLoads the registry enumerator DLL which in turn loads drivers. zProvides power notification callbacks.

13 © 2003 Wayne Wolf Overheads for Computers as Components Registry enumerator zDLL (RegEum.dll). yRe-entrant, supports hierarchical usage. zDriver loading: yRegEnum scans registry, loads bus drivers. yBus driver scans bus, locates devices. ySearches registry for device information. yLoads appropriate drivers. ySends notification that interface is available.

14 © 2003 Wayne Wolf Overheads for Computers as Components Interrupt handling zWork divided into two sections: yInterrupt service routine (ISR): xKernel mode service. xMay be static or installable. yInterrupt service thread (IST): xUser mode thread.

15 © 2003 Wayne Wolf Overheads for Computers as Components Static ISR zBuilt into the kernel. ySHx and MIPS must be written in assembler, limited register availability. zOne-way communication from ISR to IST. yCan share a buffer but location must be predefined. zNested ISR support based on CPU, OEM’s initialization. zStack is provided by the kernel.

16 © 2003 Wayne Wolf Overheads for Computers as Components Installable ISR zCan be dynamically loaded into kernel. zLoads a C DLL. zCan use shared memory for communication. zISRs are processed in the order they were installed. zLimited stack size.

17 © 2003 Wayne Wolf Overheads for Computers as Components WinCE 4.x interrupts All higher enabled HW kernel OAL I-ISR thread All enabled Except ID All enabled ISHSet eventEnable ID ISR IST processing device

18 © 2003 Wayne Wolf Overheads for Computers as Components Kernel scheduler zTwo styles of preemptive multitasking. yThread runs until end of quantum. yThread runs until higher priority thread is ready to run. zRound-robin within priority level. zQuantum is defined by OEM and application. zPriority inheritance to control priority inversion. z256 total priorities. yTop 248 can be protected by the OEM.

19 © 2003 Wayne Wolf Overheads for Computers as Components Thread quantum zPer-thread quantum. yDefault set by OEM. zUse API to set quantum. zQuantum of 0 means run-to-completion.

20 © 2003 Wayne Wolf Overheads for Computers as Components System tick z1 ms timer tick normally. zSleep(N) will generally wake up in N to N+1 ms.

21 © 2003 Wayne Wolf Overheads for Computers as Components Causes of interrupt latency zISR: yAmount of time that interrupts are turned off. yTime required to vector ISR, save registers, etc. zIST: yTime spent in ISR. yTime spent in Kcall. yThread scheduling time.

22 © 2003 Wayne Wolf Overheads for Computers as Components Improvements to latency in WinCE 4.x zLess non-preemptable code. ySome routines split into several smaller routines. zKernel data structures moved to statically mapped virtual addresses. zSpecial-case ISTs provided. zImproved priority inversion handling.

23 © 2003 Wayne Wolf Overheads for Computers as Components Controlling scheduling/latency zThread scheduling: ySet priorities appropriately, choose proper quantum. zMemory: yPreallocate memory, threads, sync objects. zUnderstand device characteristics: yI/O-based access may incur a penalty. zOn x86 avoid using CMOS real-time clock, use software real-time clock. zDisable idle processing. zDisable demand paging.

24 © 2003 Wayne Wolf Overheads for Computers as Components Real-time measurement zILTiming ySoftware-based real-time measurement tool. xMeasures ISR latency from IRQ to ISR. xMeasures IST latency from end of ISR to start of IST. zKernel tracker yTracks interrupts, TLB misses, and priority inversion.

25 © 2003 Wayne Wolf Overheads for Computers as Components Board support package zCustomizes OS for a hardware platform. yDrivers, memory configuration, power management, etc. zSoftware development environment provides tools for BSP development.

26 © 2003 Wayne Wolf Overheads for Computers as Components BSP development process Test HW Clone Reference BSP Develop Boot loader Develop Minimal kernel Add device drivers Power management Package BSP

27 © 2003 Wayne Wolf Overheads for Computers as Components Boot loader zThe Boot loader loads an executable image and runs it. yLoadable by Ethernet, USB, serial, local flash, etc. yMemory may be flash or ROM. yMay need different development, production loaders.

28 © 2003 Wayne Wolf Overheads for Computers as Components OAL architecture Kernel (Microsoft) Hardware Real-time clock USB/ Ethernet/ Serial OAL RTC Power Mgt. interrupt functions debug


Download ppt "© 2003 Wayne Wolf Overheads for Computers as Components Operating systems zWindows CE (WinCE)."

Similar presentations


Ads by Google