windows 2000 i/o system, cache manager and file systems computing department, lancaster university,...

21
Windows 2000 I/O Windows 2000 I/O System, Cache Manager System, Cache Manager and and File Systems File Systems Computing Department, Computing Department, Lancaster University, UK Lancaster University, UK

Upload: michael-hill

Post on 26-Mar-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

Windows 2000 I/O System, Windows 2000 I/O System, Cache Manager and Cache Manager and

File SystemsFile Systems

Computing Department,Computing Department,

Lancaster University, UKLancaster University, UK

Page 2: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

OverviewOverview

• Goals…Goals…– Overview of I/O SystemOverview of I/O System– Overview of Cache ManagerOverview of Cache Manager– Overview of File SystemsOverview of File Systems

Page 3: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

I/O SystemI/O System

• Design goalsDesign goals– Make I/O processing fast on both single and Make I/O processing fast on both single and

multiprocessor systemsmultiprocessor systems– Protect shareable resources by using standard Protect shareable resources by using standard

Windows 2000 security mechanismsWindows 2000 security mechanisms– Meet requirements for the various sub-systems Meet requirements for the various sub-systems

availableavailable– Provide services to make device driver development Provide services to make device driver development

as easy as possibleas easy as possible– Allow device drivers to be added or removed Allow device drivers to be added or removed

dynamicallydynamically– Provide support for multiple installable file systemsProvide support for multiple installable file systems

Page 4: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

I/O System Components (1)I/O System Components (1)

• The I/O managerThe I/O manager– Connects applications and system components to Connects applications and system components to

virtual, logical and physical devicesvirtual, logical and physical devices

• A device driverA device driver– Typically provides an I/O interface for a particular Typically provides an I/O interface for a particular

type of devicetype of device

• The PnP managerThe PnP manager– Responsible for loading a device driver when a Responsible for loading a device driver when a

device is detecteddevice is detected

• The power managerThe power manager– Guides the system through power-state transitionsGuides the system through power-state transitions

Page 5: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

I/O System Components (2)I/O System Components (2)

• The registryThe registry– Serves as a database that stores a description of basic Serves as a database that stores a description of basic

hardware devices attached to the systemhardware devices attached to the system

• INF filesINF files– Driver installation filesDriver installation files– The link between a particular device, and the driver The link between a particular device, and the driver

that assumes its primary controlthat assumes its primary control

• Hardware Abstraction Layer (HAL)Hardware Abstraction Layer (HAL)– Insulates the drivers from the specifics of the Insulates the drivers from the specifics of the

processor and interrupt controllerprocessor and interrupt controller– Provides APIs that hide the differences between Provides APIs that hide the differences between

platformsplatforms

Page 6: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

I/O OperationsI/O Operations

• Most I/O operations don’t involve all components…Most I/O operations don’t involve all components…• Typical request starts with an app executing an I/O Typical request starts with an app executing an I/O

related function, that is processed by the I/O manager, related function, that is processed by the I/O manager, one or more device drivers and the HALone or more device drivers and the HAL

• The OS abstracts all I/O requests as operations on a The OS abstracts all I/O requests as operations on a virtual file:virtual file:– Hiding the fact that the target might not be a file-structured Hiding the fact that the target might not be a file-structured

devicedevice– Abstraction generalises an application’s interface to devicesAbstraction generalises an application’s interface to devices– All data that is read or written is regarded as a simple stream All data that is read or written is regarded as a simple stream

of bytes directed to these filesof bytes directed to these files– The I/O manager dynamically directs these virtual file The I/O manager dynamically directs these virtual file

requests to the appropriate device driverrequests to the appropriate device driver

Page 7: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

Flow of a Typical I/O Flow of a Typical I/O RequestRequest

I/O Subsystem API

I/O Manager

Kernel modedevice drivers

HAL I/O access routines

User-mode API

Driversupportroutines

Page 8: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

Types of Device DriversTypes of Device Drivers

• File system driversFile system drivers– Accept I/O requests to filesAccept I/O requests to files

• Windows 2000 driversWindows 2000 drivers– Include drivers for mass storage devices, net. adaptorsInclude drivers for mass storage devices, net. adaptors

• Legacy driversLegacy drivers– Written for NTWritten for NT

• Display driversDisplay drivers– Translate device-independent graphics requests to Translate device-independent graphics requests to

device-specific requestsdevice-specific requests

