Chapter 22: Windows XP - PowerPoint PPT Presentation

1 / 57
About This Presentation
Title:

Chapter 22: Windows XP

Description:

Operating System Concepts 7th Edition, Feb 6, 2005. Module 22: ... Processes has a quota on commited memory space. 22.40. Silberschatz, Galvin and Gagne 2005 ... – PowerPoint PPT presentation

Number of Views:46
Avg rating:3.0/5.0
Slides: 58
Provided by: marily275
Category:

less

Transcript and Presenter's Notes

Title: Chapter 22: Windows XP


1
Chapter 22 Windows XP
2
Module 22 Windows XP
  • History
  • Design Principles
  • System Components
  • Environmental Subsystems
  • File system
  • Networking
  • Programmer Interface

3
Objectives
  • To explore the principles upon which Windows XP
    is designed and the specific components involved
    in the system
  • To understand how Windows XP can run programs
    designed for other operating systems
  • To provide a detailed explanation of the Windows
    XP file system
  • To illustrate the networking protocols supported
    in Windows XP
  • To cover the interface available to system and
    application programmers

4
Windows XP
  • 32-bit preemptive multitasking operating system
    for Intel microprocessors
  • Windows XP 64-bit Edition (July 2005)
  • Key goals for the system
  • portability
  • security
  • POSIX compliance
  • multiprocessor support
  • extensibility
  • international support
  • compatibility with MS-DOS and MS-Windows
    applications.
  • Uses a micro-kernel architecture
  • Available in four versions, Professional, Server,
    Advanced Server, National Server

5
History Windows 1.0
6
History Windows 2.0
7
History Windows 3.0
8
History OS/2
9
History OS/2
  • Microsoft and IBM had co-operatively been
    developing OS/2 as a successor to DOS.
  • OS/2 1.0, released in 1987, supported swapping
    and multitasking and allowed running of DOS
    executables.
  • A GUI, called the Presentation Manager (PM), was
    not available with OS/2 until version 1.1,
    released in 1988.
  • By the early 1990s, conflicts developed in the
    Microsoft/IBM relationship. In an attempt to
    resolve this tension, IBM and Microsoft agreed
    that IBM would develop OS/2 2.0, to replace OS/2
    1.3 and Windows 3.0, while Microsoft would
    develop a new operating system, OS/2 3.0, to
    later succeed OS/2 2.0.
  • This agreement soon however fell apart, and the
    Microsoft/IBM relationship was terminated. IBM
    continued to develop OS/2, while Microsoft
    changed the name of its (as yet unreleased) OS/2
    3.0 to Windows NT.

10
History Windows 3.1 and NT
11
History Windows NT 4.0
12
History Windows 98
13
History Windows 2000
14
History Windows Me
15
History Windows Me
16
History
  • In 1988, Microsoft decided to develop a new
    technology (NT) portable operating system that
    supported both the OS/2 and POSIX APIs
  • Originally, NT was supposed to use the OS/2 API
    as its native environment but during development
    NT was changed to use the Win32 API, reflecting
    the popularity of Windows 3.0

17
Design Principles
  • Extensibility layered architecture
  • Executive, which runs in protected mode, provides
    the basic system services
  • On top of the executive, several server
    subsystems operate in user mode
  • Modular structure allows additional environmental
    subsystems to be added without affecting the
    executive
  • Portability XP can be moved from on hardware
    architecture to another with relatively few
    changes
  • Written in C and C
  • Processor-dependent code is isolated in a dynamic
    link library (DLL) called the hardware
    abstraction layer (HAL)

18
Design Principles (Cont.)
  • Reliability XP uses hardware protection for
    virtual memory, and software protection
    mechanisms for operating system resources
  • Compatibility applications that follow the IEEE
    1003.1 (POSIX) standard can be complied to run on
    XP without changing the source code
  • Performance XP subsystems can communicate with
    one another via high-performance message passing
  • Preemption of low priority threads enables the
    system to respond quickly to external events
  • Designed for symmetrical multiprocessing
  • International support supports different
    locales via the national language support (NLS)
    API

19
XP Architecture
  • Layered system of modules
  • Protected mode HAL, kernel, executive
  • User mode collection of subsystems
  • Environmental subsystems emulate different
    operating systems
  • Protection subsystems provide security functions

