Advancement of the Windows Bit Engineering.

Uploaded on:
Designer for UMS in Windows 7/Windows Server 2008 R2 ... Albeit both Windows and Linux have adjusted to changes in nature, the first outline situations ...
Slide 1

Dave Probert, Ph.D. - Windows Kernel Architect Microsoft Windows Division Evolution of the Windows Kernel Architecture 08.10.2009 Buenos Aires Copyright Microsoft Corporation

Slide 2

About Me Ph.D. in Computer Engineering (Operating Systems w/o Kernels) Kernel Architect at Microsoft for more than 13 years Managed stage autonomous portion improvement in Win2K/XP Working on multi-center & heterogeneous parallel processing bolster Architect for UMS in Windows 7/Windows Server 2008 R2 Co-instigator of the Windows Academic Program Providing part source and educational modules materials to colleges or Wrote the Windows material for driving OS reading material Tanenbaum, Silberschatz, Stallings Consulted on others, including a fruitful OS course book in China

Slide 3

UNIX versus NT Design Environments Copyright Microsoft Corporation

Slide 4

Effect on OS Design Copyright Microsoft Corporation

Slide 5

Today\'s Environment [2009] Copyright Microsoft Corporation

Slide 6

Service Control Mgr. LSASS SvcHost.Exe Task Manager WinMgt.Exe Explorer WinLogon SpoolSv.Exe User Application Services.Exe User Mode Subsystem DLLs Kernel Mode Windows Architecture Environment Subsystems System Processes Services Applications Windows OS/2 Session Manager POSIX Windows DLLs System Threads NTDLL.DLL System Service Dispatcher (piece mode callable interfaces) Windows USER, GDI I/O Mgr File System Cache Object Mgr. Fitting and Play Mgr. Power Mgr. Security Reference Monitor Virtual Memory Processes & Threads Configura-tion Mgr (registry) Local Procedure Call Device & File Sys. Drivers Graphics Drivers Kernel Hardware Abstraction Layer (HAL) equipment interfaces (transports, I/O gadgets, interferes with, interim clocks, DMA, memory store control, and so forth., and so forth.) Copyright Microsoft Corporation

Slide 7

Kernel-mode Architecture of Windows client mode NT API stubs (wrap sysenter) - framework library (ntdll.dll) NTOS bit layer Trap/Exception/Interrupt Dispatch CPU mgmt: planning, synchr, ISRs/DPCs/APCs Drivers Devices, Filters, Volumes, Networking, Graphics Procs/Threads IPC Object Mgr bit mode Virtual Memory paste Security Caching Mgr I/O Registry NTOS official layer Hardware Abstraction Layer (HAL): BIOS/chipset points of interest firmware/equipment CPU, MMU, APIC, BIOS/ACPI, memory, gadgets Copyright Microsoft Corporation Copyright Microsoft Corporation

Slide 8

Kernel/Executive layers Kernel layer – ntos/ke – ~ 5% of NTOS source) Abstracts the CPU Threads, Asynchronous Procedure Calls (APCs) Interrupt Service Routines (ISRs) Deferred Procedure Calls (DPCs – otherwise known as Software Interrupts) Providers low-level synchronization Executive layer OS Services running in a multithreaded domain Full virtual memory, pile, handles Extensions to NTOS: drivers, record frameworks, system, … Copyright Microsoft Corporation

Slide 9

NT (Native) API cases NtCreateProcess (& ProcHandle , Access, SectionHandle , DebugPort , ExceptionPort , … ) NtCreateThread (& ThreadHandle , ProcHandle , Access, ThreadContext , bCreateSuspended , … ) NtAllocateVirtualMemory ( ProcHandle , Addr , Size, Type, Protection, … ) NtMapViewOfSection ( SectionHandle , ProcHandle , Addr , Size, Protection, … ) NtReadVirtualMemory ( ProcHandle , Addr , Size, … ) NtDuplicateObject ( srcProcHandle , srcObjHandle , dstProcHandle , dstHandle , Access, Attributes, Options) Copyright Microsoft Corporation

Slide 10

Windows Vista Kernel Changes Kernel changes generally minor enhancements Algorithms, versatility, code practicality CPU timing: Uses Time Stamp Counter (TSC) Interrupts not charged to strings Timing and quanta are more exact Communication ALPC: Advanced Lightweight Procedure Calls Kernel-mode RPC New TCP/IP stack (coordinated IPv4 and IPv6) I/O Remove a setting switch from I/O Completion Ports I/O cancelation upgrades Memory administration Address space randomization (DLLs, stacks) Kernel address space progressively designed Security: BitLocker , DRM, UAC, Integrity Levels Copyright Microsoft Corporation

Slide 11

Windows 7 Kernel Changes Miscellaneous bit changes MinWin Change how Windows is constructed Lots of DLL refactoring API Sets (virtual DLLs) Working-set administration Runaway procedures rapidly begin reusing own pages Break up piece working-set into numerous working-sets System reserve, paged pool, pageable framework code Security Better UAC, new record sorts, less BitLocker blockers Energy proficiency Trigger-began foundation administrations Core Parking Timer-mixing, tick skipping Major adaptability enhancements for vast server applications Broke separated last two noteworthy bit locks, >64p Kernel support for ConcRT User-Mode Scheduling (UMS) Copyright Microsoft Corporation