• WDM drivers (Windows Driver Model)WDM drivers (Windows Driver Model)– Includes support for power management, PnP, etc…Includes support for power management, PnP, etc…

Page 9: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

User-mode DriversUser-mode Drivers

• Virtual device drivers (VDDs)Virtual device drivers (VDDs)– Used to emulate 16-bit MS-DOS Used to emulate 16-bit MS-DOS

applicationsapplications

• Printer driversPrinter drivers– Translate device-independent graphics Translate device-independent graphics

requests to printer-specific commandsrequests to printer-specific commands

Page 10: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

Win32 Input/Output APIsWin32 Input/Output APIs

• A few device-independent APIs availableA few device-independent APIs available– CreateFileCreateFile– ReadFile / WriteFileReadFile / WriteFile– CloseHandleCloseHandle

• Many (over 100) device-type-dependent APIsMany (over 100) device-type-dependent APIs– diskdisk– tapetape– consoleconsole– pipespipes– sound cardssound cards– etc…etc…

Page 11: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

Device and File NamingDevice and File Naming

• File namesFile names– \\.\disk\directory\…\file\\.\disk\directory\…\file– \\server\disk\directory\…\file\\server\disk\directory\…\file

• Local device namesLocal device names– \\.\name-of-device\\.\name-of-device

• Remote device names; Universal Name ConventionRemote device names; Universal Name Convention– \\server\name-of-shared-resource\\server\name-of-shared-resource

• DOS-style built-in device names for compatibilityDOS-style built-in device names for compatibility– A:, B:, D: etc…A:, B:, D: etc…

• Windows 2000 internal name differ from externally Windows 2000 internal name differ from externally visible names…visible names…

Page 12: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

Overview of Cache ManagerOverview of Cache Manager

• What is the cache manager?What is the cache manager?– ““A set of kernel-mode functions and system threads that cooperate A set of kernel-mode functions and system threads that cooperate

with the memory manager to provide data caching for all Windows with the memory manager to provide data caching for all Windows 2000 file system drivers”2000 file system drivers”

• Most OS‘s rely on each individual file system to cache dataMost OS‘s rely on each individual file system to cache data– Duplicate caching / memory management codeDuplicate caching / memory management code– Limitations on the kinds of data that can be cachedLimitations on the kinds of data that can be cached

• Windows 2000 facilitates the caching of all externally stored Windows 2000 facilitates the caching of all externally stored data:data:– Whether on local hard disks, floppy disks, network file servers, Whether on local hard disks, floppy disks, network file servers,

CD-ROMsCD-ROMs

• Any kind of data can be cached:Any kind of data can be cached:– User data streams (the contents of a file, + on-going r/w)User data streams (the contents of a file, + on-going r/w)– File system metadata (e.g. directory and file headers)File system metadata (e.g. directory and file headers)

Page 13: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

Cache Manager Key Cache Manager Key FeaturesFeatures• Supports all file system typesSupports all file system types

– Removes the need for each file system to implement its Removes the need for each file system to implement its own cache management codeown cache management code

• Uses the memory manager to control what parts of Uses the memory manager to control what parts of the files are in physical memory (see next slide)the files are in physical memory (see next slide)– Allowing a trade-off for physical memory between user Allowing a trade-off for physical memory between user

processes and the OSprocesses and the OS

• Caches data on a “virtual block” basisCaches data on a “virtual block” basis– In contrast to most caching systems, which cache on a In contrast to most caching systems, which cache on a

logical block basis logical block basis provides “fast I/O” intelligent read-ahead and high-speed provides “fast I/O” intelligent read-ahead and high-speed

access to the cache without involving file-system driversaccess to the cache without involving file-system drivers

Page 14: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

Interaction Between the Interaction Between the Cache and the Memory Cache and the Memory ManagerManager• Unusual aspect: Cache manager never actually Unusual aspect: Cache manager never actually

knows how much cached data is in physical knows how much cached data is in physical memory!memory!

• This is because it maps views of files into system This is because it maps views of files into system virtual address spacesvirtual address spaces– The memory manager then pages in blocks that aren’t in The memory manager then pages in blocks that aren’t in

physical memory, and pages data out too…physical memory, and pages data out too…

• The approach avoids the cache manager The approach avoids the cache manager generating read or write I/O request packets to generating read or write I/O request packets to access the data for files it’s cachingaccess the data for files it’s caching– Instead, it copies data from the virtual address of where Instead, it copies data from the virtual address of where