20
Depiction of XP Architecture
21
Kernel-Mode Components
  • Executive
  • Contains base operating system services
  • Memory management
  • Process and thread management
  • Security
  • I/O
  • Interprocess communication
  • Kernel
  • Consists of the most used components

22
Kernel-Mode Components
  • Hardware abstraction layer (HAL)
  • Isolates the operating system from
    platform-specific hardware differences
  • Device drivers
  • Translate user I/O function calls into specific
    hardware device I/O requests
  • Windowing and graphics systems
  • Implements the graphical user interface (GUI)

23
Windows Executive
  • I/O manager
  • Cache manager
  • Object manager
  • Plug and play manager
  • Power manager
  • Security reference monitor
  • Virtual memory manager
  • Process/thread manager
  • Configuration manager
  • Local procedure call (LPC) facility

24
User-Mode Processes
  • Special system support processes
  • Eg. logon process and the session manager
  • Service processes
  • Eg. Event logger
  • Environment subsystems
  • Win32, POSIX OS/2
  • User applications
  • Win32, Win16 MS-DOS
  • POSIX
  • OS/2

25
Client/Server Model
  • Simplifies the Executive
  • Possible to construct a variety of APIs
  • Improves reliability
  • Each service runs on a separate process with its
    own partition of memory
  • Clients cannot not directly access hardware
  • Provides a uniform means for applications to
    communicate via LPC
  • Provides base for distributed computing

26
Threads and SMP
  • Operating system routines can run on any
    available processor
  • Different routines can execute simultaneously on
    different processors
  • Multiple threads of execution within a single
    process may execute on different processors
    simultaneously
  • Server processes may use multiple threads
  • Share data and resources between process

27
Windows Objects
  • Encapsulation
  • Object consists of one or more data items and one
    or more procedures
  • Object class or instance
  • Create specified instances of an object
  • Inheritance
  • Support to some extent in the Executive
  • Polymorphism

28
Windows Processes
  • Implemented as objects
  • An executable process may contain one or more
    threads
  • Both processes and thread objects have built-in
    synchronization capabilities

29
(No Transcript)
30
Windows Process Object
31
Windows Thread Object
32
Windows 2000/XP Thread States
33
User-Level Threads
  • A fiber is user-mode code that gets scheduled
    according to a user-defined scheduling algorithm
  • Only one fiber at a time is permitted to execute,
    even on multiprocessor hardware
  • XP includes fibers to facilitate the porting of
    legacy UNIX applications that are written for a
    fiber execution model

34
Windows Synchronization
  • To synchronize the concurrent access to shared
    objects by threads, the kernel provides
    synchronization objects
  • Semaphores
  • Mutexes
  • In addition, threads can synchronize by using
  • WaitForSingleObject
  • WaitForMultipleObjects
  • Another method of synchronization in the Win32
    API is the critical section

35
(No Transcript)
36
Inter-process Comm.
  • Win32 applications can have interprocess
    communication by sharing kernel objects
  • An alternate means of interprocess communications
    is message passing, which is particularly popular
    for Windows GUI applications
  • One thread sends (synchronous) or posts
    (asynchronous) a message to another thread or to
    a window
  • A thread can also send data with the message
  • Every Win32 thread has its own input queue from
    which the thread receives messages

37
Windows Memory Management
  • A heap in the Win32 environment is a region of
    reserved address space
  • A Win 32 process is created with a 1 MB default
    heap
  • Access is synchronized to protect the heaps
    space allocation data structures from damage by
    concurrent updates by multiple threads
  • Functions that rely on global or static data
    typically fail to work properly in a
    multithreaded environment
  • Thread-local storage mechanism allocates global
    storage on a per-thread basis
  • The mechanism provides both dynamic and static
    methods of creating thread-local storage

38
Virtual Address Space
39
Executive - Virtual Memory Manager
  • Assumes that the underlying hardware supports
  • Virtual to physical mapping
  • A paging mechanism
  • Transparent cache coherence on multiprocessor
    systems
  • Many pages map to the same frame
  • Uses a page-based management scheme with a page
    size of 4 KB
  • Uses a two step process to allocate memory
  • Reserve a portion of the process address space
  • Commit the allocation by assigning space in the
    paging file or physical memory
  • Processes has a quota on commited memory space

