Hardware and software setup

View the hierarchical structure of the disk c. Disk structure

Arkhangelsk State University

Kotlas branch

full-time department

Faculty: technical

Specialty: PGS

Course work

Discipline: computer science

Subject: Disk File Structure

Performed

1st year student

Zhubreva Olga

Alexandrovna

Checked:

Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . .

§ 1 The concept of the file system. . . . . . . . . . . . . . . . . . . .

§ 2 MS-DOS file system. . . . . . . . . . . . . . . . . . . .

§ 3 File system Windows 95 . . . . . . . . . . . . . . . . . .

§ 4 Windows NT file system . . . . . . . . . . . . . . . . . .

Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . .

Introduction.

The methodological manual reveals the essence of the concept of “file system”,

which is one of the most important concepts in the course “Software

computer software”, as well as the structure of file systems of such

operating systems like MS-DOS, Windows 95, Windows NT.

An attempt to achieve this goal determines the structure of the present

benefits: the topic material is divided into 4 main parts (parts are presented in

the form of a paragraph), each of the parts is also, as necessary, divided into

smaller detailed parts.

§ 1 The concept of the file system.

1.1. File system definition.

File (in English File) - folder, folder.

A file is a named area of ​​memory on some physical

medium for storing information.

A set of operating system tools that provide access to

information on external media is called a file management system or

file system.

The file system is a functional part of the operating system.

system responsible for exchanging data with external storage

devices.

ORGANIZING ACCESS TO THE FILE

Directory structure

We hope that you have a good idea of ​​organizing the storage of books in

library and, accordingly, the procedure for searching for the desired book by its code from

directory. Transfer your idea of ​​this to the way files are stored

on the disk and the organization of access to it.

Access - the procedure for establishing a connection with the memory and the file placed in it

for writing and reading data.

The name of the logical drive that precedes the file name in the specification,

specifies the logical drive on which to look for the file. On the same disk

a directory is organized in which the full names of files are stored, as well as their

characteristics: date and time of creation;

volume (in bytes); special attributes. Similar to the library system

directory organization the full filename registered in the directory,

will serve as a cipher operating system finds

the location of the file on disk.

Directory - a directory of files indicating their location on the disk.

There are two states of the catalog - current (active) and passive. MS

DOS remembers the current directory on every logical drive.

Current (active) directory - the directory in which the user's work

produced in the current machine time.

Passive directory - a directory with which this moment there is no time

The MS DOS operating system also adopted a hierarchical structure

(fig. 9.1) directory organization. Each disk always has

a single main (root) directory. He is at level 0

hierarchical structure and is denoted by the symbol "\". Root directory

is created during formatting (initialization, partitioning) of a disk, has

limited size and cannot be removed by DOS. In main

directory may include other directories and files that are created by commands

operating system and can be removed with the appropriate commands.

Rice. 9.1. Hierarchical directory organization structure

Parent directory - a directory that has subdirectories. Subdirectory

A directory that is part of another directory.

Thus, any directory containing lower-level directories can

be, on the one hand, in relation to them parental, and on the other hand,

subordinate to the top-level directory. Typically, if this

does not cause confusion, use the term "catalog", implying or

subdirectory, or parent directory depending on the context.

Directories on disks are organized as system files. The only thing

the exception is the root directory, which has a fixed space on

disk. Directories can be accessed just like a regular file.

Note. The directory structure can contain directories that are not

subdirectory names are the same as the file naming conventions (see

subsection 9.1). To be formally distinguished from files, usually subdirectories

assign only names, although you can add a type according to the same rules as

and for files.

Access to the contents of the file is organized from the main directory, through

a chain of subordinate directories (subdirectories) of the i-th level. In catalog

any level can store records for both files and directories

lower level. are called empty.

On fig. 9.2 shows the simplest directory structure, where in the main

catalog 0th

level only records about files, directories of the lower level are stored

does not exist

On fig. 9.3 shows the hierarchical structure of the directory, where in the directories

any level stores records about files and directories of the lower level. And

the transition to the lower-level directory can only be arranged

sequentially through subordinate directories.

Rice. 9.2. The simplest directory structure with no directories

lower level

Rice. 93,.. Typical structure of a directory consisting of directories of the lower

level: three digits are used to designate a lower-level directory:

the first digit indicates the level number; the second is the serial number of this

directory on given level, the third indicates at what level

his name is registered. Each directory has a CAT name with indexes.

For example, CAT342 is the name of a third-level directory that is registered in

second level directory number 4

You cannot move from the main directory directly to a directory, for example, the 5th level.

It is imperative to go through all the previous top-level directories.

The above principle of organizing access to a file through a directory

is the basis of the file system.

The file system is the part of the operating system that manages the layout and

access to files and directories on disk.

Closely related to the concept of a file system is the concept of a disk file structure.

which is understood as how they are placed on the disk: the main directory,

subdirectories, files, operating system, and what are allocated for them

volumes of sectors, clusters, tracks.

Rules for the formation of the disk file structure. When forming a file

disk structure, the MS DOS operating system follows a number of rules:

A file or directory can be registered with the same name in

different directories, but in the same directory only once;

Order of filenames and subdirectories in the parent directory

arbitrary;

The file can be divided into several parts, for which

areas of disk space of the same size on different tracks and

sectors.

Path and invitation

From fig. 9.1 - 9.3 you can see that the file is accessed through the directory

thanks to the name of this file registered in it. If the directory has

hierarchical structure, then the operating system organizes access to the file

depending on the location of the subdirectory in which the name is registered

the desired file.

The file can be accessed in the following way:

If the file name is registered in the current directory, then it is sufficient for

access to the file specify only its name;

If the file name is registered in the passive directory, then being in

current directory, you must specify the path, i.e. chain of subordinates

directories through which the file should be accessed.

Path - a chain of subordinate directories that must be traversed along

hierarchical structure to the directory where the searched file is registered. At

when specifying a path, directory names are written in sequential order and separated

separated by \.

User interaction with the operating system is carried out with

help command line displayed on the display screen. At the beginning

command line always has a prompt that ends with

>. The prompt can display: the name of the current drive, the name of the current

directory, current time and date, path, separator characters.

