The interface that is implemented by the operating system. Files and file system

It examines the interaction of the user with the OS outside the program - through commands entered from the terminal keyboard in interactive systems or received in the input stream in batch systems. In the first case, as a rule, a new command is entered after executing the previous one, and the new command itself or its parameters can be selected depending on the results of this execution. In the second case, a whole sequence of commands is set at once, and possible deviations from their sequential execution should be specified explicitly. These differences in the technology of user interaction with the system naturally result in differences in interactive and batch command languages, but as command languages \u200b\u200bexpand, they tend to converge: interactive command languages \u200b\u200binclude command sequencing capabilities, and batch languages \u200b\u200b- more flexible sequencing controls. execution.

Command language and command processor

Commands are instructions that tell the OS what to do. Commands can be perceived and executed either by kernel modules of the OS, or by a separate process, in the latter case, such a process is called the command interpreter or shell). The set of valid OS commands and rules for their recording forms the command language (CL - control language).

Most user requests to the OS consist of two components: what operation should be performed and in what environment (environment) the operation should be performed. Internal and external command operations can be distinguished. Internal operations are performed by the shell itself; external operations require calling utility programs. Calling and executing utility programs is no different from calling and executing applications. The shell spawns child processes and executes specified programs in them using the same system calls that an application can use.

An environment or environment is what distinguishes one execution of a program from another. The environment of a particular implementation can be formed in one of the following ways or combinations thereof:

    local environment installation commands;

    program parameters;

    the commands for setting the global environment.

The environment can be local or global. In the first case, the environment parameters are set only for this specific execution of this specific program-process and are lost at the end of execution. In the second case, the environment parameters are saved and are valid all the time until they are explicitly canceled or reinstalled.

Environment variables can be system or user-defined. System ones have reserved symbolic names and are interpreted by the command interpreter or other system utilities. User variables are created, modified, and interpreted by users and applications. In order for the environment to be used, the system must have a means of accessing it. At the command level, it should be a command of the type that outputs the names and values \u200b\u200bof all variables of the global environment to the terminal, at the API level, it should be a system call that returns the address of the global environment block.

In an OS that makes it easy to spawn new processes, it is assumed that complex actions are performed as a result of joint (sequential or parallel) operation of several simple processes. Therefore, the command language of such OS includes tools for integrating processes. These funds include:

    command lists - a simple enumeration in one command line of several commands that will be executed sequentially;

    redirecting system input-output - redirecting input makes it possible to use data previously written to a file as input to the program, and the program enters and interprets this data as entered from the keyboard; output redirection saves data to be displayed in a file;

    pipelining - a combination of a command list with I / O redirection; the output data of program 1 is not sent to the screen, but is saved and then used as input for program 2;

    parallel execution - a special feature in the command line is used to instruct the shell to enter and execute the next command, without waiting for the completion of the previous one.

Command files and procedure language

User friendliness considerations dictate the need for short access to frequently executed sequences of commands. A simple and effective solution to this problem is to write such a sequence into a text file and refer to it later by the file name. These files are called batch files. They are sometimes also called batch files in interactive systems, and procedure files in batch systems. The command interpreter must, when entering a command to access such a file, recognize the file type and then read and interpret commands from the file.

In the simplest case, a batch file contains an immutable sequence of commands and is simply an abbreviation for that sequence. Somewhat more sophisticated tools allow you to control the sequence of command execution in a command script. The simplest version of such control is the inclusion in the command of the condition for its execution, the more complex and flexible version is the conditional transition to one or another command. In the execution or transition condition, the completion code of one or more previous commands must be analyzed.

Developed command languages \u200b\u200bpossess all sets of properties of algorithmic languages \u200b\u200band allow writing entire programs in batch files, including both calls to system commands and processing of their results. The most advanced of these languages \u200b\u200bare shell (Unix OS and its clones) and REXX (all IBM OS).

Full screen interface

The command line interface is currently used only by system programmers and administrators. Programmable video terminals make it possible to display information at any position on the screen and, therefore, use the entire screen space for organizing the interaction between the OS and the user.

The full-screen interface is based on the principle of consistency, which means that the user forms a system of waiting for the same reactions to the same actions. The general principles of the panel interface are largely independent of the type of terminals used. However, the combination of high-resolution graphics video adapters with the general increase in processing power of personal computing systems can significantly change the overall appearance of the screen. The main directions of these changes: multi-window, three-dimensional, iconic. The priority in the development of graphical interfaces (including object-oriented ones) belongs to Apple, but interface graphics have become ubiquitous, first of all, in the Windows operating system of Microsoft.

Even on purely text video terminals, it was possible to display several windows at the same time, but for the graphical mode this opportunity has expanded significantly. In a multi-window interface, the role of the mouse is significantly increased as a means of selecting a window and as a means of targeting within a selected window. The high resolution of graphic displays can also simulate 3D panels. Additional graphic elements - controls are also used on the "volumetric" panel.

