Chapter 3: Windows7 Part 2.

Slides:



Advertisements
Similar presentations
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Advertisements

Chapter 3 Process Description and Control
Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
Case study 1 Windows 7.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
Windows XP 1 © Silbershatz, Galvin, Gagne CS502 Spring 2006 Windows XP CS-502 Operating Systems Slides excerpted from Silbershatz, Ch. 22.
2: OS Structures 1 Jerry Breecher OPERATING SYSTEMS STRUCTURES.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
CSCE 351: Operating System Kernels
OS Spring’03 Introduction Operating Systems Spring 2003.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Figure 1.1 Interaction between applications and the operating system.
CS-3013 & CS-502, Summer 2006 Windows XP1 CS-502 Operating Systems Slides excerpted from Silbershatz, Ch. 22.
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
1 I/O Management in Representative Operating Systems.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
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,
Page 110/1/2015 CSE 30341: Operating Systems Principles Windows XP  32-bit preemptive multitasking operating system for Intel microprocessors  Key goals.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Windows 2000 Course Summary Computing Department, Lancaster University, UK.
Windows 2000 System Mechanisms Computing Department, Lancaster University, UK.
CE Operating Systems Lecture 11 Windows – Object manager and process management.
Ihr Logo Operating Systems Internals & Design Principles Fifth Edition William Stallings Chapter 2 (Part II) Operating System Overview.
NT Kernel CS Spring Overview Interrupts and Exceptions: Trap Handler Interrupt Request Levels and IRT DPC’s, and APC’s System Service Dispatching.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Introduction to Operating Systems Concepts
Computer System Structures
Chapter 13: I/O Systems.
Chapter 3: Windows7 Part 5.
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Chapter 2: Computer-System Structures(Hardware)
Chapter 2: Computer-System Structures
KERNEL ARCHITECTURE.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 2: Computer-System Structures Computer System Operation I/O Structure Storage.
Chapter 3: Windows7 Part 2.
Module 2: Computer-System Structures
Data center server One of the specification is the size that server will take in a rack. 1U is the smallest size and blade servers, which fit one unit.
Main Memory Background Swapping Contiguous Allocation Paging
I/O Systems I/O Hardware Application I/O Interface
Operating System Concepts
Chapter 2: The Linux System Part 3
Process Description and Control
Lecture Topics: 11/1 General Operating System Concepts Processes
Process Description and Control
Lecture 4- Threads, SMP, and Microkernels
Architectural Support for OS
Process Description and Control
Module 2: Computer-System Structures
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Windows NT History Design Principles System Components
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
OPERATING SYSTEMS STRUCTURES
Architectural Support for OS
Chapter 2: Computer-System Structures
Chapter 2: Computer-System Structures
Module 2: Computer-System Structures
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
Module 2: Computer-System Structures
Michael Blinn Ben Hejl Jane McHugh Matthew VanMater
Mr. M. D. Jamadar Assistant Professor
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Module 12: I/O Systems I/O hardwared Application I/O Interface
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Chapter 3: Windows7 Part 2

Chapter 3: Windows7 History Design Principles System Components Environmental Subsystems File system Networking Programmer Interface

System Components

Windows Architecture Layered system of modules Protected mode: contains three components: hardware abstraction layer (HAL), kernel, executive. Executive includes file systems, network stack, and device drivers. User mode: collection of subsystems, services, DLLs, and the GUI Environmental subsystems emulate different operating systems Protection subsystems provide security functions Windows services provide facilities for networking, device interfaces, background execution, and extension of the system Rich shared libraries with thousands of APIs are implemented using DLLs to allow code sharing and simplify updates A graphical user interface is built into Win32 and used by most programs that interact directly with the user

Windows 7 Architecture

System Components — Kernel Foundation for the executive and the subsystems Never paged out of memory; execution is never preempted Four main responsibilities: thread scheduling interrupt and exception handling low-level processor synchronization recovery after a power failure Kernel is object-oriented, uses two sets of objects dispatcher objects control dispatching and synchronization (events, mutants, mutexes, semaphores, threads and timers) control objects (asynchronous procedure calls, interrupts, power notify, process and profile objects)

Kernel — Process and Threads The process has a virtual memory address space, information (such as a base priority), and an affinity for one or more processors. Threads are the unit of execution scheduled by the kernel’s dispatcher. Each thread has its own state, including a priority, processor affinity, and accounting information.

Kernel — Process and Threads A thread can be one of six states: ready, standby, running, waiting, transition, and terminated. Ready indicates that the thread is waiting to run. The highest-priority ready thread is moved to the standby state, which means it is the next thread to run. In a multiprocessor system, each processor keeps one thread in a standby state. A thread is running when it is executing on a processor. It runs until it is preempted by a higher-priority thread, until it terminates, until its allotted execution time (quantum) ends, or until it waits on a dispatcher object, such as an event signaling I/O completion. A thread is in the waiting state when it is waiting for a dispatcher object to be signaled. A thread is in the transition state while it waits for resources necessary for execution; for example, it may be waiting for its kernel stack to be swapped in from disk. A thread enters the terminated state when it finishes execution.