Operating system prompt - indication on the display screen of information,

indicating the readiness of the operating system to enter user commands.

Example 9.8.

The current drive is floppy drive A,

the current directory is the main directory, as indicated by the \ character.

C:\CAT1\CAT2

The current drive is HDD C. current directory -

catalog of the second level CAT2, included in the catalog of the first level

CAT1, which, in turn, is registered in the main

directory.

There are three options for organizing the access path to the file, depending on

places of registration:

The file is in the current directory (no path). When organizing

to access a file, it is enough to specify its full name;

The file is located in the passive directory of one of the lower levels,

subordinate to the current directory. When organizing access to a file

you must specify a path that lists all directory names

the bottom level that lies in this path (including the directory in which

this file is registered);

the file is in a passive directory on a different branch from

the location of the current hierarchical directory. At

to access the file, you must specify the path, starting with

main directory, i.e. with the \ character. This is explained by the fact that in

hierarchical structure, movement is possible only vertically from above -

Horizontal transitions from directory to directory are not allowed.

the examples below illustrate possible options way.

Example 9.9.

Condition: The file F1.TXT is registered in the current directory of the 1st level K1

hard drive C. Therefore, the prompt C: \ K1 is displayed on the screen

Explanation: in this case there is no path, and to access the file it is enough

specify only its full name F1.TXT

Example 9.10.

Condition: The F1.TXT file is registered in the 2nd level directory of the K2 hard

drive C. The current directory is K1. Therefore, the prompt is displayed on the screen

Explanation: in this case, the path will start from the directory

K1 down through its subordinate directory K2. Therefore, before

the full name of the file indicates the path from the current directory K2

Having become acquainted with the concept of a path, let us return to what was introduced in Sec. 9.1

the concept of a file specification. There is an abbreviated file specification and

the full specification of the file, in the formation of which the path participates. On fig.

9.4 shows variants of the rule for the formation of a file specification.

Rice. 9.4. Specification formats (an optional parameter is specified)

Example 9.12. Short form of file specification C:\KIT.BAS

The file with the BASIC program KIT.BAS is located in the main

hard drive directory.

The full form of the file specification

C:\CAT1\CAT2\WOOK1.TXT

The text file BOOK1.TXT is registered in the directory of the second

CAT2 hard disk level C.

Directory entry structure

Now you have to get acquainted with the structure of the records stored in the directory.

with information about lower-level files and subdirectories.

A file entry in a directory contains the name and type of the file, the size of the file in

bytes, creation date, creation time and a number of other parameters required

operating system for access.

The entry for a lower-level subdirectory in the parent directory contains it

name, attribute, date and time of creation.

Consider the possible options for the contents of the directory. 1st option. In catalog

only records about files are stored (Fig. 9.5). Before file entries

a message about the name of the directory is displayed. In this case, it is the main

floppy disk directory A. A message is displayed at the end of the contents of the directory

the number of files stored on the disk and the free disk space in

bytes. For example, in the above directory, the following message is displayed:

4 file(s) 359560 bytes free

The number of files on the disk. Free

disk space, byte2 option.

The directory stores only entries about lower-level directories (Fig. 9.6).

Rice. 9.7. The main directory contains files and subdirectories

At the end of the directory, as in the previous case, you will see a similar

the volume entry discussed above free space on disk.

3rd option. The directory stores records for both files and directories

lower level (Fig. 9.7). This structure shows that in this directory

there are 3 files and 2 lower level directories BASIC and LEXICON. On disk

free space 2.6575 MB.

The three options for presenting directories discussed above reflect the contents

main directory. Directory structure from level 1 onwards,

is identical and differs from the main one only in that before the entries about files

and directories of the lower level, two entries with ellipsis are placed (Fig. 9.8).

The dots you see at the beginning indicate that the content has been called to the screen.

subdirectory (1st level directory) KNIGA, which contains two text

SVET and TON files.

|Directory of C:\KNIGA| | |

| |11-12-90 |09:40 |

| |10-10-91 |08:30 |

|svet txt 55700 |04-04-90 |10:05 |

|ton txt 60300 |03-05-91 |11:20 |

|2 files 912348 bytes free | | |

| Fig. | 9.8. Structure of entries in the subdirectory |

1.2. FAT file system.

Windows operating systems are used, designed more for

DOS file system FAT, in which for each partition and DOS volume there is

boot sector, and each DOS partition contains two copies of the table

file allocation table (FAT).

FAT is a matrix that sets the ratio

between the files and folders of the partition and their physical location on the hard

In front of each hard disk partition, there are two

FAT copies. Like boot sectors, FAT resides outside

the area of ​​the disk visible to the file system.

When written to disk, files do not necessarily take up space,

equivalent to their size. Usually files are divided into clusters

of a certain size, which can be scattered throughout the section.

As a result, the FAT table is not a list of files and their

locations, but a list of partition clusters and their contents, and at the end

FAT table entries are 12-, 16-, and 32-bit

hexadecimal numbers, the size of which is determined by the FDISK program, and

the value is directly generated by the FORMAT program.

All floppy disks, plus hard drives up to 16 MB

use 12-bit elements in FAT. hard and removable drives having

size of 16 MB or more, usually use 16-bit elements.

The FAT file system was used in all versions of MS-DOS and in the first

two releases of OS/2 (versions 1.0 and 1.1). Each logical volume has

own FAT, which performed two functions: it contained information

allocations for each file in the volume in the form of a list of module links

distributions (clusters) and indicated which distribution modules are free.

When the FAT table was invented, it was an excellent solution for

disk space management, mainly because floppy disks,

on which it was used were rarely more than a few Mb in size.

FAT was small enough to be in memory permanently,

allowed for very fast random access to any part of the

any file.

When FAT was applied to hard drives, it got too big

to reside in memory and degrade system performance.

In addition, since information regarding free disk

space was dispersed "across" a large number of FAT sectors,

it was impractical in allocating file space, and

file fragmentation proved to be an obstacle to high efficiency.

In addition, the use of relatively large clusters on hard

discs led to a large number unused areas, as

on average for each file, half the cluster was wasted.

For several years, Microsoft and IBM have been trying to extend