The main change in the appearance of the interface is the icon - the presentation of objects (files) in the form of miniature graphic images - icons (icon). In addition to purely external changes, the icon gave rise to the ability to manipulate objects through the manipulation of their images. The technique of moving / copying files, called transportation, has become widespread. The interface graphics are further developed in the object-oriented interface.

Object oriented interface

In contrast to the usual interface, which presents to the user practically the only type of object - a file, a unit of information storage in the OS, an object-oriented (OO) interface presents objects of various types. Files can be of different types of objects - depending on the type of information stored in them and how it is processed. In addition, objects can be devices, network resources, etc. In OO programming, an object is understood as an abstract data type that includes both the data itself and the procedures for its processing. Objects are understood in a similar way in the OO interface. Among the properties inherent in an object, there is also an indication of the way it is processed - including the application that processes data of this type. Performing some actions on an object involves automatically launching applications that perform these actions.

In modern OO operating systems, the user interface is based on the concept of the desktop - an OS shell that represents the screen as a flat surface on which objects and folders are located. The desktop itself is also an object that has a certain set of properties and possible operations. A folder is an object that contains other objects and / or folders. Objects and folders are represented by pictograms, for them the mouse is the target designator, and the mouse keys are used to set almost all necessary actions. Copy, move, etc. operations are carried out using transportation techniques. A specific user action (clicking a mouse button) causes the appearance of an action menu - a list of operations that are possible for an object of this type. The action menus will be different for different types of objects. Many actions, the names of which are common to all objects, are performed, however, in different ways, and require calling different applications. One of the actions common to all objects is to read / set object properties. When this action is selected, a list of properties specified for an object of the selected type and their values \u200b\u200bfor this object is displayed on the screen.

By the type of user interface, text (linear), graphical and speech operating systems are distinguished.

User interface called a set of techniques for user interaction with the application. The user interface includes communication between the user and the application and the language of communication.

Text OS

Linear operating systems implement a command line interface. The main control device in them is the keyboard. The command is typed on the keyboard and displayed on the display screen. The end of the command is by pressing the Enter key. To work with operating systems that have a text interface, it is necessary to master the command language of this environment, i.e. a set of commands, the structure of which is determined by the syntax of this language.

The first real operating systems had a text-based interface. It is now also used on users' servers and computers.

Graphics OS

Such operating systems implement an interface based on the interaction of active and passive graphical on-screen controls. The control devices in this case are the keyboard and mouse. The active control element is the mouse pointer - a graphic object whose movement on the screen is synchronized with the movement of the mouse. Passive controls are graphical application controls (onscreen buttons, icons, radio buttons, checkboxes, dropdowns, menu bars, etc.).

An example of purely graphical operating systems are operating systems of the Windows family. The startup screen of such operating systems is a system object called the desktop. Desktop is a graphical environment on which objects (files and directories) and controls are displayed.

In graphical operating systems, most operations can be performed in many different ways, for example through the menu bar, through the toolbar, through the window system, etc. Since operations are performed on an object, it must first be selected (highlighted).

The basis of the graphical user interface is an organized system of windows and other graphical objects, in the creation of which the developers strive for maximum standardization of all elements and methods of work.

Window is a framed rectangular area on the monitor screen in which applications, a document, a message are displayed. A window is active if the user is currently working with it. All operations performed in graphical operating systems take place either on the desktop or in some window.

Speech OS

In the case of the SILK interface (from English speech - speech, image - image, language - language, knowledge - knowledge) - on the screen, by a speech command, there is a movement from one search image to another.

It is assumed that when using the public interface, you will not need to understand the menu. Screen images will unambiguously indicate the further path of movement from some search images to others along semantic semantic links.

OS functions, user interface.

operating system, OS (English operating system) is a basic complex of computer programs that provides control of computer hardware, working with files, input and output of data, as well as the execution of application programs and utilities.

operating system Is a set of programs, rules and special data that jointly manage computer resources and processes that use these resources in their work.

Operating system (OS)

1.it is a set of programs that ensure the joint functioning of all computer devices and provides access to its resources

* .sys - system files

* .bak - safety file

Regardless of the version, the following 3 components provide DOS operation:

1. Basic Input / Output System (BIOS) (or RIOS). The program written in ROM is supplied by computer manufacturers and performs the function of ensuring normal operation: checking the completeness, testing various PC devices, initializing the DOS boot and a number of other functions. This program is not a file and does not actually come with QOS;

2. The DOS kernel contains in the form of hidden files: a bootstrap block located in the first sector of the system disk (readable using the BIOS) and providing loading of the operating system - IO - into the machine's memory. SYS (or IBM), the so-called basic I / O system with software servicing of peripherals (BIOS expansion and patching), and the MS DOS file. SYS (IBM), which contains programs for managing files, memory, running programs, etc. This file is sometimes called the interrupt control module, because the call to software tools (DOS functions) from a user program is carried out using software interrupts;

