From a system point of view, the OS structure provides resource allocation, manages disks, networks, processors together, providing common services needed by many different programs for file maintenance, process management, printer access and protecting individual programs from viruses.
The principle of the system
Most OS structures use the layering approach of each task, including file systems. Each level is responsible for certain actions.
When an application requests a file, the first request is sent to the logical file system. It contains metadata about file and directory structures. If the application program does not have the necessary access rights to the file, then this layer throws an error.
Logical file systems also check the file path. As a rule, they are divided into various logical blocks, stored on the hard drive and removed from the hard drive. The latter is divided into various tracks and sectors. Therefore, in order to store and retrieve files, the logical blocks of the OS structure must be mapped to physical blocks. This mapping is performed by the file organization module. He is also responsible for managing free space.
After the file organization module has decided which physical block an application needs, it transfers this information to the underlying file system. This primary system is responsible for issuing I / O control commands to extract these blocks. The input and output controls contain codes by which it can access the hard drive. These codes are known as device drivers. I / O controls are also responsible for handling interrupts.
Kinds
The existing OS and system structure allows user applications to interact with system equipment. Since the operating system is a complex structure, it should be created with the utmost care so that it can be easily used and modified. An easy way to do this is to create it in parts. Each of these parts should be clearly defined with specified inputs, outputs and functions.
There are many operating systems that have a fairly simple structure. They began as small systems and quickly expanded far beyond their original intentions. A common example of this is MS-DOS.
Modern systems should have a modular structure and OS functions, unlike MS-DOS. This leads to more control over the computer system and its applications. The modular structure will also allow programmers to hide information as necessary and implement internal procedures as they see fit, without changing external specifications. One way to achieve modularity in the operating system is to take a layered approach or create a layered structure.
The bottom layer is the hardware, and the top layer is the user interface. Layers can hide some structures and operations from their upper layers. One problem with the layered structure is that each layer must be carefully defined, because the upper layers can only use the functionality of the lower ones.
OS architecture design
Design traditionally follows the principle of separation of interests. This principle involves structuring the OS into relatively independent parts that provide simple individual functions, thereby preserving the complexity of the managed structure. In addition to managing OS complexity, it can affect key features such as reliability or efficiency.
The operating system has various privileges that allow it to access other protected resources, such as physical devices or application memory. When these privileges are granted to the individual parts that require them, and not as a whole, the potential for abuse of both accidental and malicious programs is reduced.
A malfunction of the system can adversely affect efficiency due to the overhead associated with the exchange of data between the individual parts. These overheads can be exacerbated in conjunction with the hardware mechanisms used to provide privileges.
Modern monolithic structures
The monolithic architecture design does not create special conditions for the nature of the OS. Although he participates in the separation of problems at work, he does not limit the privileges granted to individual parts of the system that are executed with maximum privileges. The overhead of communication within a monolithic system is the same as overhead within any other software.
CP / M and DOS are simple examples of monolithic operating systems. These are systems that share applications with a single address space. In CP / M, a 16-bit address space begins with system variables and the application area and ends with three parts:
- CCP - console command processor;
- BDOS - the base OS;
- BIOS - Basic System I / O.
In DOS, a 20-bit address space starts with an array of interrupt vectors and system variables, followed by the resident part and the application area, and ends with the memory block used by the video card and BIOS. Most modern systems, including Linux and the structure of Windows, are also considered monolithic, although they certainly differ significantly from simple examples of CP / M and DOS.
Multilayer systems
The multi-level architecture design of the operating system tries to achieve reliability by structuring the architecture in layers with different privileges. The most privileged level will contain code related to interrupt handling and context switching, higher levels that will follow device drivers, memory management, file systems, user interfaces, and finally, the least privileged level contains applications.
MULTICS is a striking example of a multi-level system designed with 8 layers formed into protective rings, the boundaries of which can only be crossed using specialized instructions. However, modern systems do not use a layered structure, since it is considered limited and requires special hardware support.
Microkernel design
The microkernel system architecture design provides reliability. The privileges granted to its individual parts are limited as much as possible, and the connection between them depends on specialized mechanisms, which, if necessary, ensure the observance of privileges. The overhead of communication within the system with micronuclei may be higher than the overhead of communication within other software. Studies have shown that these overheads are manageable.
Microkernel development experience suggests that only very few individual parts of a system should have more privileges than regular applications. Thus, the microkernel design leads to a small system core, accompanied by additional applications that provide most of the functions of the system.
MACH is a striking example of a microkernel that has been used in modern systems, including NextStep and OpenStep systems and, in particular, OS X. Most research systems also qualify as microkernel OS.
Virtual hypervisors
Attempts to simplify maintenance and improve the use of systems with several independent applications have led to the idea of running multiple machines with control on one computer. Just as the kernel provides an isolated environment for each hosted application, virtualized systems create a hypervisor that provides an isolated environment for each hosted system. Hypervisors can be implemented in a variety of ways in system architecture.
The native hypervisor runs on bare metal, with hosted systems located higher in the system structure. This allows you to implement an effective hardware circuit, paying the price of maintaining a specific hardware implementation.
The host hypervisor partially circumvents the need for a hardware-specific implementation by running on top of another system. The structure of the system starts from the bottom up, includes the hypervisor, and then the guest OS, located above the hypervisor.
A combination of native and hosted approaches is also possible. The hypervisor can implement some of its functions on bare equipment and access hosted systems to implement its other functions. A common example of this approach is the introduction of support for virtualization of processors on bare hardware and the use of a dedicated OS to access devices that the hypervisor virtualizes to other hosted systems.
Hybrid operating systems
Most operating systems today do not strictly adhere to one architecture, but are hybrids of several.
The Max OSX architecture relies on the Mach microkernel for basic system management services and the BSD kernel for additional services. Other functionalities of the OS are provided by application services and dynamically loaded modules (kernel extensions):
- The iOS operating system was developed by Apple for the iPhone and iPad. It works with less memory consumption and processing power than Max OS X, and supports touch-screen interface and graphics for small screens.
- Android OS was developed for the Open Handset Alliance Android smartphones and tablets, primarily Google. Android is an open source OS, unlike iOS, which has led to its popularity. Android has a Linux OS structure and a Java virtual machine optimized for small platforms. Android applications are developed using a special development environment for Java-for-Android.
Microkernels and modules
The main idea of microkernels is to remove all non-essential services from the kernel and instead implement them as system applications, thereby making the kernel as small and efficient as possible. Mach was the first and most famous microkernel, and now it is the main component of Mac OSX. Windows NT was originally a microkernel, but it suffered from performance issues (compared to Windows 95). Enhanced NT 4.0 performance by moving more services to the kernel has returned XP to a more monolithic one. Another example of a microkernel is QNX, a real-time OS for embedded systems.
Modern OS development is object-oriented, with a relatively small core and a set of modules that can be linked dynamically (for example, the Solaris structure). Modules are similar to layers in that each subsystem has clearly defined tasks and interfaces, but any module can contact any other module, eliminating the problems of passing through several intermediate layers. The kernel is relatively small in this architecture; like microkernels, it does not need to implement messaging, since the modules can communicate directly with each other.
File system manipulation
A file is a collection of related information. Computers can store files on disk (secondary storage) for long-term storage. Examples of storage media are magnetic tape, a magnetic disk, and optical disk drives such as CDs, DVDs. Each of these media has its own properties, such as speed, capacity, data transfer rate, and data access methods. The file system is usually organized into directories for easy navigation and use. These directories may contain files and other directions.
The main activities of the operating system in relation to file management:
- Reads or writes a file.
- Gives permission to the program to work with the file, which depends on reading, writing, failure.
- Provides the user with an interface for creating / deleting files.
- Provides an interface for backing up the file system.
In the case of distributed systems, which are a set of processors and do not use memory, peripherals or clocks, the operating system manages the communication between all processes.
Several processes interact with each other through communication lines in the network OS structure, process routing and connection strategies, as well as competition and security problems.
The main activities of the OS in relation to communication:
- Two processes often require data transfer between them.
- Both processes can be on the same computer or on different computers, but connected via a computer network.
- Communication can be implemented in two ways: either using shared memory, or by sending messages.
Functional Linux Operating System
This is the most famous and most used open source system. Many programmers use the term Linux to refer to the Linux kernel, as well as the set of programs, tools, and services that are usually shipped with the Linux kernel. Some users are part of this GNU collection, as many tools include GNU components. Although not all Linux installations use GNU components as part of the system. Android, for example, uses the Linux kernel structure and relies very little on GNU tools.
Linux is different from other systems:
- Open source. The OS is free and available for public viewing, editing by users with relevant skills.
- There are many Linux distributions that include various software options.
Unix and Linux are very similar in many ways, and in fact Linux was originally created in the same way as Unix. Both have similar tools for interacting with systems, programming tools, file layouts, and other key components. However, Unix is not free.
Over the years, several different systems have been created that tried to be unix-like or unix-compatible, but Linux was the most successful, far superior to its predecessors in popularity.
Most of the Linux kernel is written in the C programming language with a small number of assemblies from other languages. Each distribution contains hundreds or thousands of programs that can be distributed with it for each of these programs.
Types of Linux File Systems
The standard Linux distribution provides a choice of disk space with the file structure formats of the OS, each of which has a special meaning.
A progressive version of Extended Filesystem (ext), which was primarily developed for MINIX. The second extended version (Ext2) was an improved version. Ext3 added performance improvements, Ext4 provided even more advanced features.
Journaled File System (JFS) was developed by IBM for AIX UNIX. JFS is currently an alternative to Ext4 and is used where stable operation is required with very few resources. JFS is suitable for cases when processor power is limited.
ReiserFS was introduced as an alternative to Ext3 with improved performance and advanced features. There was a time when the default SuSE Linux format file was ReiserFS, but later the Reiser went out of business, and SuSe had no other option but to return to Ext3. ReiserFS dynamically supports file extension, which is a relatively advanced feature; the system lacked a certain performance area.
XFS is a high-speed JFS that focuses on parallel I / O processing. NASA still uses this OS file structure on its 300 terabyte storage servers.
The B-Tree File System (Btrfs) focuses on fault tolerance, entertainment management, system repair, a large repository configuration and is still under development. Btrfs is not recommended for production.
There are many file formats that are not available on Linux, but are used when working with other operating systems: VIS, NTFS from Microsoft, HFS from Apple. However, you can work with the OS file structure on Linux using certain tools, such as ntfs-3g, to mount NTFS file systems that are not privileged under Linux.
CPU. Sharing
The process of sharing a processor when two or more programs are simultaneously in memory is called multiprogramming. It involves the use of a single common processor and increases the load by organizing tasks.
The purpose of the OS, OS structures are associated with multiprogramming:
- The system simultaneously saves several jobs in memory.
- This set is a subset of jobs stored in the pool.
- The system selects and starts to perform one of the tasks in memory.
- Multiprogrammed operating systems monitor the status of all active programs and resources using memory management programs to ensure that the CPU will never work if there are no workflows to process.
This workflow helps to efficiently use the CPU.