<<

Lecture 23: Windows XP History and Versions

n Mid-80ies and IBM cooperated to develop OS/2 n Windows XP is produced by Microsoft Co. n 1988 - Microsoft started to develop its own new technology (NT) OS n XP is multi-user, multi-, preemptive multitasking OS, 30M lines of capable of running OS/2, Windows and apps. Hired - architect of DEC VAX/VMS to head the design n It is developed to support multiple platforms and targeted towards enterprise workstations and server market as well as n NT v. 3.1 first released commercially July 1993 desktops n NT v 4.0 adopted , graphics code moved into kernel to improve performance n In today’s lecture n 2000 – improved networking and support, support for plug-and- u XP’s predecessors, the history of XP design, XP versions play devices, support for more processors (up to 8) and memory, u design principles becomes true multi-user through terminal server u components n XP (released Oct 2001) – update for 2000 replacement for 95/98 F hardware u simplifies user interface, improved reliability, performance F executive improvements, partial 64-bit support F environmental subsystems n versions F u desktop: XP personal – 95/98 replacement, professional – advanced features like POSIX support, some network features

1 u server: .NET – support for web/print service, clusters, large memory2 and multiple processors

Design goals Components

n XP is -based, modular n security – NT was C-2 certified (US Gov. security classification), extensive code review and testing against defects and n run in protected (kernel) mode attacks u hardware abstraction layer (HAL) - hides hardware differences from n reliability – stringent reliability requirements, automatic and manual upper layers; supports multiprocessors code review and testing, 3d party driver testing and certification, u (micro) kernel - never paged out of memory, the execution is never automatic problem reporting to Microsoft preempted, does and synchronization, ; n compatibility – compatible with apps. for 2000 and 95/98 (special u executive - provides other services - management, layer to simulate 98/95), POSIX support for UNIX apps. process management (creating, deleting, using), I/O, local n performance – (non-kernel) thread , optimized locking, procedure call, security reference; A collection of similar services is NUMA and SMP support, kernel-based graphics, optimized I/O, done by a service manager

complex caching n run in user mode n extensibility – environmental subsystems, loadable drivers, modular u environmental subsystems – support code written for different design, RPC support platforms) n portability – most OS code is written in C/C++, most processor- u protection subsystems – provide security functions dependent code is isolated in one module (HAL), tested on multiple architectures – IA32/IA64, K6/7, DEC Alpha

3 4

XP structure Hardware Abstraction Layer (HAL)

n Low-level module that translates low-level OS functions into hardware behaviors

n Comes as a library of functions (HAL.DLL) that are called by other parts of kernel

n example u to install handler OS calls HAL’s function which knows where on this architecture the interrupt table is located and puts a reference to the handler in the table

n HAL provides a fixed set specified set of services that is hardware independent.

n Easy OS porting - only HAL needs to be written for the new architecture

n I/O (and graphics) drivers bypass HAL for performance reasons

5 6 Kernel Kernel (cont.) n Does: thread scheduling, interrupt and exception handling, n synchronization – provides access to mutexes (locks), processor synchronization, recovery after power-failure semaphores as objects n never preempted or paged out n trap ( interrupt) processing n object-oriented - events, threads, interrupts, semaphores, etc. are u asynchronous procedure calls (APC) – “breaks” into an executing objects thread and calls a procedure; used to start new thread execution, terminate process, deliver notification of asynchronous I/O n scheduling: completion u supports real-time applications u u 32-level priority feedback queues divided into 2 classes deferred procedure calls (DPC) – to carry out more extended work than an interrupt service routine (ISR) can do, (to defer the F real-time (16-31) processing), can be scheduled in the context of any processor F variable (0-15) n exceptions and interrupt handling u higher priority threads can preempt lower priority ones u u supports processor affinity for a thread – if a thread is ready to run exceptions (memory-access violation, integer overflow, divide by but the process is not available, the thread is skipped zero, etc.) – in kernel mode: look for handler, if none – fatal system u feedback queues: error; in user: check with environmental sybsystem to see if handler is installed F at the end of time quantum the preempted thread’s priority is lowered (what’s the name of the technique?) u hardware interrupts are abstracted by HAL and mapped into F after the I/O completion the thread’s priority is boosted (?); more standard set (for portability) for mouse and keyboard, less for disk (better response for F per processor interrupt dispatch table is consulted to find an ISR interactive apps.) for each iterrupt 7 8