Kernel — Scheduling The dispatcher uses a 32-level priority scheme to determine the order of thread execution. Priorities are divided into two classes The real-time class contains threads with priorities ranging from 16 to 31 The variable class contains threads having priorities from 0 to 15

Kernel — Scheduling (Cont.) Scheduling can occur when a thread enters the ready or wait state, when a thread terminates, or when an application changes a thread’s priority or processor affinity. Real-time threads are given preferential access to the CPU; but Windows 7 does not guarantee that a real-time thread will start to execute within any particular time limit. The dispatcher uses a queue for each scheduling priority and traverses the set of queues from highest to lowest until it finds a thread that is ready to run. If a thread has a particular processor affinity but that processor is not available, the dispatcher skips past it and continues looking for a ready thread that is willing to run on the available processor. If no ready thread is found, the dispatcher executes a special thread called the idle thread. Priority class 0 is reserved for the idle thread.

Exceptions and Interrupts The kernel dispatcher also provides trap handling for exceptions and interrupts generated by hardware or software. Windows defines several architecture independent exceptions, including: Memory-access violation Integer overflow Floating-point overflow or underflow Integer divide by zero Floating-point divide by zero Illegal instruction Data misalignment Privileged instruction Page-read error Access violation

Exceptions and Interrupts For portability, the interrupt dispatcher maps the hardware interrupts into a standard set. The interrupts are prioritized and are serviced in priority order. There are 32 interrupt request levels (IRQLs) in Windows. Eight are reserved for use by the kernel; the remaining 24 represent hardware interrupts via the HAL . The Windows interrupts are defined in next Figure.

Windows 7 Interrupt Request Levels

Kernel — Trap Handling The kernel provides trap handling when exceptions and interrupts are generated by hardware of software. Exceptions that cannot be handled by the trap handler are handled by the kernel's exception dispatcher. The interrupt dispatcher in the kernel handles interrupts by calling either an interrupt service routine (such as in a device driver) or an internal kernel routine.

Executive — Object Manager Executive: Provides a set of services that all environmental subsystems use. Object: an entity that are manipulated by user mode programs for managing kernel mode entities. Ex: process threads, event files, semaphores. Windows 7 uses objects for all its services and entities; the object manager supervises the use of all the objects Generates an object handle used by applications to refer to objects Checks security Keeps track of which processes are using each object Objects are manipulated by a standard set of methods, namely create, open, close, delete, query-name, parse and security.

Executive — Naming Objects The Windows executive allows any object to be given a name, which may be either permanent or temporary. Object names are structured like file path names in UNIX. Windows implements a symbolic link object, which is similar to symbolic links in UNIX that allow multiple nicknames or aliases to refer to the same object. Each object is protected by an access control list.

Executive — Process Manager Provides services for creating, deleting, and using threads and processes Issues such as parent/child relationships or process hierarchies are left to the particular environmental subsystem that owns the process.

Executive — I/O Manager The I/O manager is responsible for file systems cache management device and network drivers

Executive — I/O Manager When the I/O manager receives a file’s user-level read request, the I/O manager sends an IRP to the I/O stack for the volume on which the file resides. For files that are marked as cacheable, the file system calls the cache manager to lookup the requested data in its cached file views. The cache manager calculates which entry of that file’s VACB index array corresponds to the byte offset of the request. The entry either points to the view in the cache or is invalid. If it is invalid, the cache manager allocates a cache block (and the corresponding entry in the VACB array) and maps the view into the cache block. The cache manager then attempts to copy data from the mapped file to the caller’s buffer.

Executive — I/O Manager If the copy succeeds, the operation is completed. If the copy fails, it does so because of a page fault, which causes the VM manager to send a non cached read request to the I/O manager. The I/O manager sends another request down the driver stack, this time requesting a paging operation, which bypasses the cache manager and reads the data from the file directly into the page allocated for the cache manager. Upon completion, the VACB is set to point at the page. The data, now in the cache, are copied to the caller’s buffer, and the original I/O request is completed. Next Figure shows an overview of these operations.

File I/O

Executive – PnP and Power Managers PnP (Plug-and-Play) manager is used to recognize and adapt to changes in the hardware configuration. When new devices are added (for example, PCI or USB), the PnP manager loads the appropriate driver. PnP also keeps track of the resources used by each device. The power manager controls energy use of by the CPU and devices. Drivers for devices not being used are told to shut off device CPUs are run at lower clock rate and/or lower energy states System can be put into standby mode with only memory on, or Hibernated by writing the contents of memory to disk and turning the system completely off