the life of the FAT file system due to the removal of restrictions on volume sizes,

improving allocation strategies, caching pathnames, and moving

tables and buffers to extended memory. But they can only be considered

as temporary measures because the file system just didn't fit

large random access devices.

§ 2 The file system of the MS-DOS operating system.

One of the concepts of the MS DOS file system is a logical drive.

Logical drives:

DOS, each logical disk is a separate magnetic disk. Each logical

the disk has its own unique name. As a logical drive name

letters of the English alphabet from A to Z (inclusive) are used.

The number of logical disks is therefore no more than 26.

The letters A and B are reserved strictly for the floppy disks available in the IBM PC (

Starting with the letter C, the logical disks (partitions) of the HDD are named (

Winchester).

The figures show an image of a logical disk.

If given by IBM PC has only one FDD, letter B is omitted

Only logical drives A and C can be system drives. File

logical disk structure:

To access information on disk (located in a file), you need to

know the physical address of the first sector, (Nsurfaces+Ntracks+Nsectors),

the total number of clusters occupied by this file, the address of the next

cluster if the file size is larger than the size of one cluster, etc. Everything

it is very vague, difficult and unnecessary.

MS DOS saves the user from such work and does it herself. For

providing access to files - the MS DOS file system organizes and

maintains a specific file structure on a logical drive.

File structure elements:

Starting sector (sector bootstrap, Boot sector),

Data area (remaining free disk space)

These elements are created special programs(under MS DOS environment) in progress

disk initialization.

Start sector (boot sector, Boot sector) :

Here is the information that MS DOS needs to work with the disk:

OS ID (if the disk is a system one),

disk sector size,

The number of sectors in the cluster,

The number of spare sectors at the beginning of the disk,

Number of FAT copies on the disk (standard - two),

The number of items in the directory,

The number of sectors on the disk,

Disk Format Type,

Number of sectors in FAT,

Number of sectors per track,

Number of surfaces

OS bootstrap block,

Behind the starting sector is FAT.

FAT(File Allocation Table) :

The disk data area (see above) is represented in MS DOS as a sequence

numbered clusters.

FAT is an array of elements addressing clusters of the disk's data area.

Each data area cluster corresponds to one FAT entry.

The FAT elements serve as a chain of links to file clusters in the region.

FAT is an extremely important element of the File structure. FAT violations can

lead to complete or partial loss of information on the entire logical drive.

That is why, two copies of FAT are stored on the disk. There are special programs

which monitor the state of the FAT and correct violations.

Root directory:

This is a specific area of ​​the disk that is created during the initialization process.

(formatting) a disk that contains information about files and directories,

stored on disk.

The Root Directory always exists on a formatted drive. On the

There is always only one root directory per drive. Root size

directory for a given disk is a fixed value, so the maximum

the number of files and other (child) directories "attached" to it

(Subdirectories) - strictly defined.

So, summing up all the above, we can conclude MS-DOS - 16-

bit operating system running in real mode of the processor.

§ 4 Operating system file system Windows systems 95.

4.1. Background to the creation of FAT 32.

In the field of personal computers in 1987, a crisis arose.

Features of the FAT file system, developed by Microsoft for ten

years before for the Standalone Disk Basic interpreter and later

adapted for the DOS operating system have been exhausted. FAT

intended for hard drives capacity not exceeding 32 MB, and new HDDs

larger capacities turned out to be completely useless for PC users.

Some ISVs have come up with their own solutions

this problem, however, only with the advent of DOS 4.0 this crisis was overcome -

for a while.

Significant file system structure changes in DOS 4.0

allowed the operating system to work with disks up to 128 MB; With

with subsequent minor additions, this limit was raised to

2 GB. At the time, this amount of memory seemed to exceed any

imagined needs. However, if the history of personal computers is something

and taught, then precisely that the capacity, "exceeding any conceivable

needs", very quickly becomes "almost insufficient for serious

works". Indeed, hard drives are currently commercially available.

capacity, usually 2.5 GB and above, and sometime very high and

the ceiling of 2 GB that freed us from restrictions has turned into another

an obstacle to be overcome.

4.2. Description FAT32.

For Windows 95 systems, Microsoft has developed a new extension

system FAT - FAT32, without any loud statements provided in

OEM Service Pack 2.

The FAT32 system is only installed in new PCs, so don't count on

get it when you go to new version Windows 95, although, according to

Microsoft, this extension will become integral part main package for

Windows upgrades

4.2.1. Disk areas

This file system provides a number of special areas on

disk allocated to organize disk space during its

formatting - boot head record, disk partition table, record

boot, file allocation table (from which the FAT system got its

title) and root directory.

On the physical level disk space is split into 512-bytes

areas called sectors. V FAT system file space allocated

blocks, which consist of an integer number of sectors and are called clusters.

The number of sectors in a cluster must be a multiple of a power of two. At Microsoft

these clusters are called allocation units, and in

SCANDISK report indicates their size, for example "16 384 bytes in each

allocation unit".

4.2.2. FAT chain

FAT is a database linking clusters of disk

file spaces. This database provides for each cluster

only one element. The first two elements contain information about the

FAT system. The third and subsequent elements are matched

disk space clusters, starting with the first cluster allocated

for files. FAT entries can contain several special values,

indicating that

The cluster is free, i.e. not used by any file;

A cluster contains one or more sectors with physical defects and

should not be used;

This cluster is the last cluster of the file.

For any element used by the file but not the last cluster

FAT contains the number of the next cluster occupied by the file.

Each directory - regardless of the root or subdirectory - also

is a database. In the DOS directory for each file

there is one master record (B Windows environment 95 for long names

files have additional entries). Unlike FAT, where each element

consists of a single field, entries for a file in a directory consist of

multiple fields. Some fields - name, extension, size, date and time -

can be displayed with the DIR command. But the FAT system provides

the field that is not displayed by the DIR command is the field with the number of the first

cluster allocated for the file.

When a program sends a request to the operating system, with

a requirement to provide it with the contents of some file the OS is viewing

directory entry for it to find the first cluster of that file. Then she

accesses the FAT entry for the given cluster to find the next

cluster in the chain. Repeating this process until the last

file cluster, the OS determines exactly which clusters belong to a given

file and in what order. In this way, the system can provide

program any part of the requested file. This way of organizing

file is called the FAT chain.

In the FAT system, files are always allocated an integer number of clusters. At 1.2-

GB hard drive with 32 KB clusters in the directory can be specified,

that the size of a text file containing the words "hello, world" is

only 12 bytes, but in fact this file takes up 32 KB of disk

space. The unused part of the cluster is called wasted space

(slack). In small files, almost the entire cluster can be lost

place, and the average loss is half the size of the cluster.

On an 850 MB hard drive with 16 KB clusters at medium size

files of the order of 50 KB about 16% of the disk space allocated for files

space will be wasted on unused but allocated files

One way to free up disk space is with

disk compression programs such as DriveSpace, which highlights "lost

places" for use by other files.

4.2.3. Other changes to FAT32

In order to be able to work with an increased number of clusters, in

directory entries for each file must be allocated 4 bytes for the initial

file cluster (instead of 2 bytes in the FAT16 system). Traditionally, each entry in

directory consists of 32 bytes (Fig. 1). In the middle of this record, 10 bytes are not

are used (bytes 12 to 21) that Microsoft has reserved for

their own needs in future. Two of them are now assigned as

additional bytes needed to indicate the initial cluster in the system

The operating system has always provided for the presence on the disk of two

FAT instances, but only one of them was used. With the transition to FAT32

the operating system can run on any of these copies. One more

the change is that the root directory, which used to have a fixed

size and a strictly defined disk space, now you can freely

grow as needed like a subdirectory. Now does not exist

restrictions on the number of entries in the root directory. This is especially important

since there are multiple entries under each long filename

directory.

The combination of a relocatable root directory and the ability

using both copies of the FAT is a good prerequisite for unhindered

dynamically resizing disk partitions, such as shrinking a partition

to free up space for another operating system. This new

less risky approach than ISV programs

to change disk partitions when working with FAT16.

From all of the above, we can conclude:

MS-DOS was a pure 16-bit operating system and ran in

real mode of the processor. V Windows versions 3.1 part of the code was 16-

bit, and part - 32-bit. Windows 3.0 supported real mode

processor operation, when developing version 3.1, it was decided to abandon it

support.

Windows 95 is a 32-bit operating system that

bit code for compatibility with MS-DOS mode. Windows 95 32-bit

bit code.

§ 5 The file system of the Windows NT operating system.

5.1. Brief description of the Windows NT operating system.

At the moment the world computer industry develops very

rapidly. System performance increases, and therefore

increasing the ability to process large amounts of data.

Operating systems of the MS-DOS class can no longer cope with this

data flow and cannot fully use the resources of modern

computers. Therefore, recently there has been a transition to more powerful and

the most advanced operating systems of the UNIX class, an example of which is

is Windows NT released by Microsoft Corporation

When the user first sees the Microsoft operating system

Windows NT, he is struck by a distinct resemblance to

favorite interface of the Windows 3.+ system. However, this is a visible similarity

is only a minor part of Windows NT.

Windows NT is a 32-bit operating system with

priority multitasking. As fundamental components

The operating system includes security features and

developed network service.

Windows NT also provides compatibility with many other

operating and file systems, as well as networks.

As shown in the following figure, Windows NT is

modular (more advanced than monolithic) operating system that

consists of separate interconnected relatively simple modules.

Main Windows modules NT are (listed in order

from the lower level of the architecture to the upper one): level

hardware abstractions HAL (Hardware Abstraction Layer), kernel (Kernel),

executive system (Executive), protected subsystems (protected

subsystems) and environment subsystems.

Modular Windows structure NT

5.2. Windows NT file system.

When Windows NT first came out, it provided

support for three file systems. This is the file allocation table (FAT),

providing compatibility with MS-DOS, an enhanced file system

performance (HPFS), which provided compatibility with LAN Manager, and

a new file system called the New Technologies File System

NTFS had a number of advantages over those used on

that moment for most fileserver filesystems.

To ensure data integrity, NTFS has a transaction log.

This approach does not exclude the possibility of information loss, however,

greatly increases the likelihood that access to file system

will be possible even if the integrity of the system is violated

server. This is made possible by using the transaction log for

tracking pending attempts to write to disk on subsequent boot

Windows NT. The transaction log is also used to check the disk for

presence of errors instead of checking each file, in case of using

file allocation tables.

One of the main advantages of NTFS is security. NTFS

provides the ability to make access control entries (Access Control

Entries, ACE) to the Access Control List (ACL). ACE

contains the identification name of a group or user and an access token,

which can be used to restrict access to a particular

directory or file. This access may include the ability to read,

writing, deleting, executing and even owning files.

On the other hand, an ACL is a container containing one

or more ACEs. This allows you to restrict access to individual

users or user groups to specific directories or files in

In addition, NTFS supports working with long names that have

up to 255 characters long and containing uppercase and lowercase letters in any

sequences. One of the main characteristics of NTFS is

automatic generation of equivalent names compatible with MS-DOS.

NTFS also has a compression feature, first introduced in the NT version.

3.51. It provides the ability to compress any file, directory or disk

NTFS. Unlike MS-DOS compression programs that create a virtual disk,

having the form of a hidden file and compressing all data on this disk,

Windows NT uses an additional file subsystem layer for compression

and decompressing the required files without creating virtual disk. This

turns out to be useful when compressing either a certain part of the disk (for example,

user directory), or files of a certain type

(for example, graphic files). The only disadvantage of NTFS compression

is low, in comparison with MS-DOS compression schemes, the level

compression. But NTFS is more secure and

performance.

So, from the above, we can conclude:

To be compatible with various operating systems, Windows

NT contains the FAT 32 file system. In addition, Windows NT contains its own

own NTFS file system, which is not compatible with FAT 16. This

The file system has a number of advantages over FAT, as well as

has higher reliability and performance.

Conclusion.

MS-DOS - 16-bit operating system, runs in real

processor mode. In versions of Windows 3.1, some of the code is 16-bit and some

32-bit. Windows 3.0 supported the real mode of the processor,

when developing version 3.1, it was decided to abandon its support.

Windows 95 is a 32-bit operating system that

only works in protected processor mode. Core including control

memory and process scheduling, contains only 32-bit code. This

reduces costs and speeds up work. Only some modules have 16-

bit code for compatibility with MS-DOS mode. On Windows 95 32-bit

code is used wherever possible to ensure

increased reliability and fault tolerance of the system. In addition, for

compatibility with legacy applications and drivers used and 16-

bit code.

The Windows NT system is not a further development of the earlier

existing products. Its architecture was created from scratch, taking into account

requirements for a modern operating system. striving

ensure compatibility (compatible) of the new operating system,

Windows NT developers have retained the familiar Windows interface and implemented

support for existing file systems (such as FAT) and various

applications (written for MS-Dos, Windows 3.x). Developers also

included in Windows NT tools for working with various network

means.

Reliability and robustness

provide architectural features that protect application

programs from being damaged by each other and by the operating system. Windows NT

uses fault-tolerant structured exception handling on

all architectural levels, which includes a recoverable file

NTFS system and provides protection through the built-in system

security and improved memory management techniques.

About files and file structures

What is a file

Information on external media is stored as files. Working with files is a very important type of work on a computer. Everything is stored in files: and software, and information required by the user. With files, as with business papers, you constantly have to do something: copy them from one medium to another, destroy unnecessary ones, create new ones, search for them, rename them, arrange them in one order or another, etc.

File- this is information stored on external media and united by a common name.

To clarify the meaning of this concept, it is convenient to use the following analogy: the information carrier itself (disk) is similar to a book. We talked about the fact that a book is an external memory of a person, and a magnetic disk is an external memory of a computer. The book consists of chapters (stories, sections), each of which has a title. Also, the files have their own names. They are called filenames. At the beginning or at the end of the book there is usually a table of contents - a list of chapter titles. The disk also has such a directory list containing the names of the stored files.

The directory can be displayed to see if there is this disk the desired file.

Each file contains a separate information object: document, article, numeric array, program, etc. The information contained in the file becomes active, i.e., can be processed by a computer, only after it is loaded into RAM.

Any user working on a computer has to deal with files. Even in order to play a computer game, you need to find out in which file its program is stored, be able to find this file and initialize the program.

Working with files on a computer is done using the file system. File system- This is a functional part of the OS that provides operations on files.

To find the desired file, the user must know: a) what is the name of the file; b) where the file is stored.