3. file, or command processor (interpreter), whose functions include receiving, checking commands entered by the user from the keyboard, and their execution. There are 3 categories of DOS commands - resident or internal, permanently residing in the OS, semi-resident, which can (as needed) be "overwritten" by application programs, and external, called as needed from external memory.

MS DOS commands are of two types:

Internal commands, they are executed by the command processor (for example, dir, copy). External commands are programs supplied with the OS as separate files. They are located on the disk and perform maintenance actions (for example, formatting the disk, cleaning the screen, checking the disk).

Commands consist of a command name and possibly parameters, separated by spaces. The brackets will mark optional command elements.

Working with files

Creating text files copy con filename... After entering this command, you will need to enter the lines of the file one by one. At the end of each line, press the Enter key. And after entering the last one - simultaneously press Ctrl and Z, and then Enter.

Deleting files del (path) filename.The path is written only when the file to be deleted is located in another directory.

Renaming files ren (path) filename1 filename2.FileName1 is the name of the file that you want to rename, filename2 is the new file name that will be assigned to it after the command is executed.

Copying files copy filename (path) filename1.

Copy games. txt games copy file games. txt to the GAMES subdirectory of the current disk.

Working with directories

Current disk change command A: - transition to disk A.

Browse directory dir (path) (filename) (/ p) (/ w).

If the path and file name are not entered, information about the contents of the directory will be displayed on the screen (file names, their size and the date of the last modification).

The / p parameter specifies the display of information in screen mode, with a delay until the user clicks on any key. This is convenient for large directories, / w - only displays information about the file names in the directory, five names per line.

Changing the current directory cd way.

Directory creation md way.

Removing a directory rd way.

Examples:
dir
- display the table of contents of the current directory;
dir * .exe - display information about all files with the extension. exe from the current directory;
dir a: - display the table of contents of the root directory of the drive a :.
cd games- transition to the GAMES directory of the current disc;
cd ..- transition to the previous directory;
cd- go to the root directory of the current disk.
rd games -deleting the GAMES subdirectory in the current directory;
ATTENTION! IT IS POSSIBLE TO DELETE ONLY AN EMPTY DIRECTORY!

Command line

This is the line that you see on the screen after MS DOS boots up. It is also called the DOS prompt and has the form, for example, like this

C: \\\u003e,

here C: - disk name; \u003e - the prompt symbol, after which the cursor blinks, indicating the place where you need to enter the command.

Other commands.
Date - display of information about the date with the ability to configure.
Time - display of information about time with the possibility of setting.
Verify on - enable the disk write check mode.
Verify of - turn off the disk write check mode.
Verify - display information about whether the disk write check mode is enabled.
Path - determines the search order for the most frequently launched programs.
Ver - shows the version of the operating system.
Cls - clears the screen.
Label - displays information about the disk label with the ability to change it.

The structure and general principles of building a program in Turbo Pascal. Alphabet. Constants. Variables.

General structure of programs in Pascal

Pascal programs have the following general form:

Program Program name

Description section

Operators section

The words PROGRAM, BEGIN and END distinguish 2 parts of a program: a declaration section and a statement section. This structure is required. Any object used in the program must be accounted for in the description section.

A program written according to the rules of the standard Pascal language should have the following structure in its full version:

Program is the name of the program;

Uses List of used modules

Label List of labels from the main program block

Const Defining program constants

Type Description of types

Var Variable description

Procedure Procedure text

Function Function text

The main block of the program

(operators section)

Syntax and semantics

The description of each element of the language is specified by its syntax and semantics. Syntactic definitions establish rules for constructing language elements. Semantics defines the meaning and rules of using those elements of the language for which syntactic definitions have been given.

Language alphabet

An alphabet is a collection of characters allowed in a language. Turbo Pascal's alphabet includes the following set of basic characters:

    lowercase and uppercase Latin letters: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z; a b c d e f g h i j k l m n o p q r s t u v w x y z; space underscore: _ Arabic numerals: 8 9 operation characters: + - * / \u003d<> < > <= >\u003d: \u003d @ delimiters:. , "() () (* *) ..:; specifiers: ^ # $ auxiliary (reserved) words:

ABSOLUTE EXPORTS LIBRARY SET

ASSEMBLER EXTERNAL MOD SHL

AND FAR NAME SHR

ARRAY FILE NIL STRING

ASM FOR NEAR THEN

ASSEMBLER FORWARD NOT TO

BEGIN FUNCTION OBJECT TYPE

CASE GOTO OF UNIT

CONST IF OR UNTIL

CONSTRUCTOR IMPLEMENTATION PACKED USES

DESTRUCTOR IN PRIVATE VAR

DIV INDEX PROCEDURE VIRTUAL

DO INHERITED PROGRAM WHILE

DOWNTO INLINE PUBLIC WITH

ELSE INTERFACE RECORD XOR

