Docsity

Windows - Operating System - Lecture Slides, Slides of Computer Science

Toggle sidebar
bg1
Ch. 5.6.2, 9.10.1, Ch. 22.1-22.5:
Windows XP
•Preemptive multitasking
•Goals:
–Security, reliability, ease-of-use, Windows & POSIX
application compatibility, high-performance,
extensibility, portability, international language support
– Commercial
ā€¢ā€œthe layered architecture of the system … makes it
so easy to useā€ [my italics, p. 783, text]
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18

Partial preview of the text

Download Windows - Operating System - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Ch. 5.6.2, 9.10.1, Ch. 22.1-22.5:

Windows XP

  • Preemptive multitasking
  • Goals:
    • Security, reliability, ease-of-use, Windows & POSIX application compatibility, high-performance, extensibility, portability, international language support
    • Commercial
  • ā€œthe layered architecture of the system … makes it

so easy to useā€ [my italics, p. 783, text]

2

Outline

• A little history

• 22.3: System components

• 22.3.2.2: Threads & CPU scheduling

• 22.3.3.2: Virtual memory

• 22.4: Environmental subsystems

• 22.5: File System: NTFS

4

System Components (Fig. 22.1)

5

System Components - 2

  • Seems a microkernel design, but text does not use this term
  • Microkernel: Executes in protected mode
    • HAL: Hardware abstraction layer (p. 788)
      • Some hardware independence
      • HAL provides memory mapping, configuring I/O buses, setting up DMA, motherboard specific facilities
      • Device drivers (I/O manager) can still work directly with hardware
    • Kernel
      • thread scheduling, interrupt & exception handling, CPU synchronization, power failure recovery
      • Never paged out, never preempted
  • User mode processes
    • Environmental subsystems
      • User mode operating systems (e.g., MS-DOS, OS/2, Win32, POSIX)
      • Logon systems
    • User applications

7

CPU Scheduling - 1

  • Priority-based, preemptive scheduling
  • 32 priority levels; each has a queue of threads
    • Variable class: 0-
    • Real-time: 16-
    • Higher numbers indicate higher priority
  • Scheduler traverses from highest to lowest priority

queues

  • Round robin, combined with priority scheme

8

CPU Scheduling - 2

  • Variation on standard round-robin CPU scheduling
  • When thread’s time quantum runs out
    • Variable class: priority lowered
      • unless already base priority
    • Returned to relevant priority level in queue, in ready state
    • Why lower the thread priority? Are there conditions under which a variable class thread will not have its priority lowered?
  • When variable priority thread released from wait state
    • Dispatcher boosts priority, depending on type of wait
    • High boost:
      • Waiting for keyboard I/O
      • Thread associated with user’s active GUI window
    • Low boost: waiting for disk I/O

Virtual Memory: Section 9.10.

  • Demand paging with clustering
    • Bring in neighboring pages on a page fault: ā€œPrefetchingā€
  • Max/min working set size per process
    • Processes have initial working set size of 50 frames
  • If a process is at its working set maximum and a page

fault occurs

  • Local page replacement
  • When number of free frames drops below a certain

value

  • Automatic working-set trimming
  • memory manager removes pages from processes until processes at working set minimum
  • FIFO or variation of clock algorithm depending on hardware (p. 363) Docsity.com

11

Page tables: 32 bit Processor

(without PAE)

  • 2-level page tables
  • Each process has a page directory (outer page table)
    • 1024 page-directory entries (PDE’s)
    • Size 4 bytes for each PDE
    • Each PDE points to a page table
  • Page table (inner page table)
    • 1024 page-table entries (PTE’s)
    • Size 4 bytes for each PTE
    • Each PTE points to a 4 KB frame of physical memory
    • Page tables are swapped out to disk when necessary
  • Total size of all page tables, per process: 4 MB

Logical

Address

structure Docsity.com

13

Page tables: Page Table Entries

(PTE’s)

• 20 bits for frame number

• 12 bits remain to describe state of page

  • Accessed or written
  • Caching attributes
  • Access mode
  • Global
  • PTE valid

Ch. 22.4: Windows XP

Environmental Subsystems

  • Some implement user-level operating systems
  • Some implement services crucial to all user-level

operating systems

  • E.g., GUI, security management
  • Win
  • Executes in unprotected mode
  • Provides all keyboard, mouse, graphical display
  • Other environmental subsystems use this
  • Separate processes with own input queues
  • Window manager dispatches input to input queue of appropriate process

16

Client/server model - 1

  • User-level operating systems considered to be

ā€œclientsā€

  • Kernel considered to be ā€œserverā€
  • Communication between client and server

provided by message passing

  • ā€œLocal procedure callā€ (LPC) facility
    • like Remote Procedure Calls
  • Message passing within a single computer
  • Used to implement system calls

17

Client/server model - 2

  • Server (e.g., kernel)
    • Publishes a globally visible connection port object
  • Client (e.g., Win32), to obtain services provided

by server

  • Opens a handle to server connection port
    • Sends connection request
  • Server creates channel & returns handle to client
  • Channel: pair of private communication ports
    • Client-to-server messages
    • Server-to-client messages
  • Some specifics dependent on message sizes
  • Small messages (e.g., up to a few hundred

bytes) are copied from sender to receiver

  • Shared memory is used for larger messages Docsity.com

19

NTFS: Files

  • In NTFS a file is not a simple stream of bytes as it

is in some operating systems (e.g., Unix)

  • Rather, files are structured objects comprised of

typed attributes

  • Some types of attributes
    • Conventional data of a file
    • Standard attributes: name, creation time, security descriptor
  • Examples of other uses of these typed attributes
    • Mac file resource fork on a Windows XP file server
    • Thumbnail of an image

20

NTFS: Clusters

• Cluster: Unit of disk allocation

• Allocates sectors on disk in contiguous

groups

  • A number of 512 byte disk sectors (power of

two size)

• Example

  • Cluster size is 4096 bytes with disks > 4GB
  • If the (block) sector size on disk is 512 bytes,

this means each cluster is going to be 8 (blocks)

sectors