File name

In almost all operating systems, the file name is composed of two parts, separated by a dot. For instance:

To the left of the dot is the actual file name (mu-prog). The part of the name following the dot is called the file extension (pas). Usually, Latin letters and numbers are used in file names. On most operating systems, the maximum extension length is 3 characters. In addition, the file name may not have an extension. In the Windows operating system, Russian letters are allowed in file names; the maximum name length is 255 characters.

The extension specifies what kind of information is stored in the file. For example, the txt extension usually stands for text file(contains text); rx extension - graphic file(contains picture), zip or gag - archive file(contains an archive - compressed information), pas - a Pascal program.

Logical drives

There can be several disk drives on one computer - devices for working with disks. Each drive is assigned a one-letter name (followed by a colon), such as A:, B:, C:. Often on personal computers, a large capacity disk built into system unit(it is called a hard disk), divided into sections. Each of these partitions is called a logical drive and is named C:, D:, E:, etc. The names A: and B: usually refer to small removable disks - floppy disks (floppies). They can also be considered as disk names, only logical ones, each of which completely occupies a real (physical) disk. Therefore, A:, B:, C:, D: are all names of logical drives.

The name of the logical drive containing the file is the first "coordinate" that specifies the location of the file.

Disk file structure

The whole set of files on the disk and the relationships between them is called file structure. Various OS may support different organizations file structures. There are two types of file structures: simple, or single-level, and hierarchical - multi-level.