END INTERRUPT REPEAT

EXPORT LABEL RESIDENT

Elementary constructions

Elementary Pascal constructs include names, numbers, and strings.

Names (identifiers) the elements of the language are called - constants, labels, types, variables, procedures, functions, modules, objects.

An identifier in Turbo Pascal can include:

3. underscore character.

Uppercase and lowercase letters are not. A digit cannot come first in an identifier, and the underscore character can be in any position (for example, name1 and name2item are valid identifiers, but 5name is not; _name, name_, name_item are also valid names). The identifier can be any length, but only the first 63 characters are significant. Official words are not allowed as names.

Separators are used to separate identifiers, numbers, and reserved words from each other. You can use as them:

1.space and tab;

2. line feed;

3. comment.

Any place in the program where one separator can be placed, they can be placed in any number and in any combination, which allows you to visualize the structure of the program.

40. Basic principles of building operating systems

System architecture - its structure and basic principles of construction.

Basic principles of OS construction:

1. The principle of modularity

The OS is built from many software modules. In the general case, a module is understood as a functionally complete system element made in accordance with the accepted intermodular interfaces. The module can be easily replaced with another one if the specified interfaces are available.

Privileged, re-entrant, and reentrant modules are especially important.

All operating systems can be distinguished:

1) some of the most important control modules, which must be permanently located in RAM, together with some system data structures necessary for the functioning of the operating system, they form the kernel of the operating system. Its structure, as a rule, includes modules for managing the interrupt system, means for transferring programs from the state of the account to the state of waiting, ready and vice versa, means for the allocation of basic resources, such as RAM and processor;

2) many other system software modules, which are called transit (disk-resident). They are loaded into RAM only when necessary and, in the absence of free space, can be replaced by other transit modules.

2. Principle of a special mode of operation The operating system kernel and low-level drivers that control the operation of channels and input-output devices must operate in a special processor mode (privileged).

This is necessary for reasons:

1) can significantly improve the reliability of the calculations.

2) a number of functions must be performed centrally, under the control of the operating system (first of all, functions related to the management of data input-output processes).

3. The principle of virtualization

It is now used in almost any operating system.

Resource virtualization allows:

Organize the division of those resources between computing processes that should not be shared;

To abstract from specific resources, to generalize their properties and work with some abstraction.

Manifestations of the concept of virtuality:

1) the concept of a virtual machine. Any operating system hides real hardware and other resources from the user and his applications, replacing them with some abstraction. As a result, users see and use a virtual machine consisting of:

The memory of the memory, which is uniform in terms of the logic of work, is sufficient for executing applications.

An arbitrary number of processors capable of running in parallel and interacting while running.

An arbitrary number of external devices capable of working with the memory of a virtual machine in parallel or sequentially, asynchronously or synchronously with respect to the operation of one or another virtual processor, which initiate the operation of these devices.

2) the ability to organize the execution in the operating system of applications developed for another operating system that has a completely different application programming interface. Those. organization of several operating environments;

3) independence of programs from external devices - the connection of programs with specific devices is carried out not in the process of creating a program, but during the planning period of its execution. This principle allows the control operations of external devices to be carried out in the same way, regardless of their specific physical characteristics.

4. The principle of mobility

Mobility, or portability, means the ability and ease of porting an operating system to another hardware platform. A mobile operating system is usually developed using a special high-level language for building system software. One of these languages \u200b\u200bis C, as well as C ++.

Difficulties:

1) architectures of different processors can be very different.

2) for the OS, not only the architecture of the central processor is important, but also the architecture of the computer as a whole.

To ensure portability, a standard for an application programming interface called POSIX (Portable Operating System Interface for Computer Environments) was created. ? The price to be paid for universality is, first of all, the loss of productivity, so a number of developers decide to abandon the principle of mobility, since it is not always economically justified to follow this principle.

5. Principle of compatibility

One aspect of compatibility is the ability of an operating system to run programs written for other systems or for earlier versions of that operating system, as well as for a different hardware platform.

It is necessary to separate the issues of binary compatibility and compatibility at the application source level.

Binary compatibility is achieved when you can take an executable program and run it on another operating system.

Source compatibility requires an appropriate translator in the system software, as well as library and system call compatibility.

It is much more difficult to achieve binary compatibility between processors based on different architectures. In order for one computer to execute the programs of another, it must work with machine instructions that it initially does not understand. The solution is to use so-called application environments, or emulators.

Since the main part of the program, as a rule, is made up of calls to library functions, the application environment simulates the entire library functions using a previously written library of functions of a similar purpose, and emulates the rest of the commands each separately.

6. The principle of generating capacity

The initial representation of the central system control part of the operating system should provide the ability to customize based on the specific configuration of a particular computing complex and the range of tasks to be solved.

Generation of an operating system is understood as its assembly (linking) from separate software modules. As a result of the generation, the compiled binaries of the operating system and the built system tables that reflect the specific configuration of the computer are obtained.

