Understanding Operating Systems Seventh Edition Chapter 14 Windows Operating Systems Learning Objectives After completing this chapter, you should be able to describe: • Design goals for Windows operating systems designers • The role of the Memory Manager and Virtual Memory Manager in Windows • Its use of the Device, Processor, and Network Managers • System security challenges for Windows • Windows user interfaces Understanding Operating Systems, 7e 2 Brief History • Windows products before 1995 release: Windows 95 operating system – Graphical user interfaces requiring the MS-DOS operating system – Disadvantages: • • • • Multitasking not supported Little built-in security Lacked interprocess communication capability Required customization to work with each system hardware component Understanding Operating Systems, 7e 3 (table 14.1) Select Microsoft Windows operating systems. For details about these and other versions, refer to www.microsoft.com. © Cengage Learning 2014 Understanding Operating Systems, 7e 4 Brief History (cont’d.) • Windows products since 1995 – Abandoned MS-DOS reliance – More powerful networking products • Windows product version number – – – – Windows XP: version 5.1 Windows 7: version 6.2 Windows 8: version 6.2 Display by pressing Windows logo key and the R key together • Type winver Understanding Operating Systems, 7e 5 Design Goals • Windows networking operating systems – Influenced by several operating system models • Employed already-existing frameworks • Introduced new features – Object model: manage and allocate resources – Symmetric multiprocessing (SMP): achieve maximum multiprocessor performance Understanding Operating Systems, 7e 6 Design Goals (cont'd.) • Needs – Accommodate user needs – Optimize resources • Response – Five design goals • • • • • Extensibility Portability Reliability Compatibility Performance Understanding Operating Systems, 7e 7 Extensibility • Easily enhancing operating system • Ensuring code integrity: separate functions – Privileged executive process • • • • Kernel mode Processor’s mode of operation All machine instructions allowed System memory accessible – Nonprivileged processes protected subsystems • User mode • Certain instructions not allowed • System memory not accessible Understanding Operating Systems, 7e 8 Extensibility (cont'd.) • Additional features – Modular structure • New components added to executive process – Objects • Abstract data types manipulated by special services • System resources managed uniformly – Remote procedure call • Application calls remote services • Regardless of location on network Understanding Operating Systems, 7e 9 Portability • Operates on different platforms – Different processors or configurations – Minimum amount of recoding • System guidelines to achieve goal – Written in a standardized, high-level language • Available in all machines – Accommodate ported hardware – Minimize direct code interaction with hardware • Reduce incompatibility errors – Isolate hardware-dependent code into modules • Easily modifiable when ported Understanding Operating Systems, 7e 10 Portability (cont'd.) • Windows features – Modular code – Written in C (most of code) • Graphic component and some networking portions written in C++ • Code communicating directly with hardware written in Assembly language – Hardware abstraction layer (HAL) • Dynamic-link library • Provides isolation from vendors’ hardware dependencies Understanding Operating Systems, 7e 11 Reliability • System robustness: error response predictability • Ability to protect itself and users – Accidental or deliberate user programs’ damage • Features strengthening system – Structured exception handling – Modular design – NTFS file system (NT File System) • Can recover from all error types – Advanced security architecture – Virtual memory strategy Understanding Operating Systems, 7e 12 Compatibility • Execute programs written for other operating systems (or earlier system versions) – Use protected subsystems • Provide application execution different from primary programming interface – Provides source-level POSIX application compatibility – Recent Windows versions • Support existing file systems including MS-DOS FAT, CDFS, and NTFS – Built-in verification • Important hardware and software Understanding Operating Systems, 7e 13 Performance • Responds quickly to CPU-bound applications • Windows features – System calls, page faults, and other crucial processes: respond in timely manner – Incorporated local procedure call (LPC): guarantees fast communication among protected subsystems – Critical Windows networking software elements: built into operating system privileged portion Understanding Operating Systems, 7e 14 Memory Management • Every operating system – Has own physical memory view – Makes application programs access memory in specified ways • Full physical memory – Virtual Memory Manager pages some memory contents to disk • Challenge for all Windows operating systems – Run application programs (Windows or POSIX) • Without programs crashing into each other’s memory Understanding Operating Systems, 7e 15 Memory Management (cont'd.) • Memory layout (recent Windows versions) – Operating system: high virtual memory – User code and data: low virtual memory • User process – Cannot read or write system memory directly • Memory paged to disk – User-accessible memory – System memory segment labeled paged pool • Memory never paged to disk – System memory segment labeled nonpaged pool Understanding Operating Systems, 7e 16 (figure 14.3) Layout of Windows memory. This is a virtual memory system based on 32-bit addresses in a linear address space. The 64-bit versions use a similar model but on a much larger scale with 8TB for the user and 8TB for the kernel. © Cengage Learning 2014 Understanding Operating Systems, 7e 17 User-Mode Features • VM Manager (virtual machine manager) – User-mode subsystems share memory efficiently – Provides native services: allows process to manage virtual memory • • • • • • Allocate memory in two stages Read and/or write protection for virtual memory Lock virtual pages in physical memory Retrieve information about virtual pages Protect virtual pages Rewrite virtual pages to disk Understanding Operating Systems, 7e 18 Virtual Memory Implementation • VM manager reliance – Address space management – Paging techniques • Address space management – Upper half of virtual address space • Accessible only to kernel-mode processes – Code in lower part (kernel code and data) • Never paged out of memory Understanding Operating Systems, 7e 19 Virtual Memory Implementation (cont'd.) • Paging – VM manager part: transfers pages • Between memory page frames and disk storage – Complex combination • Software policies: when to bring a page into memory and where to put it • Hardware mechanisms: exact manner VM Manager translates virtual addresses into physical addresses – Pager not portable: modified for each new hardware platform • Windows: small code and well-isolated Understanding Operating Systems, 7e 20 Virtual Memory Implementation (cont'd.) • Paging (cont’d.) – Processor chip translates program generated address into a physical address • Page with address not in memory: hardware generates a page fault and calls the pager – Processor uses translation look-aside buffer (TLB) • Speeds memory access Understanding Operating Systems, 7e 21 Virtual Memory Implementation (cont'd.) • Paging policies – Dictate how and when paging is done – Composition • Fetch policy: determines when pager copies a page from disk to memory • Placement policy: determines where virtual page is loaded in memory • Replacement policy: determines which virtual page is removed from memory to make room for a new page Understanding Operating Systems, 7e 22 Processor Management • Process: – Combination of executable program, private memory area, and operating system allocated resources as the program executes – Requires at least one execution thread • Thread – Process entity: roughly equated to a task Understanding Operating Systems, 7e 23 Processor Management (cont’d.) • Windows – Preemptive-multitasking, multithreaded operating system – Process contains one thread composed of: • A unique identifier • Volatile set of registers: contents indicate processor’s state • Two stacks used during thread’s execution • Private storage area: used by subsystems and dynamic-link libraries Understanding Operating Systems, 7e 24 Processor Management (cont'd.) • Threads – Thread components called thread’s context – Actual data forming context varies from one processor to another – Kernel • Schedules threads for execution on a processor – Thread actually executes code – Overhead incurred by thread is minimal – Unitasking • Process with single thread Understanding Operating Systems, 7e 25 Processor Management (cont'd.) (figure 14.4) Unitasking in Windows. Here’s how a process with a single thread is scheduled for execution on a system with a single processor. © Cengage Learning 2014 Understanding Operating Systems, 7e 26 Processor Management (cont'd.) • Multithreading – Systems with multiple processors • Process has as many threads as CPUs available • All threads belonging to one process: share global variables, heap, and environment strings • Windows operating systems – Include some synchronization mechanisms • Give exclusive access to global variables as multithreaded processes execute Understanding Operating Systems, 7e 27 (figure 14.5) Multitasking using multithreading. Here’s how a process with four threads can be scheduled for execution on a system with four processors. © Cengage Learning 2014 Understanding Operating Systems, 7e 28 Processor Management (cont'd.) • Multithreading example: modifying a database application – Entering records: one thread writes the last record to disk while another thread accepts new data – Database searching: several threads search an array simultaneously • Client/server applications: CPU-intensive for server – Client makes query requests; server’s processor manages the query – Windows handles requests allocating additional CPU resources Understanding Operating Systems, 7e 29 Device Management • Windows I/O system provides: – Multiple installable file systems (FAT, CDFS, and NTFS) – Services making device-driver development easy • Workable on multiprocessor systems – Drivers: added to or removed from system dynamically • System administrators – Fast I/O processing • Drivers written in high-level language – Mapped file I/O capabilities • Image activation, file caching, and application use Understanding Operating Systems, 7e 30 Device Management (cont'd.) • I/O system – Packet driven • I/O request represented by I/O request packet (IRP) – IRP • Data structure controlling how I/O operation processed at each step • I/O manager: – Creates an IRP representing each I/O operation – Passes IRP to appropriate driver – Disposes packet when operation complete Understanding Operating Systems, 7e 31 Device Management (cont'd.) • Driver IRP receipt – Performs specified operation – Passes it back to I/O manager or – Passes it through I/O manager to another driver for further processing Understanding Operating Systems, 7e 32 Device Management (cont'd.) • I/O manager tasks – – – – Supplies code, common to different drivers Manages buffers for I/O requests Provides time-out support for drivers Records installable file systems loaded into operating system – Provides flexible I/O facilities • Subsystems (POSIX) implement their respective I/O application programming interfaces – Allows dynamic loading: device drivers and file systems based on users’ needs Understanding Operating Systems, 7e 33 Device Management (cont'd.) • Windows I/O services – Device-independent model • Multilayered device driver concept • Device driver made up of standard set of routines – – – – – – Initialization routine Dispatch routine Start I/O routine Completion routine Unload routine Error logging routine Understanding Operating Systems, 7e 34 Device Management (cont'd.) • I/O manager – Determines driver called to process request • Based on file object’s name – Driver object • Represents individual driver in system • Created by I/O manager when driver loaded into system • May have multiple device objects connected to it – Device object • Physical, logical, or virtual device on the system • Describes device characteristics Understanding Operating Systems, 7e 35 Device Management (cont'd.) (table 14.2) Example showing how a device object is created from an instruction to read a file, illustrated in Figure 14.6. © Cengage Learning 2014 Understanding Operating Systems, 7e 36 (figure14.6) The driver object from Table 14.2 is connected to several device objects. The last device object points back to the driver object. © Cengage Learning 2014 Understanding Operating Systems, 7e 37 Device Management (cont'd.) • Device objects list – Represents physical, logical, virtual devices – Controlled by the driver • Advantages of using different objects – Portability • Frees I/O manager from knowing details about drivers • Follows pointer to locate driver – Easy loading of new drivers – Easy assigning drivers to control additional or different devices • System configuration changes Understanding Operating Systems, 7e 38 (figure14.7) Details of the layering of a file system driver and a disk driver. The steps shown here take place when the I/O Manager needs to access a secondary storage device to satisfy the command shown in Step 1. © Cengage Learning 2014 Understanding Operating Systems, 7e 39 Device Management (cont'd.) • I/O manager knows nothing about file system • Overhead – I/O manager passes information requests back and forth – Uses single-layer device driver approach • Simple devices (serial and parallel printer ports) – Uses multilayered approach • More complicated devices (hard drives) • Asynchronous I/O operations – Nearly all low-level operations Understanding Operating Systems, 7e 40 File Management • Windows current versions – Designed to be independent of file system on which they operate • Virtual file – Primary file handling concept (current Windows versions) – Programs perform I/O on virtual files • File handles manipulate them – Executive file object representing all I/O sources and destinations Understanding Operating Systems, 7e 41 File Management (cont'd.) • Processes call native file object services to read from or write to file • I/O manager directs virtual file requests – Real files, file directories, physical devices, or other system-supported destinations • File objects – – – – Hierarchical names Protected by object-based security Support synchronization Handled by object services Understanding Operating Systems, 7e 42 File Management (cont'd.) • Opening file – Process supplies file’s name and type of access required • File objects bridge gap – Between physical devices’ characteristics and directory structures, file system structures, and data formats Understanding Operating Systems, 7e 43 File Management (cont'd.) • File object – Memory-based representation of shareable physical resources • Contains only data unique to an object handle • File – Contains data to be shared • New file object created with new set of handle-specific attributes – Each time process opens a handle Understanding Operating Systems, 7e 44 (figure14.8) Illustrations of a file object, its attributes, and the services that operate on them. The attributes are explained in Table 14.3. © Cengage Learning 2014 Understanding Operating Systems, 7e 45 File Management (cont'd.) (table 14.3) Description of the attributes shown in Figure 14.8. © Cengage Learning 2014 Understanding Operating Systems, 7e 46 File Management (cont'd.) • Mapped file I/O: important I/O system feature – Achieved through cooperation between I/O system and VM Manager – Memory-mapped files exploit VM capabilities • Cache manager uses mapped I/O – Manages its memory-based cache • File management system – Supports long filenames • Include spaces and special characters – Automatically shortens filenames when required Understanding Operating Systems, 7e 47 Network Management • Networking – Integral part of Windows operating system executive – Provides services: user accounts and resource security – Implements communication between computers • Named pipes: provide high-level interface for passing data between two processes (regardless of locations) • Mailslots: provide one-to-many and many-to-one communication mechanisms Understanding Operating Systems, 7e 48 Network Management (cont’d.) • Microsoft Networks (MS-NET) – Released in 1984 – Model for NT Network Manager • Three components – Redirector – Server message block (SMB) protocol – Network server • MS-NET components – Extensively refurbished and incorporated into later Windows versions Understanding Operating Systems, 7e 49 Network Management (cont'd.) • Redirector – – – – Coded in C programming language Implemented as loadable file system driver Not dependent on system’s hardware architecture Function • Direct I/O request from user or application to remote server with appropriate file or resource • Network can incorporate multiple redirectors Understanding Operating Systems, 7e 50 Network Management (cont'd.) • SMB protocol – High-level specification • Formatting messages sent across network – OSI model correlation • Application layer (Layer 7); Presentation layer (Layer 6) – API called NetBIOS interface • Passes I/O requests structured in SMB format to remote computer – SMB protocols and NetBIOS API • Adopted in several networking products before appearing in Windows Understanding Operating Systems, 7e 51 Network Management (cont'd.) • Windows Server operating systems – Written in C • Complete compatibility with existing MS-NET and LAN Manager SMB protocols – Implemented as loadable file system drivers – No dependency on hardware architecture • Where operating system running Understanding Operating Systems, 7e 52 Directory Services • Active Directory – Database storing many information types – General-purpose directory service for heterogeneous network – Built entirely around DNS and LDAP – Groups machines into domains • Each domain gets a DNS domain name (e.g., pitt.edu) • Each domain must have at least one domain controller • Domain can have more than one domain controller – Active Directory clients use standard DNS and LDAP protocols: locate objects on the network Understanding Operating Systems, 7e 53 (figure 14.9) Active Directory clients use standard DNS and LDAP protocols to locate objects on the network. © Cengage Learning 2014 Understanding Operating Systems, 7e 54 Security Management • Windows network operating systems – Provide object-based security model – Security object • Represents any resource in system (file, device, process, program, or user) – Allows administrators to give precise security access • Monitor and record how objects used • Windows biggest concern – Aggressive patch management needed • Combat many viruses and worms Understanding Operating Systems, 7e 55 Security Concerns • U.S. Department of Defense – Identified and categorized seven levels of security features • Class C2 security level compliance – Features in Windows • • • • A secure logon facility Discretionary access control Auditing ability Memory protection Understanding Operating Systems, 7e 56 Security Concerns (cont'd.) • Multilayered security system – First security layer: password management – Second security layer: file access security • Distinguishes between owners and groups • Users decide operation types person is allowed to perform on a file • Gives user auditing capabilities: automatically tracks who uses files and how files used Understanding Operating Systems, 7e 57 Security Terminology • Built-in security – Necessary element for managers of Web servers and networks – Requires authentication mechanism allowing client to prove identity to server • Client supplies authorization information • Server uses information: determines specific access rights given to client – Provides data integrity using various methods • Windows operating systems feature Kerberos security Understanding Operating Systems, 7e 58 Security Terminology (cont'd.) • Kerberos security – Authentication (mutual), data integrity, and data privacy – Each domain has own Kerberos server – Microsoft implemented standard Kerberos protocol – Microsoft separates distributed security services users from their providers • Supports many options without unusable complexity Understanding Operating Systems, 7e 59 Security Terminology (cont'd.) (figure 14.10) Requests from an application flow through these security stops on the way to and from the network. © Cengage Learning 2014 Understanding Operating Systems, 7e 60 User Interface • Windows 8 – Offers same default screen • All devices running the operating system – Laptop or desktop users • Can switch between tile-populated Start screen and Desktop screen • Windows Task Manager – Open: press and hold Ctrl, Alt, and Delete keys together Understanding Operating Systems, 7e 61 (figure 14.13) Using the Task Manager, users can view the system status, assign priorities, and more. © Cengage Learning 2014 Understanding Operating Systems, 7e 62 (figure 14.14) The resource monitor offers running statistics for this session. © Cengage Learning 2014 Understanding Operating Systems, 7e 63 User Interface (cont’d.) • Command-line interface – Available from most Windows desktops – Use Help feature: learn a command’s syntax Understanding Operating Systems, 7e 64 (table 14.4) Selected commands that can be used in the Command Prompt Window. For a complete listing, see your technical documentation or www.microsoft.com. © Cengage Learning 2014 Understanding Operating Systems, 7e 65 User Interface (cont'd.) • Helpful Windows features – Built-in input methods and fonts for many languages • Accommodates users working in non-English languages – Enhanced accessibility options • On-screen keyboard – Other tools: magnifier, a narrator, speech recognition, etc. Understanding Operating Systems, 7e 66 Conclusion • Windows operating systems – Started as a microcomputer operating system – Now includes complex multiplatform software • Run computing systems of all sizes • Windows 8 – Singular interface • Both touch screens and traditional computers • Windows recognized as: – Powerful operating system – Significant market force Understanding Operating Systems, 7e 67