Single-level file structure is a simple sequence of files. To find a file on a disk, it is enough to specify only the file name. For example, if the file tetris.exe is located on drive A:, then its "full address" looks like this:

Operating systems with a single-level file structure are used on the simplest educational computers equipped only with floppy disks.

Layered file structure- a tree-like (hierarchical) way of organizing files on a disk. To facilitate understanding of this issue, we will use the analogy with the traditional "paper" way of storing information. In such an analogy, the file is presented as some titled document (text, drawing) on ​​paper sheets. The next largest element of the file structure is called catalog. Continuing the "paper" analogy, we will represent the directory as a folder in which you can put a lot of documents, i.e. files. The directory also gets its own name (imagine that it is written on the cover of the folder).

A directory can itself be part of another directory external to it. This is similar to how a folder is nested inside another larger folder. Thus, each directory can contain many files and subdirectories (called subdirectories) within it. The top-level directory that is not nested under any other directory is called the root directory.

In the Windows operating system, the term "folder" is used to denote the concept of "directory".

A graphic representation of a hierarchical file structure is called a tree.

On fig. 2.9 directory names are written in capital letters, and files - lowercase. Here in the root directory there are two folders: IVANOV and PETROV and one file fin.com. The IVANOV folder contains two subfolders PROGS and DATA. The DATA folder is empty; there are three files in the PROGS folder, and so on. In the tree, the root directory is usually represented by the symbol \.

The path to the file

Now imagine that you need to find a specific document. To do this, you need to know the box in which it is located, as well as the "path" to the document inside the box: the entire sequence of folders that you need to open in order to get to the papers you are looking for.

The second coordinate that determines the location of the file is path to file on disk. A file path is a sequence of directory names starting from the root directory and ending with the one in which the file is directly stored.

Here is a familiar fairy tale analogy for the concept of "path to a file": "A chest is hanging on an oak tree, a hare is in the chest, a duck is in the hare, an egg is in the duck, a needle is in the egg, at the end of which is Koshcheev's death."

Sequentially written logical drive name, file path and file name are full file name.

If shown in Fig. 2.9 file structure is stored on the C: drive, then the full names of some of the files included in it in the symbols of the MS-DOS and Windows operating systems look like this:

C:\IVANOV\PROGS\progl.pas

C:\PETROV\DATA\task.dat

File Allocation Table