The generation process is carried out using a special generator program and the corresponding input language for this program. The result of the generation is the full version of the operating system.

7. The principle of openness

An open operating system is available for analysis by both users and system specialists who maintain the computing system. It is necessary to be able to easily make additions and changes, if necessary, without violating the integrity of the system.

This principle is sometimes interpreted as system extensibility.

First of all, UNIX systems should be referred to open operating systems.

8. The principle of ensuring the security of computing

Security rules define properties:

Protecting the resources of one user from others,

Setting resource quotas to prevent a single user from seizing all system resources. ? To ensure the protection of information from unauthorized access, the account mechanism is most often used. It involves authentication and authorization of the user.

Many modern operating systems guarantee data security level C2 in the US standards system.

The foundations for security standards were laid down by the Criteria for Evaluating Reliable Computer Systems (Orange Book).

The security level hierarchy shown in the Orange Book marks the lowest security level as D and the highest as A:

Class D includes systems, the assessment of which revealed their non-compliance with the requirements of all other classes.

The main properties of C-systems: the presence of a subsystem for recording security events and selective access control.

Level B systems are based on tagged data and categorization of users, that is, they implement mandatory access control.

Level A requires, in addition to all level B requirements, proof of conformity of the system to safety requirements.

42. Microkernel and macro-kernel operating systems

In microkernel operating systems, a central compact module can be distinguished, which is related to the supervisory part of the system. This module has a very small size and performs a relatively small number of control functions, but allows transferring control to other control modules, which will perform the requested function.

The microkernel is the minimum major part of the operating system and serves as the basis for modular and portable extensions.

The microkernel itself is a module of system software that operates in the highest priority state of the computer and communicates with the rest of the operating system, which is considered a set of server applications (services).

The basic idea of \u200b\u200bmicrokernel technology is to create the necessary top-level hierarchy environment from which all the functionality of the hardware level can be easily accessed. In this case, the microkernel is the starting point for the creation of all other modules of the system.

A microkernel contains and executes the minimum amount of code required to implement basic system calls.

For most microkernel operating systems, the architecture is based on the Mach microkernel technology.

The microkernel only provides five types of services:

Virtual memory management;

Support for jobs and threads;

Interaction between processes;

I / O support and interrupt management;

Host and processor services.

The most prominent representative of microkernel operating systems is the QNX real-time OS. ? In macrokernel, or monolithic, operating systems, the kernel, which consists of many control modules and data structures, is not divided into a central part and peripheral modules. The kernel turns out to be monolithic, indivisible. In this sense, macrokernel operating systems are the exact opposite of microkernel operating systems.

Monolithic operating system problems:

The danger of a conflict between different parts of the kernel;

Difficulty connecting new drivers to the kernel.

The client-server approach has proven very fruitful.

Microkernel operating systems make full use of the client-server model.

Microkernel operating systems are now being developed more often than monolithic ones. However, the use of client-server technology is not yet a guarantee that the operating system will become microkernel.

43. Requirements for real-time operating systems

Requirements for the real-time system (RTS):

Limiting response time;

Simultaneity of processing.

Distinguish between systems "soft" and "hard" real time.

The system is considered rigid if "violation of time constraints is unacceptable", and soft if "violation of time constraints is undesirable".

43. Basic requirements for RTOS:

1. Multiprogramming and multitasking

The OS must be multi-programmed and multitasking, actively use interrupts for dispatching, and be predictable. Those. The OS must be multithreaded on the principle of absolute priority (interruptible).

2. Priorities of tasks

There must be a concept of priority of a thread (task). It is difficult to determine which task needs the resource the most. There are practically no operating systems built on this principle. it is difficult to implement. Therefore, OS developers introduce the concept of a priority level for a task, and time constraints are reduced to priorities.

3. Priority inheritance

The combination of thread priorities and resource sharing between them leads to a priority inversion problem.

The time it takes to complete the highest priority thread depends on the lower priority levels - this is the priority inversion.

To eliminate such inversions, the RTOS must allow priority inheritance, that is, raising the priority level of a thread to the level of the thread that calls it.

4. Synchronization of processes and tasks

The OS must provide powerful, reliable and convenient task synchronization mechanisms. Mechanisms are needed that guarantee the ability to quickly exchange messages and sync signals between parallel running tasks and processes.

5. Predictability

The behavior of the operating system must be known and reasonably predictable. The creator of an RTOS must provide characteristics:

Time from the moment of interruption to the moment of starting the task;

The maximum execution time for each system call;

The maximum time for masking interrupts by drivers and supervisor modules of the operating system. 44. Operating system interfaces

Operating system interfaces mean special system and application programming interfaces (APIs) designed to perform the following tasks.

Process management:

Launching, suspending and canceling a task;

Setting or changing the priority of a task;

Interaction of tasks with each other;

Remote Procedure Call (RPC).