Slide 12

MinWin is initial step at making structural segments Can be fabricated, booted and tried independently from whatever is left of the framework Higher layers can advance autonomously A building process change, not a microkernel NT! MinWin was characterized as set of segments required to boot and get to network Kernel, document framework driver, TCP/IP stack, gadget drivers, benefits No overhauling, WMI, representation, sound or shell, and so on, and so on, and so forth MinWin impression: 150 doubles, 25MB on plate, 40MB in-memory

Slide 13

MinWin Layering Shell, Graphics, Multimedia, Layered Services, Applets, Etc. Part, HAL, TCP/IP, File Systems, Drivers, Core System Services MinWin

Slide 14

Timer Coalescing Secret of vitality effectiveness: Go sit out of gear and Stay unmoving Staying unmoving requires minimizing clock hinders Before, occasional clocks had autonomous cycles notwithstanding when period was the same New clock APIs grant clock blending Application or driver indicates middle of the road delay Timer framework shifts clock terminating Timer tick 15.6 ms Vista Periodic Timer Events Windows 7 MarkRuss

Slide 15

Broke separated the Dispatcher Lock Scheduler Dispatcher lock most sizzling on server workloads Lock ensures all string state changes (hold up, unwait) Very bolt at >64x Dispatcher lock separated in Windows 7/Server 2008 R2 Each article secured by its own lock Many operations are sans lock hot Copyright Microsoft Corporation

Slide 16

Removed PFN Lock Windows tracks the condition of pages in physical memory In use: in working sets: Not doled out: on paging records: freemodified, standby, … Before, all page state changes secured by worldwide PFN (Physical Frame Number) lock As of Windows 7 the PFN lock is gone Pages are currently bolted independently Improves adaptability for extensive memory applications Copyright Microsoft Corporation

Slide 17

The Silicon Power Wall The circumstance: Power 2 ∝ Clock recurrence Voltage ∝ Power 2 Clock recurrence and Voltage balance each other Clock recurrence contrarily relative to rationale way length Bad News: Power is about as low as it can go Logic ways between timed components are entirely short Good News: Moore\'s Law proceeds (# transistors pairs ~22 months) All that parallel computational hypothesis is going into practice Transistors going into more centers, not quicker centers! Programming subject to Amdahl\'s Law, not Moore\'s Law (or Gustafson\'s Law – if my wife can discover sufficiently vast datasets she thinks about) 17

Slide 18

Approaches to HW parallelism Homogeneous More huge superscalar centers Extend with private (or shared) SIMD motors (SSE on steroids) ( Maybe) not exceptionally vitality proficient A couple of all the more enormous, centers and heaps of littler, slower, cooler centers Use SIMD for execution Shutoff sit still little centers for vitality productivity (yet spillage?) Lots of little completely programmable centers, all the same Nobody has ever motivated this to work – more on this later Heterogeneous Programmable Accelerators (e.g. GPUs) Attach approximately coupled, particular (non-x86), vitality proficient centers Fixed-capacity Accelerators Very vitality effective, gadget like computational units for certain assignments 18

Slide 19

User Mode Scheduling (UMS) Improve support for productive agreeable multithreaded planning of little undertakings (over-decay) Want to timetable errands in client mode Use NT strings to recreate CPUs, multiplex assignments onto these strings When an undertaking calls into the bit and hinders, the CPU may get booked to an alternate application If a solitary NT string for each CPU, when it squares it pieces. Could have additional strings, yet then piece and client mode are contending to plan the CPU Tasks run discretionary Win32 code (however just x64/IA64) Assumes running on a NT string (TEB, bit string) Used by ConcRT (Visual Studio 2010\'s Concurrency Run-Time) Copyright Microsoft Corporation

Slide 20

Windows 7 User-Mode Scheduling UMS breaks NT string into two sections: UT: client mode bit (TEB, ustack , registers ) KT: bit mode segment (ETHREAD, kstack , registers) Three key properties: User-mode scheduler switches UTs w/o ring crossing KT switch is sluggish: at part passage (e.g. syscall , pagefault ) CPU came back to client mode scheduler when KT squares KT "returns" to client mode by lining fulfillment User-mode scheduler plans relating UT (like scheduler actuations, and so forth) Copyright Microsoft Corporation

Slide 21

Normal NT Threading x86 center Kernel-mode Scheduler NTOS official KT 0 KT 1 KT 2 piece trap code client UT 0 UT 1 UT 2 NT Thread is Kernel Thread (KT) and User Thread (UT) UT/KT frame a solitary consistent string speaking to NT string in client or bit KT: ETHREAD, KSTACK, connection to EPROCESS UT: TEB, USTACK Copyright Microsoft Corporation

Slide 22

User-Mode Scheduling (UMS) NTOS official KT 0 squares KT 0 KT 1 KT 2 Primary Thread trap code Thread Parking portion client UT Completion list UT 0 User-mode Scheduler Only essential string keeps running in client mode Trap code changes to stopped KT pieces  essential comes back to client mode KT unblocks & parks  line UT finishing UT 0 UT 1 Copyright Microsoft Corporation

Slide 23

UMS Based on NT strings Ea

View more...