In the Android Market appeared tab "Similar"

# facts | Application API

Интерфейс

As we already know, a hardware driver allows you to use a device without even knowing its configuration. The application program interface (API, application program interface) plays about the same role when interacting with the software side of a computer. The programmer may not know the technical details of how the processor performs operations, but it is able to use the functions of the computer and its operating system. Consider this on the example of creating a file to store data on the hard disk.

Интерфейс

A programmer writes an application that records data from a scientific tool. He can do this so that a scientist can specify the name of the file being created. The operating system has to create files function MakeFile. When writing a program, the programmer includes a line in it, for example:

MakeFile [1,% Name, 2]


The command considered in this example requires the operating system to create a file that allows access to the data stored in it in any order. This is indicated by the option "1". The option "0" would mean creating a file with sequential access. This line also indicates that the file name will be specified by the user (% Name).

File size will depend on how much data will be stored in it. This is determined by the value "2". Other options are also possible: “0” means the creation of a fixed-size file; “1” indicates a file that will grow as data is added to it, but will not decrease when it is deleted. Now let's see how the operating system performs the task assigned to it by the programmer.

The operating system will send a request to the hard disk to obtain space for placing a new file on the first found free part of it.

After receiving this information, the operating system will locate in the file system information indicating the beginning and end of the file on the disk, as well as containing its name and type. As well as information about which users have the right to view and modify the created file. In addition, the file system will mark the time and date of creation of the new file.

The operating system will write this information at the beginning of the file. In addition, the method of access to it will be set: the file will be associated with a specific application. All this information: requests to the hard drive and addresses of the starting and ending points of the file will be presented in a format that largely depends on the manufacturer and model of the hard drive.

The programmer’s task is greatly facilitated by using the disk drive API. It will not have to keep in mind the command codes, data types and response codes of each specific hard disk. The operating system communicates with the drivers of various hardware subsystems and settles the subtleties of the hardware itself. The programmer can only write code for the API, and otherwise rely on his good assistant, a tireless operating system.

In recent years, it is the application software interface that is the most controversial area of ​​the computer industry. Companies understand that programmers using the APIs presented by them gain some of the control over the industry and some of its profits. For this reason, many companies make certain types of software free.

Organization of communication programmer with the hardware side of the computer is one of the tasks of operating systems (which are different), along with the distribution of processor time.

To be continued…

Based on computer.howstuffworks.com

The article is based on materials https://hi-news.ru/software/fakty-api-prilozheniya.html.

Comments