Memory management:

Request to allocate a block of memory;

Freeing up memory;

Changing the parameters of the memory block;

Mapping files to memory (not available on all systems).

I / O control:

Request to manage virtual devices;

File operations.

The user interface with the operating system is implemented using special software modules - command interpreters, which accept his commands in the appropriate language (possibly using a graphical interface) and translate them into ordinary calls in accordance with the main system interface.

Having received a command from the user, such a module, after lexical and parsing, either performs the action itself, or (more often) refers to other OS modules using the API mechanism.

In recent years, graphical interfaces (GUIs) have become very popular, in which appropriate manipulators such as a mouse or a trackball are involved. Pointing to an object and clicking or double-clicking on the corresponding mouse button leads to some action. Such an interface subsystem translates user “commands” into calls to the operating system.

GUI control is a special case of the I / O control task and does not belong to the functions of the operating system kernel.

The API is divided into the following areas:

API as a high-level interface belonging to RTL libraries;

API of application and system programs included in the delivery of the operating system;

Other APIs.

Application programming interface is intended for use by application programs of computer system resources and various system functions implemented by the operating system. An API describes a collection of functions and procedures belonging to the kernel or operating system add-ons.

API is a set of functions provided by the programming system to the developer of the application program and focused on organizing the interaction of the resulting application program with the target computing system.

The API functions allow the developer to build the resulting application program so as to use the means of the target computing system to perform typical operations. At the same time, the program developer is relieved of the need to create source code to perform these operations.

API implementation options:

Implementation at the level of operating system modules;

Implementation at the level of the programming system;

Implementation at the level of an external library of procedures and functions.

POSIX interface? POSIX is a standard that describes system interfaces for open source operating systems, including shells, utilities, and toolkits.

In addition, POSIX standardizes security tasks, real-time tasks, administrative processes, networking, and transaction processing. The standard is based on UNIX systems, but can be implemented on other operating systems as well.

This standard details the virtual memory system, multitasking, and operating system porting technology.

POSIX is a set of POSIX.1 - POSIX.12 standards.

Operating system interface

The operating system of a personal computer must have friendly interface (convenient as a means of communication), to be resistant to user errors and convenient for his work at the computer.

Command line interface used until the 1990s. in the operating system of personal computers MS-DOS (eng. Microsoft Disk Operation System - disk operating system). Interaction with the system was carried out by sending commands from the keyboard in the form of an alphanumeric sequence to a line on the screen. The operating system translated these commands into computer-executed operations. The commands and file names had to be remembered and accurately entered. The personal computer, although it was on the table, could not yet be used by non-programmers.

In the late 1970s. Xerox research has shown that clear and understandable language of pictures is a convenient form of information entry and presentation. Objects (files, devices, commands, programs) should be represented in the form of easily guessed graphic images, manipulations with which should be similar to those performed by people with similar material objects, based on the natural assimilation of graphic information by a person. For the first time, the graphical interface was used by Apple in the Macintosh operating system. Then Microsoft used it on Windows operating systems.

Graphical User Interface (GUI) is a graphical environment that organizes the user's interaction with a computing system through visual controls on the screen: windows, lists, buttons, hyperlinks, icons, etc.

Commands in such an environment are given not by entering words from the keyboard, but using the elements of the graphical interface:

  • rectangular movable areas on the screen (windows) have become a kind of "device" for input or output of information into an open program and messages;
  • menus and button panels provide a choice of command delivery;
  • icons (thumbnail pictures) represent files, folders, devices;
  • pointer on the screen (cursor) - a symbol (arrow, vertical stick, etc.) moves across the screen to select objects and give commands;

Currently, all personal computer operating systems provide user interaction through a graphical interface. The graphical interface is also used in most application programs, which helps even a novice user to master working in an operating system environment with files, launch programs, etc.

What follows is focused on the Windows operating system.

Files and file system

File - a named set of data records stored in the external memory of a computer (for example, on a disk) and considered as a whole. The operating system and processing applications treat the file as a single information object called into the computer's RAM for processing or execution. Files can be split into executable (programs) and non-executable (data and document files). Executable files can be loaded by the operating system for execution, and non-executable files can only change their content under the influence of the program.

Program file (or a part of it) when opened, it is placed in RAM, and the execution of the commands described in it begins, including calling other programs, opening or creating document files. The filenames of the programs installed during installation should not be changed, as other programs may interact with them.

Data file creates or opens a program that performs any actions with it: reading, editing, displaying on the screen, printing on a printer, dubbing; turning into data for another program.

File name - it is the name of the file, which, together with the extension and the path to access the file, uniquely identifies it. When creating a file in application programs, the user gives it a name.

Modern operating systems allow long filenames - up to 256 characters. But the characters are prohibited in the file name< >: | “? * /, which are used in writing commands. When working with files and folders, the computer does not distinguish between uppercase and lowercase letters in the name.