Information about the file structure of the Disk is contained on the same disk in the form of a file allocation table. Using the OS file system, the user can sequentially view the contents of directories (folders) on the screen, moving up or down the file structure tree.

On fig. 2.10 shows an example of displaying a directory tree on the logical drive E: on the computer screen (left window).

The right window shows the contents of the ARCON folder. ") then a set of files of various types. From here, for example, it is clear that the full name of the first file in the list is as follows:

E:\GAME\GAMES\ARCON\dos4gw.exe

From the table you can get additional information about the files. For example, dos4gw.exe is 254,556 bytes in size and was created on May 31, 1994 at 2:00 AM.

Finding in such a list an entry about desired file, using OS commands, the user can perform various actions with it: initialize the program contained in the file; delete, rename, copy file. You will learn how to perform all these operations in a practical lesson.

Questions and tasks

    1. What is the name of the operating system used in your computer class?
    2. What file structure is used by the operating system on your computers (simple, multi-level)?
    3. How many physical drives do your computers have? How many logical drives are there on the physical drives, and what are their operating system names?
    4. What are the rules for file names in your OS?
    5. What is the path to the file on the disk, the full file name?
    6. Learn (with the guidance of a teacher) to view on-screen directories of disks on your computers.
    7. Learn how to initialize programs from program files(like exe, com).
    8. Learn to perform basic file operations in your OS (copy, move, delete, rename files).

User interface

Friendly user interface

And now get acquainted with the concept of "user interface" that is new to you.

Developers of modern software are trying to make the user's work at the computer convenient, simple, visual. The consumer qualities of any program are largely determined by the convenience of its interaction with the user.

The form of interaction between a program and a user is called user interface. A user-friendly form of interaction is called a friendly user interface.

Object Oriented Interface

Interface of modern system and application programs is called the object-oriented interface. An example of an operating system that implements an object-oriented approach is Windows.

The operating system works with a variety of objects, which include: documents, programs, drives, printers and other objects that we deal with while working in the operating system.

Documents contain some information: text, sound, pictures, etc. Programs are used to process documents. Individual programs and documents are inextricably linked: text editor works with text documents, graphics editor - with photos and illustrations, sound processing program allows you to record, correct and listen to sound files.

Documents and programs are information objects. And objects like disk drives and printers are hardware (physical) objects. The operating system associates with the object:

    graphic designation;

    properties;

    behavior.

In the interface of the operating system, icons (they are also called pictograms, icons) and names are used to designate documents, programs, devices. The name and icon make it easy to distinguish one object from another (Figure 2.11).

Each object has a specific set of properties associated with it and a set of actions that can be performed on the object.

For example, the properties of a document are its location in the file structure and its size. Actions on the document: open (view or listen), rename, print, copy, save, delete, etc.

Context menu

The operating system provides the same user interface when working with different objects. In the Windows operating system, to get acquainted with the properties of an object and possible actions with it, the context menu is used (Fig. 2.12) (to call the context menu, select the object icon and click right click mice).

Menu- This is a list displayed on the screen from which the user can select the item he needs.

Rice. 2.12. Document context menu

In the menu in Fig. 2.12 all paragraphs, except for the last one, refer to actions that can be performed with a document. The desired menu item is selected using the cursor keys or a manipulator (for example, a mouse). If you select the "Properties" menu item, then the list of properties of this object will be displayed on the screen.

Questions and tasks

    1. What is the user interface?
    2. What characterizes an object (in terms of an object-oriented approach)?
    3. How can you find out the properties of an object or perform an action on it?


Working with files is a very important type of work on a computer. Everything is stored in files: both software and information necessary for the user. With files, as with business papers, you constantly have to do something: copy them from one medium to another, destroy unnecessary ones, create new ones, search for them, rename them, arrange them in one order or another, etc.

To clarify the meaning of the concept of a file, it is convenient to use the following analogy: the storage medium itself (for example, a disk) is similar to a book. We talked about the fact that a book is an external memory of a person, and a magnetic disk is an external memory of a computer. The book consists of chapters (stories, sections), each of which has a title. Also, the files have their own names. They are called filenames. At the beginning or at the end of the book there is usually a table of contents - a list of chapter titles. The disk also has such a directory list containing the names of the stored files.

The directory can be displayed to see if the desired file is on the given disk.

Each file contains a separate information object: a document, an article, a numerical array, a program, etc. The information contained in the file becomes active, i.e., can be processed by a computer only after it is loaded into RAM.

To find the desired file, the user must know: a) what is the name of the file; b) where the file is stored.

File name

Here is an example of a filename* (* The following examples are based on the rules used in Microsoft operating systems: MS-DOS and Windows. Linux OS applications are also illustrated.):

To the left of the dot is the actual file name (myprog). The part of the name following the dot (pas) is called file extension. Usually, Latin letters and numbers are used in file names. In addition, the file name may not have an extension. In operating system Microsoft Windows Russian letters are allowed in file names; the maximum name length is 255 characters.

The extension specifies what kind of information is stored in the file. For example, the txt extension usually denotes a text file (contains text), the pcx extension - a graphic file (contains a picture), zip or gag - an archive file (contains an archive - compressed information), pas - a Pascal program.



Logical drives

There can be several disk drives on one computer - devices for working with disks. Often on a personal computer, a large-capacity hard disk built into the system unit is divided into sections. Each of these partitions is called a logical drive and is assigned a one-letter name (followed by a colon) C:, D:, E:, etc. The names A: and B: usually refer to small removable disks - floppy disks (floppy disks) . They can also be considered as the names of logical drives, each of which completely occupies a real (physical) drive * (* On modern models PC flexible magnetic disks out of use). Therefore, A:, B:, C:, D: are all names of logical drives.

The optical drive is assigned the next name in alphabetical order after the last name. partition hard disk. For example, if the hard drive has partitions C: and D:, then the name E: will be assigned to the optical drive. And when you connect a flash memory, the F: drive will also appear in the list of logical drives.

The name of the logical drive containing the file is the first "coordinate" that specifies the location of the file.

Disk file structure