40
Virtual-Memory Layout
41
Virtual Memory Manager (Cont.)
  • Each process in XP has
  • A page directory with 1024 page directory entries
    (PDEs)
  • Each PDE points to a page table
  • A page table contains 1024 page table entries
    (PTEs)
  • Each PTE points to a 4 KB page frame in physical
    memory
  • A page can be in one of seven states
  • Valid used by a process
  • Free free to use
  • Zeroed free to use and zeroed
  • Modified needs to be written to disk
  • Standby mirrors content on disk
  • Bad hardware error
  • In transition on its way from disk

42
Virtual-to-Physical Address Translation
  • 10 bits for page directory entry
  • 10 bits for page table entry
  • 12 bits for byte offset in page

43
Page File Page-Table Entry
  • 5 bits for page protection
  • 20 bits for page frame address
  • 4 bits to select a paging file
  • 3 bits that describe the page state.

44
Windows Scheduling
  • Priority-driven preemptive scheduler
  • Threads are the unit of execution scheduled by
    the kernels dispatcher
  • Priorities organized into two bands or classes
  • Real time
  • Contains threads with priorities ranging from 16
    to 31
  • Variable
  • Contains threads having priorities from 0 to 15

45
(No Transcript)
46
Windows Scheduling
  • Characteristics of XPs priority strategy
  • Tends to give very good response times to
    interactive threads that are using the mouse and
    windows
  • Enables I/O-bound threads to keep the I/O devices
    busy
  • Complete-bound threads soak up the spare CPU
    cycles in the background

47
(No Transcript)
48
Windows I/O
  • Basic I/O modules
  • Cache manager
  • File system drivers
  • Network drivers
  • Hardware device drivers

49
I/O Manager
  • Keeps track of which installable file systems are
    loaded
  • Manages buffers for I/O requests
  • Works with VM Manager to provide memory-mapped
    file I/O
  • Controls the XP cache manager
  • handles caching for the entire I/O system
  • Supports both synchronous and asynchronous
    operations,
  • provides time outs for drivers

50
File I/O
51
Windows File System
  • Key features of NTFS
  • Recoverability
  • Security
  • Large disks and large files
  • Multiple data streams
  • Eg. to handle macintosh files
  • General indexing facility
  • Files can be indexed by different attributes

52
NTFS Volume and File Structure
  • Sector
  • The smallest physical storage unit on the disk
  • Cluster
  • One or more contiguous sectors
  • Is used as the underlying unit of disk allocation
  • Volume
  • The fundamental structure of NTFS
  • Logical partition
  • Part of a disk
  • Whole disk
  • Span several disks
  • All metadata is stored in a regular file

53
NTFS Internal Layout
  • Uses logical cluster numbers (LCNs) as disk
    addresses
  • A file is a structured object consisting of
    attributes
  • Not a simple byte stream, as in MS-DOS or UNIX
  • Every file is described by one or more records in
    the MFT
  • A special file called the Master File Table
  • Each file on a volume has a unique ID called a
    file reference.
  • 48-bit file number
  • 16-bit sequence number
  • Can be used to perform internal consistency
    checks
  • The name space is organized by a hierarchy of
    directories
  • The index root contains the top level of the B
    tree

54
(No Transcript)
55
File System Security
  • Security of an NTFS volume is derived from the XP
    object model
  • Each file object has a security descriptor
    attribute stored in this MFT record
  • This attribute contains
  • The access token of the owner of the file
  • An access control list
  • States the access privileges granted to users
    that has access to the file

56
File System Compression
  • To compress a file, NTFS divides the files data
    into compression units, which are blocks of 16
    contiguous clusters
  • For sparse files, NTFS uses another technique to
    save space
  • Clusters that contain all zeros are not actually
    allocated or stored on disk
  • Instead, gaps are left in the sequence of virtual
    cluster numbers stored in the MFT entry for the
    file
  • When reading a file, if a gap in the virtual
    cluster numbers is found, NTFS just zero-fills
    that portion of the callers buffer

57
End of Chapter 22
Write a Comment
User Comments (0)
About PowerShow.com