Russian letters are misread by some foreign programs, so it is not recommended to use them in the names of document files sent to Internet websites and by e-mail.

The file name usually has an extension, or type. File name extension - a sequence of characters to identify the file type. The extension is separated by a period from the file name and usually consists of three to four characters (English letters). So, in the file name academia.txt, the extension is txt, after the extension, the dot is not put. The name and extension can be written in uppercase and lowercase letters. Commonly used file name extensions are:

doc (eng, document) - documents with text formatting, in particular those created by Word;

txt - plain text files, in which the font and paragraphs have the same appearance, are not formatted, there are no pictures; in particular, these are files created by the standard Notepad program;

exe - program file (eng, executable - executable). The operating system, when trying to delete a file with the exe extension, warns that the file is a program and not everything will work without it; mp3, wav - sound files; avi - audio and video files; htm, html - files of Internet web pages; gif, jpg, bmp, tiff - graphic files with pictures; dll - "dynamic library", a file with a part of the program, loaded into memory when there is a need for this part;

tmp - temporary (eng, temporal) file created by the operating system or program for the period of document processing or program operation is deleted at the end of the work, but sometimes remains due to improper termination or program failure.

By name expansion, the operating system sets association file with an application program running on a computer with this type of file, launches the required program and loads the proposed file.

The operating system stores file extension associations in a list that is updated after installing a new program that works with files of a specific type. For example, but the doc extension can denote an association - to open a file using Word or, if Word is not installed, using WordPad.

In principle, you can write any extension in the file name, rename it without an extension at all: the data will not be damaged, however, the wrong extension will prevent the operating system and the program that worked with the file from recognizing and opening it.

There are files that have the same name, but differ in extension: for example, winrar.exe is a file archiving (compression) program, winrar.hlp is a help file for the program, winrar.cnt is a help content file.

The file name pattern specifies a condition on the name and extension of a file and is used in commands to describe a group of files with similar names that satisfy the specified condition.

When the exact file name is not known, or when it is necessary to match a group of files with similar but not completely identical names, the wildcard name pattern is used. The asterisk - "*" - in name templates replaces any number of characters remaining until the end of the name or their absence. Question mark - "?" - stands for one character.

Examples of file name patterns:

  • *. * - denotes all files;
  • * .txt - template for files with the same txt name extension;
  • Protocol * .doc - a template that matches files with the same beginning of the name "protocol" and the extension doc. For example: minutes.doc, minutes2.bos, minutes of interrogation.doc, minutes of the meeting.doc and minutes of disagreements.doc;
  • deed ??. doc - a template for files whose name has the same beginning "deed", then any two symbols and the extension doc. For example: business3l.doc, business_8.dos, but files business.doc, business 306.doc and business_235.dos do not fit.

Directory (folder) - a named list of a group of files (with their names and properties) and subfolders, available to the user through the commands of the operating system. In the MS DOS operating system, the term "directory" was used; in the Windows operating system, the term "folder" was used more often. In the following, both terms are used.

On Windows operating systems, folder names follow the same rules as files (256 letters or numbers maximum). Panka does not have a name extension, yet sometimes a period is used in her name for clarity.

A directory occupies a strictly defined place in the hierarchical organization of the file system, and in addition to the list of files, it can additionally contain an indication of a directory of a lower level (subdirectories).

File tree (directory tree) - the structure of directories, subdirectories and files on disk, indicating the location of files in directories and subdirectories, subdirectories in directories. Logical subordination is graphically depicted by a tree with one vertex, called root directory, or disk folder and branching (fig. 4.3, and). Each branch point includes only one branch from the "parent" folder (directory), and several may go into the subordinate folders ("child", subordinate directories). From the folder you can go up one level - to the parent folder. A common group of files and folders has only one upstream (parent) directory in which they are written. When you go down to subordinate folders, the branches only diverge and never intersect.

A GUI OS such as Windows displays a folder in the directory tree with a stationery folder icon (Fig. 4.3.6 ), but opens as a window with icons and names of attached files and other folders.

The path to the file - specifying the drive and the sequence of folders (directories) before accessing the file. The path starts with the name of the drive (top level) that opens root dad

Figure: 4.3.

and - directory tree (without files); b - Windows Explorer (folders with nested subfolders open with an icon)

ku drive and denoted by one English letter with a colon (for example, drive D :, and the root folder D :), and goes down the directory tree listing the names of subfolders separated by a slash - (backslash). Hard drives are named C :, D: (if there are two of them), the name of the CD is given by the following Latin letter - E :. The letters A and B are allocated to floppy drives (A: and B :).

Full file name (on Windows) - Writes the file name and extension preceded by the file path as a sequence of directory names separated by a slash. For example, the name D: LettersMoscowMunicipalityApplication.doc means that from the folder on the D: drive, after going through the Letters, Moscow, City Hall folders (see fig. 4.3, b) you can see and open the file Statement.doc. The file must have a unique name in its folder, at least one character different from the names of other files in the folder.