Modern operating systems support layered file organization on disk devices Oh external memory - hierarchical file structure. To facilitate understanding of this issue, we will use the analogy with the traditional "paper" way of storing information. In such an analogy, the file is presented as some titled document (text, drawing) on ​​paper sheets. The next element of the file structure is called catalog. Continuing the "paper" analogy, we will represent the directory as a folder in which you can put a lot of documents, i.e. files. The directory also gets its own name (imagine that it is written on the cover of the folder).



A directory can itself be part of another directory external to it. This is similar to how a folder is nested inside another larger folder. Thus, each directory can contain many files and subdirectories (called subdirectories) within it. The top-level directory that is not nested under any other directory is called the root directory.

In the Windows operating system, the term "folder" is used to denote the concept of a "directory".

A graphic representation of a hierarchical file structure is called tree.

On the tree, the root directory is usually represented by the symbol \. In Figure 2.10, directory names are written in uppercase letters, and files are written in lowercase. Here in the root directory there are two folders: IVANOV and PETROV and one file fin.com. The IVANOV folder contains two subfolders PROGS and DATA. The DATA folder is empty; there are three files in the PROGS folder, and so on.

The path to the file

Now imagine that you need to find a specific document. To do this, in the "paper" version, you need to know the box in which it is located, as well as the "path" to the document inside the box: the entire sequence of folders that you need to open in order to get to the papers you are looking for.

To find a file on a computer, you need to know the logical drive where the file is located and the path to the file on the drive, which specifies the location of the file on that drive. A file path is a sequence of directory names starting from the root directory and ending with the one in which the file is directly stored. Here is a familiar fairy-tale analogy for the concept of “path to a file”: “A chest hangs on an oak tree, a hare in a chest, a duck in a hare, an egg in a duck, a needle in the egg, at the end of which is Koshcheev’s death.”

Finally, you need to know the name of the file. Sequentially written logical drive name, file path and file name are full file name.

If shown in Fig. 2.10 the file structure is stored on the C: drive, then the full names of some of the files included in it in the symbols of the operating Microsoft systems Windows looks like this:

C:\IVANOV\PROGS\progl.pas

C:\PETROV\DATA\task.dat

Viewing the File Structure

The operating system provides the user with the ability to view the contents of directories (folders) on the screen.

Information about the file structure of a disk is contained on the same disk in the form of a file allocation table. Using the OS file system, the user can sequentially view the contents of directories (folders) on the screen, moving up or down the file structure tree.

Figure 2.11 shows an example of displaying a directory tree on a computer screen in Windows.

The right window shows the contents of the ARCON folder. This is a lot of files of various types. From here, for example, it is clear that the full name of the first file in the list is as follows:

E:\GAME\GAMES\ARCON\dos4gw.exe

From the table you can get additional information about the files. For example, dos4gw.exe is 254,556 bytes in size and was created on May 31, 1994 at 2:00 AM.

Having found an entry about the desired file in such a list, using OS commands, the user can perform various actions with the file: execute the program contained in the file; delete, rename, copy file. You will learn how to perform all these operations in a practical lesson.

Briefly about the main

A file is a named area of ​​a computer's external memory.

All necessary actions on files are provided by the operating system.

The file name consists of the actual name and extension. The extension indicates the type of information in the file (file type).

Hierarchical file structure - a multi-level organization of files on disks.

A directory is a named list of files and subdirectories (subdirectories). The top-level directory is called the root directory. It is not nested in any directories.

The full file name consists of the name of the logical drive, the path to the file on the drive, and the file name.

Questions and tasks

1. What is the name of the operating system used in your computer class?

2. How many physical drives do your computers have? How many logical drives are there on the physical drives, and what are their operating system names?

3. What are the rules for file names in your OS?

4. What is the path to the file on the disk, the full file name?

5. Learn (with the guidance of a teacher) to view on-screen directories of disks on your computers.

6. Learn how to initialize programs from program files (such as exe, honeycombs).

7. Learn to perform basic file operations in your OS (copy, move, delete, rename files).

EC CER: Part 1, Chapter 2, § 11. CER No. 1.9.

User interface

The main topics of the paragraph:

friendly user interface;

object-oriented interface; objects;

context menu.

Users refer to files by symbolic names. However, the capacity of human memory limits the number of object names that a user can refer to by name. The hierarchical organization of the namespace allows you to significantly expand these boundaries. This is why most filesystems have a hierarchical structure in which levels are created by allowing a lower-level directory to be contained within a directory of more high level(Fig. 19).

Rice. 19. Hierarchy of file systems:

a - single-level organization; b - tree; c - network

A graph describing a directory hierarchy can be a tree or a network. Directories form a tree if the file is allowed to enter only one directory (Fig. 19, b), and a network - if the file can enter several directories at once (Fig. 19, c). For example, in MS-DOS and Windows, directories form a tree structure, while in UNIX they form a network structure. In a tree structure, each file is a leaf. The top-level directory is called the root directory, or root.

With such an organization, the user is freed from remembering the names of all files, it is enough for him to roughly imagine to which group this or that file can be assigned in order to find it by sequential browsing of directories. The hierarchical structure is convenient for multi-user work: each user with his files is located in his own directory or subtree of directories, and at the same time all files in the system are logically connected.

A special case of a hierarchical structure is a single-level organization, when all files are included in one directory (Fig. 19, a).

Filenames

All file types have symbolic names. Three types of filenames are commonly used in hierarchically organized file systems: simple, compound, and relative.

A simple, or short, symbolic name identifies a file within the same directory. Simple names are assigned to files by users and programmers, while they must take into account OS restrictions on both the nomenclature of characters and the length of the name. Until relatively recently, these boundaries were very narrow. So, in the FAT file system, the length of names was limited by the 8.3 scheme (8 characters - the name itself, 3 characters - the name extension), and in the s5 file system, supported by many versions of UNIX OS, a simple symbolic name could not contain more than 14 characters. However, it is much more convenient for the user to work with long names, as they allow you to give files easy-to-remember names that clearly say what is contained in this file. Therefore, modern file systems, as well as enhancements to existing file systems, tend to support long, simple character filenames. For example, in files NTFS systems and FAT32 included with the Windows NT operating system, the file name can be up to 255 characters long.

Examples of simple file and directory names:

supplement to CD 254L in Russian.doc

installable filesystem manager.doc