Executive Virtual memory manager (VM) n contains a number of components: object manager, virtual memory manager, process manager, I/O manager, n part of Executive cache manager, etc. n uses demand paging ( size is 4K on 32-bit processors, and 8K on n object manager: 64bit ones) u maintains OS constructs in the form of objects: n backing store is a paging file on disk F examples: file object, disk object, thread object, process object n 32 bit addresses create 4G user address space u keeps track of what thread is using what object, when object is not u upper 2G - process address space used - destroys it, when new is needed - creates it u lower 2G - identical to all processes, maps to kernel, can be used u provides standard methods of object access (open/close/create…) for shared memory, files in memory, cache u implements security - if thread authorized to access object? u XP can can do quotas on memory usage

n VM uses per-process FIFO page replacement policy

n maintains working set per process - starts with default 50 pages and decreases/increases as necessary

n VM replaces or trims (removes from working set) pages according to their age (estimated in the number of trimming cycles)

n VM pre-fetches continuous pages on page-fault to exploit locality of 9 reference 10

I/O manager Environmental subsystems

n XP is capable of running application written for different n part of Executive platforms due to environmental subsystems n responsible for file system, cache management, device drivers and n an environmental subsystem emulates the system calls and other network drivers platform-dependent peculiarities of the applications n caching: n environmental subsystems u does caching centrally rather than as part of file-system u virtual machine (DVM) allows dos applications to run. XP uses implementation (Unix) 32 bits for memory addresses, DOS uses 16, DVM provides the u cache size can change depending on the amount of free space in translation, multiple DVMs may be running at the same time DOS the system applications running on one DVM do not affect dos applications on u can be mapped directly to process address space another u u breaks cache into 256KB blocks, maintains virtual-address control OS/2 subsystem - runs OS/2 programs bloc (VACB) for each block u POSIX system - runs Unix applications, enforces Unix-like u VACB stores which (and how many) treads are using the block (cf. permissions on directories Unix file handles) u Win32 subsystem - runs Win32 (32 bits for memory address) u cache manager patterns previous three requests and can pre-fetch “native” XP applications, Win32 also manages all keyboard, mouse the data if it guesses the pattern and screen I/O n has a devices stack (STREAMS – like) mechanism to simplify driver development and to incorporate third-party drivers 12 13 NT file system (NTFS) Security subsystem n FAT used in DOS has several shortcomings - 2G limit, lack of access protection for files, etc. n Provides uniform access control facility that applies to n NTFS rather than Unix file system or FAT treats each file as an object processes, files, semaphores, windows, etc.

(rather than a byte-stream) with it’s attributes. n when user logins the first process the user creates is given n Master file table (MFT) - i-node equivalent, 1-4K an access token

u may store data within MFT if file is small n access token indicates which privileges a user may have u data is placed in continuous portions of disk, MFT stores references n child processes inherit parent access token to portions n each object for which interprocess access is possible has security u if file is highly fragmented - single level indirection is used descriptor n directory stores a copy the I-node like info from MFT and maintains B+ tree for directory entries n security descriptor’s main component - access control list - specifies what users /user groups and in what ways can access object n NTFS provides n when process tries to access object the process’ access token is u data compression (the data can be compressed as it is written on disk so as to occupy less space) matched against the access control list of the object’s security descriptor to check if access is allowed u logging - rather than writing directly onto the file system NTFS writes into a log which is then flushed into a file-system periodically at n if access allowed XP caches the resulting access rights checkpoints; in case of system failure the correct state of the file system can be restored based on the information from the log u complex and flexible security protection for every file and directory14 15