Hierarchy is widely used in structuring information, storing it in databases, help systems, and websites. Hierarchically organized not only directories, software and command menus in program windows.

File system - part of the operating system that allows writing and reading files on disk media. It defines the logical structure for storing data in files on disk, naming (identification) and accompanying file data (file access control). Microsoft operating systems use FAT and NTFS (New Technology File System) file systems.

The FAT file system is named after the method used to organize files - file allocation table (File Allocation Table, FAT). The file allocation table is created when the disk is formatted and is located on it in a strictly defined place. The structure of EAT is similar to the table of contents of a book; the operating system uses it to search for files and determine their location on a magnetic disk.

The improved NTFS file system provides a high level of performance and data security, as well as features unavailable to versions of the FAT file system: restriction on access to files and directories (described directly in the table of user rights to work with this object), encryption, compression. In the event of a failure, the integrity of the file system is restored using audit data.

File properties. Each file consists of content, and is described by properties (attributes, features, signs) that distinguish the file from many other files.

File attributes - recorded file properties: file name and content type; date and time of creation; file size; file owner name; file access rights and method. The access method is described by attributes: read-only, archived, hidden, system. These four attributes are designated by letter.

AND - archive file (archive). An indication that the file should be added to the backup archive, i.e. created or modified and the backup program must place it on the media (tape drive or network drive).

R - only reading (read only). The file cannot be edited. Some text editors remove the R attribute and edit the file without warning.

H - hidden file (hidden) - not included in standard file system operations. Temporary and service files of the operating system are not shown in the folder window, so as not to accidentally delete them. As protection against detection of hidden documents, the attribute is useless.

S - system file (system) - belongs to the operating system, it is not recommended to delete or change this attribute, and in modern operating systems it is not easy.

When trying to modify or delete files with R, H, S attributes, the system warns the user about an important file property. You can display, set, and clear file attributes in a file management program such as the file manager Total Commander.

The corresponding command displays the file properties in the Windows operating system folder (see the example of displaying file properties in Fig. 4.4).

To save and open a file, the operating system must write its data to disk and register the name, properties, and location of the file in the folder. It is customary to say that "the file is in the folder", in fact, it stores a list of files, their properties and shows the file icons in the window. The data from the files of this folder can be physically stored in different places on the disk; only names, properties and addresses are recorded in the punk.

Working with files and folders is to create, view and edit the content, rename, copy, move, delete, and change

Figure: 4.4.

file attributes. Operations are performed by operating system commands using the mouse and menu selections.

Create folder and file possible in any folder starting from the disc folder. The file is created in a specific program. When a file is saved, its data is written, if possible, to neighboring clusters (areas of a disk consisting of several adjacent sectors). These clusters are marked as busy in the disk file allocation table. The folder contains file properties (name, size, date, time, attribute, etc.) and the address of the first cluster of the file. After each new edit of the file, its data is overwritten in a new location on the disk, and the address entry is changed in the same folder.

When copy folder its name is entered in the corresponding place of the disk table, when copying a file, previous records remain in place, and copies of data appear on the free disk space or another disk and, as when creating a file, records in the specified folder.

Moving a folder makes changes to the corresponding entries about the disk folder.

Moving a file in the folder of the same disk leaves the data in the same place, and a new registration record of the file name and properties appears in the file receipt folder. Moving the file to another disk causes the data to be written again, and the file clusters are marked as free in the file allocation table on the old disk.

Renaming a file and directory (folders) changes the name entry.

Deleting a file. In the table of allocation of files on disk ("table of contents"), the clusters occupied by the deleted file are marked as free. The file data itself is not overwritten until a new file is written to the vacated space.

View file content. You can open a file for viewing, as a rule, using the program in which it was created. But viewers show the contents of the file, although they do not allow editing, changing. Some files can be opened by other programs as well. For example, text files created in simple editors WordPad, Notepad, can be opened in the editor Word. Internet Web documents open in browsers that did not create them.

In addition to operations with files by means of internal commands of the operating system, archiving, defragmentation and conversion operations are applied to files using special external programs.

Archiving a file - compression of data records stored in the file into a smaller archive file. Performed by archiver programs. Operating systems handle archive files in the same way as regular files.

File fragmentation - distribution of file records on a disk in non-contiguous, non-adjacent clusters, if there is not enough continuous free space on the disk. Fragmentation increases the access time to data, because when reading and writing, you have to step over hard disk clusters occupied by other files. To eliminate fragmentation, defragmentation is performed into contiguous sequences of clusters using utilities.

Converting files - transformation, modification of data by programs in order to present them in a different form with a slight change in the information itself for the conditions of subsequent processing. Programs can open files with information of various formats: text, tabular, graphical or other and save in files of various types.

  • The term "extension" η informatics is used in the sense of increasing, complementing the possibility, and not only the file name, but also devices, objects, search services, etc.