In hierarchical file systems different files it is allowed to have the same simple symbol names, provided they belong to different directories. That is, the “many files - one simple name” scheme works here. To uniquely identify a file in such systems, the so-called full name is used.

The full name is a chain of simple symbolic names of all directories through which the path from the root to the given file passes. Thus, the full name is a compound name, in which simple names are separated from each other by the delimiter accepted in the OS. Often a forward or backslash is used as a separator, and it is customary to omit the name of the root directory. On fig. In Figure 19b, the two files have the simple name main.exe, but their compound names /depart/main.exe and /user/anna/main exe are different.

In a tree file system, there is a one-to-one correspondence “one file – one full name” between a file and its full name. In file systems that have a network structure, a file can be included in several directories, which means it can have several full names; here the correspondence “one file - many full names” is valid. In both cases, the file is uniquely identified by its full name.

A file can also be identified by a relative name. A relative file name is defined through the concept of "current directory". For each user at each moment of time, one of the directories of the file system is current, and this directory is selected by the user himself at the command of the OS. The file system fixes the name of the current directory so that it can be used in addition to relative names to form a full filename. When using relative names, the user identifies a file by a chain of directory names through which the route passes from the current directory to the given file. For example, if the current directory is /user, then the relative filename of /user/anna/main.exe is anna/main.exe.

Some operating systems allow multiple simple names to be assigned to the same file, which can be interpreted as aliases. In this case, just as in the system with network structure, a one-file-many-full-names match is established, since every simple filename has at least one full name.

Although a fully qualified name uniquely identifies a file, it is easier for an operating system to work with a file if there is a one-to-one correspondence between files and their names. To do this, it assigns a unique name to the file, so that the relationship "one file - one unique name" is valid. The unique name exists along with one or more symbolic names assigned to the file by users or applications. The unique name is a numeric identifier and is intended only for the operating system. An example of such a unique file name is the inode number in UNIX system.

Mounting

In general computing system can have multiple disk devices. Even typical Personal Computer typically has one hard drive, one floppy drive, and a CD drive. Powerful computers are usually equipped with large quantity disk drives on which disk packs are installed. Moreover, even one physical device using operating system tools, it can be represented as several logical devices, in particular, by dividing the disk space into sections. The question arises, how to organize the storage of files in a system that has several external memory devices?

The first solution is that each device hosts an autonomous file system, that is, the files on that device are described by a directory tree that has nothing to do with directory trees on other devices. In this case, in order to uniquely identify the file, the user must specify the logical device identifier along with the composite symbolic file name. An example of this autonomous existence of file systems is the MS-DOS operating system, in which the fully qualified file name includes the letter identifier of the logical drive. So, when accessing a file located on drive A, the user must specify the name of this drive: A:\privat\letter\uni\let1.doc.

Another option is to organize file storage in such a way that the user is given the opportunity to combine file systems located on different devices, into a single file system described by a single directory tree. This operation is called mounting. Let's consider how this operation is carried out using UNIX OS as an example.

Among all the logical disk devices in the system, the operating system allocates one device, called the system one. Let there be two file systems located on different logical disks (Fig. 20), and one of the disks is a system one.

The file system located on system drive, is assigned as the root. To link file hierarchies in the root file system, some existing directory is selected, in this example- man directory. After the mount is completed, the selected man directory becomes the root directory of the second file system. Through this directory, the mounted file system is connected as a subtree to the general tree (Fig. 21).

Rice. 20. Two filesystems before mounting

Rice. 21. Shared file system after mounting

After mounting the shared file system, there is no logical difference for the user between the root and the mounted file systems, in particular, the naming of files is the same as if it had been the same from the very beginning.

File attributes

The concept of a “file” includes not only the data and name it stores, but also the attributes. File attributes are information that describes the properties of a file. Examples of possible file attributes:

 file type ( regular file, directory, special file etc.);

 file owner;

 file creator;

 password to access the file;

 information about allowed file access operations;

 times of creation, last access and last change;

 current file size;

maximum size file;

 “read-only” attribute;

 sign hidden file”;

 sign system file”;

 attribute “archive file”;

 sign “binary/character”;

 sign “temporary” (delete after completion of the process);

 sign of blocking;

 the length of the record in the file;

 pointer to the key field in the record;

 Key length.

The set of file attributes is determined by the specifics of the file system: in file systems different type different sets of attributes can be used to characterize files. For example, in file systems that support flat files, it is not necessary to use the last three attributes in the above list related to file structuring. In a single user OS, the set of attributes will be missing characteristics related to users and security, such as the owner of the file, the creator of the file, the password for accessing the file, information about authorized access to the file.

The user can access the attributes using the means provided for this purpose by the file system. It is usually allowed to read the values ​​of any attributes, and change only some. For example, a user can change the permissions on a file (provided they have the necessary permissions to do so), but they are not allowed to change the creation date or the current size of the file.

File attribute values ​​can be directly contained in directories, as is done in the MS-DOS file system (Fig. 22, a). The figure shows the structure of a directory entry containing a simple symbolic name and file attributes. Here, the letters indicate the features of the file: R - read-only, A - archived, H - hidden, S - system.

Rice. 22. Directory structure:

a – MS-DOS directory entry structure (32 bytes); b – UNIX directory entry structure

Another option is to place the attributes in special tables when the directories contain only links to those tables. This approach is implemented, for example, in the UNIX ufs file system. In this file system, the directory structure is very simple. A record about each file contains a short symbolic file name and a pointer to the file's inode descriptor, this is the name in ufs of the table in which the values ​​of the file's attributes are concentrated (Fig. 22, b).

In either case, directories provide a link between filenames and the actual files. However, the approach, when the file name is separated from its attributes, makes the system more flexible. For example, a file can easily be included in multiple directories at once. Entries about this file in different directories may contain different simple names, but the link field will contain the same inode number.

Articles to read:

Hierarchical Clustering | Stanford University

Liked the article? Share with friends!
Was this article helpful?
Yes
Not
Thanks for your feedback!
Something went wrong and your vote was not counted.
Thank you. Your message has been sent
Did you find an error in the text?
Select it, click Ctrl+Enter and we'll fix it!