the portion of the file is, and relies on the memory the portion of the file is, and relies on the memory manager to fault in the data, if needed…manager to fault in the data, if needed…

Page 15: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

Overview of File SystemsOverview of File Systems

• NTFS – native file system format for NTFS – native file system format for Win2000Win2000

• Also includes support for:Also includes support for:– CDFSCDFS– UDFUDF– FAT12, FAT16 and FAT32FAT12, FAT16 and FAT32

Page 16: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

CDFS File SystemCDFS File System

• CD-ROM file system – simple format CD-ROM file system – simple format defined in 1998 as the read-only defined in 1998 as the read-only formatting standard for CDformatting standard for CD

• Format has a number of restrictionsFormat has a number of restrictions– Directory and file names must be fewer than Directory and file names must be fewer than

32 characters long32 characters long– Directory trees can be no more than eight Directory trees can be no more than eight

levels deeplevels deep

• Now considered legacy…. because of…Now considered legacy…. because of…

Page 17: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

UDF File SystemUDF File System

• Format replacing CDFS for optical storage Format replacing CDFS for optical storage mediamedia– DVD-ROM in mind…DVD-ROM in mind…

• Designed with rewritable media in mind, Designed with rewritable media in mind, Windows 2000 UDF driver only provides Windows 2000 UDF driver only provides read-only support read-only support

• File systems have the following “features”:File systems have the following “features”:– Filenames can be 255 characters longFilenames can be 255 characters long– Maximum path length is 1023 charactersMaximum path length is 1023 characters– Filenames can be upper and lower caseFilenames can be upper and lower case

Page 18: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

FAT12, FAT16 and FAT32FAT12, FAT16 and FAT32

• Supported to enable upgrades from other Supported to enable upgrades from other versions of Windows, and for compatibility with versions of Windows, and for compatibility with other OS‘s, and for use as a floppy disk formatother OS‘s, and for use as a floppy disk format

• 12, 16 and 32 represent the number of bits the 12, 16 and 32 represent the number of bits the format uses to identify clusters on a diskformat uses to identify clusters on a disk

• Windows 2000 uses cluster sizes of 512 bytes to Windows 2000 uses cluster sizes of 512 bytes to 8 KB in size, limiting a FAT12 volume to 32MB8 KB in size, limiting a FAT12 volume to 32MB– Windows 2000 uses FAT12 as the format for floppy Windows 2000 uses FAT12 as the format for floppy

disksdisks

• FAT32 (most recently defined)FAT32 (most recently defined)– Used in Win95 (OSR2), Win98 and Win MillenniumUsed in Win95 (OSR2), Win98 and Win Millennium

Page 19: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

NTFSNTFS

• Uses 64-bit cluster indexesUses 64-bit cluster indexes

• NTFS has the ability to address NTFS has the ability to address volumes up to 16 exabytes (16 volumes up to 16 exabytes (16 million GB)million GB)

• Windows 2000 limits the size of an Windows 2000 limits the size of an NTFS volume to that addressable NTFS volume to that addressable using 32-bit clustersusing 32-bit clusters– 128 TB (using 64KB clusters)128 TB (using 64KB clusters)

Page 20: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

NTFS Advanced Features (1)NTFS Advanced Features (1)

• RecoverabilityRecoverability– File system “structures” can be repaired to a File system “structures” can be repaired to a

consistent state (no loss of file or directory structure consistent state (no loss of file or directory structure info – file data can be lost)info – file data can be lost)

• File and directory securityFile and directory security– Files and directories are protected from Files and directories are protected from

unauthorised access using a combination of a unauthorised access using a combination of a security ID (stored as part of the file) and the security ID (stored as part of the file) and the password entered…password entered…

• File compressionFile compression– Transparent to applicationTransparent to application– Directory compression also possibleDirectory compression also possible

Page 21: Windows 2000 I/O System, Cache Manager and File Systems Computing Department, Lancaster University, UK

NTFS Advanced Features (2)NTFS Advanced Features (2)

• Disk quotasDisk quotas– Per-user volume quotasPer-user volume quotas– NTFS tags files and directories with the security NTFS tags files and directories with the security

ID of the user who created them…ID of the user who created them…

• EncryptionEncryption– Supports EFS – Encrypting File SystemSupports EFS – Encrypting File System– Transparent to applicationTransparent to application– Files are accessed using using the private key Files are accessed using using the private key

of an account’s EFS private / public key pairof an account’s EFS private / public key pair

• etc…etc…