Users when using computer equipment and mobile gadgets encounter such a term as initialization. In this article we will try to study in detail what this process is and its scope.

What is initialization

This concept means preparation for work and determination of application debugging parameters for error-free operation. The principle of its operation is directed from the outside relative to the object that is being initialized. First of all, this procedure responsible for setting up certain parameters and rules by which work will be carried out software.

There is also a concept called hardware initialization. It is best to consider it using the example of loading a personal computer: when the PC is connected to the mains, it does not perform any functions, controllers and microcircuits contain random numerical sequences, and the processor does not execute the given code. To boot your PC it is necessary for the processor to execute the Reset command. After it is implemented, the controllers will begin executing the specified code, and it will be written to a special volatile memory (ROM) storage. Data that is saved in ROM is transferred to the BIOS, where it is used to control external devices that are connected to the computer.

Hardware initialization is an important procedure that helps the system determine the types of connected devices and check their functionality.

Initialization directions

There are several directions:

  • initialization programs and applications all types;
  • hard magnetic drives;
  • devices and subsystems printing;
  • applications and modems on mobile devices.

Where is initialization used?

Below we will discuss in detail the situations in which this procedure is applied. In fact, there are many more similar options and special cases, for example, initializing a Flash player, a router when recording, a scanner when connecting, or a monitor driver. But we will consider only the main cases.

Programs

Initializing a program involves setting the initial values ​​of variables or resetting these parameters to zero before it is launched on the computer. The parameters for proper operation are often contained in special configuration file along with the installation kit.

HDD

To initialization hard drive You can include formatting it into a different file system format, creating a partition or volume. It is worth noting that this procedure is required for parameter settings new hard drive. This is necessary in situations where the equipment is not displayed in the explorer.

Print subsystem

Initialization for printing subsystems is necessary in cases where the user needs to print a document onto paper. To do this, you will need an external printing device – a printer. In order for the process to go smoothly, you need determine initial parameters. The system contacts the device and sends a signal to scan its capabilities. At the end of the procedure, the user is offered a printing option that the equipment can perform.

On the phone

Initialization on the phone, as a rule, is associated with determining the parameters of the SIM card, SMS messages and applications. This usually happens on first startup. mobile system or when installing programs. If the message “ Please wait, initialization in progress", this means that the software is being configured. It is also possible when connecting the phone to a modem or router to determine network settings.

Initializing download

This procedure is launched when downloading a file from the Internet, for example, through an Internet browser. In this case, packet data is exchanged between the user’s computer and the server where the downloaded files are located. Before downloading, the browser initializes and activates the link, allowing the object to be downloaded. Once on PC, it analyzed by the system, parameters and conditions for launch and installation are created.

Common initialization errors

Users often encounter various errors. An initialization error indicates that the synchronization or verification process failed. Next, the main problems with initialization experienced by owners of various devices will be discussed in detail.

Error 0x0175dcbb

Occurs when starting the SIMS 3 game, less often in other games. Associated with installing third party mods and with incorrect configuration graphics driver. The solution is to uninstall the extensions and reinstall the driver.

Print Error: Errors initializing the current printer

Most common when installing drivers printer via Wi-Fi. When installing the driver, the “Device Initialization” window pops up at the end of the installation. The solution is to install the driver via USB.

Page initialization error

This problem occurs among operating system users Windows Server. It is associated with a malfunction secure storage services. The fix is ​​quite easy, you just need to restart the service and restart the PC, the problem will be fixed.

Failed to initialize 3D rendering

This warning is associated with incorrect work drivers 3D-Accelerator. Applications that use this module simply cannot detect it. The problem can be easily resolved by restarting the video card driver in Device Manager or reinstalling it.

Application initialization error 0xc0000005

This message, like the previous one, is related to the graphics accelerator. Application during startup accesses RAM and is refused because access to it is blocked. Access can be blocked either by the operating system itself or by a video adapter configuration error. The solution is to reinstall the driver or restore the system to a state when such a malfunction was not observed.

SIM card initialization error

This glitch occurs among smartphone owners. Some time after starting the smartphone, an error appears - Failure to initialize, or similar. It lies in the fact that the phone does not see the installed card. This may be a consequence of either a software or hardware failure. To solve the problem, you need to restart the device or insert the card into a different slot.

In the operating room Linux system and other systems of the Unix family, after the kernel has completed loading, initialization of the Linux system, services and other components begins. The initialization process is responsible for this; it is launched by the kernel immediately after the boot is completed, has PID 1, and will be executed while the system is running.

The initialization process starts all other processes that need to be started, it is the parent process for everything running on the system. Other processes can also create child processes, but if the parent process exits, the initialization process becomes the parent for its child processes.

During the development of operating systems, various Linux initialization systems were created. Used on different distributions different systems. In this article, we'll look at the best init systems you can use right now. We'll start with older systems with less functionality to understand where it all began, then we'll move on to newer ones that have been created more recently.

System V or SysV is a fairly old, but still popular initialization system for Linux and Unix-like operating systems. It was the basis for the creation of many other init systems, as well as the first commercial init system developed for Unix at AT&T. It was developed back in 1983.

Almost all Linux distributions natively used SysV. The only exception was Gentoo, which used its own init system and Slackware, with BSD-style init.

Main features of SysV:

  • Writing service startup files in bash;
  • Sequential start of services;
  • Sort startup order using numbers in file names;
  • Commands to start, stop, and check the status of services.

No parallel loading, dependency system, launch on demand and automatic start there was no trace of it here.

Many years have passed since its development and due to some shortcomings, other systems were developed to replace it, although they had new functions and were more efficient, they were still compatible with SysV.

2.OpenRC

OpenRC is an init system for Linux and Unix-like operating systems, compatible with Sys V Init and supporting a dependency system at startup. It brings some improvements to SysV, and like other Linux init systems, it is compatible with it, but you should keep in mind that OpenRC does not completely replace the /sbin/init file. This init system is used in Gentoo and BSD distributions.

Except standard features SysV, also supported here:

  • Service dependency support;
  • Support for running services in parallel;
  • Supports configuration in one separate file;
  • Works like a demon;

Compared to SysV, many new features have appeared here, but still not all those needed for optimal performance systems.

3. Systemd

Systemd is new system Linux initialization. It was introduced by default in Fedora 15, and is now used in almost all popular Linux distributions. It is not only an initialization process that supports a huge number of capabilities, but also a set of tools for managing services and these capabilities from the system. The main goal is to have complete control over all processes during their launch and throughout their execution.

Systemd is very different from all existing init systems in the way it works with services, and even service configuration files. There is no compatibility with SysV scripts; they need to be converted to linux systemd unit files.

Here are its main features:

  • Clear, simple and effective design;
  • Best APIv;
  • Termination of additional processes is supported;
  • Supports native journaling using journald;
  • Supports job scheduling using Systemd timers;
  • Storing logs in binary files;
  • Saving the state of linux systemd services for possible recovery;
  • Improved integration with Gnome;
  • Launching services on demand;

4.Upstart

Upstart is an event-based init system developed by Canonical to replace SysV. It can start system services, perform various tasks on them, inspect them during execution, and also perform necessary actions in response to events in the system.

This is a hybrid init system, it uses both SysV startup scripts and Systemd service files. Here are its most notable features:

  • Originally developed for Ubuntu, but can be used on other distributions;
  • Start and stop services based on events;
  • Generating events when services start and stop;
  • Events can be dispatched by normal processes;
  • Communication with the initialization process via DBus;
  • Users can start and stop their processes;
  • Restarting services that ended unexpectedly;
  • Automatic restart of services;

Most of its features work through integration with the Systemd init system.

5. Runinit

Runinit is a cross-platform init system that can run on GNU Linux, Solaris, BSD and MacOS. This great alternative for SysV with support for service status monitoring.

There are some here interesting features, which are not found in other initialization systems:

  • Full control of services, each service is linked to its own directory;
  • Reliable logging and log rotation tool;
  • Fast boot and shutdown system;
  • Portability;
  • Easy creation of service configuration files;
  • A small amount of initialization system code.

conclusions

As I said before, the init system starts and manages all other processes on a Linux system. SysV until recently was the main init system in most Linux distributions, but due to some of its shortcomings, several replacements have been developed for it, including Systemd.

What Linux init systems are used in your distribution? Not all are included in the list existing systems, which one should be added to the list? Write in the comments!

After the kernel boot has completed, which we handled in the last update, it is time to initialize the system. It begins by launching the init process, which is carried out by executing the file of the same name /sbin/init. Let's look at his regular tasks.

The first of these tasks, both in execution time and in value, is checking the integrity of existing file systems. To begin with, each of them is checked for the presence of a “clean unmount” bit (clean byte), which is automatically set during the correct termination of the previous session. If such a bit is found on every file system, everything is fine, things move on. If not, a forced check of the incorrectly unmounted file system is launched.

It should be noted that the “clean unmount bit” itself does not at all guarantee the safety of the file system and, especially, its data. It only shows that the file system was correctly unmounted in the previous session. In this case, the init process makes the reasonable assumption that its metadata and data are fine, and moves on to the next task. However, with the now generally accepted use of journaled file systems, the “clean unmount” bit is always present.

And the next task of the init process is to call and run initialization scripts, or startup scripts, collected in the /etc directory and its subdirectories. These are ordinary shell scripts, designed to be executed by a standard shell (/bin/bash on Linux). They include sequences of commands designed to mount file systems, activate the swapping area, set the system clock, launch certain services and daemons, including network connections.

The commands that make up the startup scripts receive their options, their values ​​and arguments from special files configurations, also located in /etc and its subdirectories. Configuration files (or simply configs) are either simple databases of options and command arguments, or lists of variable names (corresponding to command options used in scripts) with values ​​assigned to them. Configs are easily distinguished from scripts when viewing the /etc directory by the absence of the execution bit in the former.

For example, a mandatory procedure at the stage of working out initialization scripts is to mount (and remount) the necessary file systems in read/write mode - because, as we remember from the previous chapter, when the kernel is loaded, the root file system supporting it is mounted in read-only mode. This is done by direct directive

# /sbin/mount -a which specifies to mount all file systems, and is part of one of the startup scripts. Which one depends on the system, and over time we will figure out where it is in our case). But what is meant by the word “all” (the option name -a is from all) - that is, a list of arguments (devices and mount points), as well as options with which a particular file system should be mounted - and makes up the contents of the /etc/fstab configuration file.

This is a very simple database, each entry corresponding to a filesystem to be mounted, and the fields delimited by space(s) or tab characters are as follows:

  • the file name of the device carrying the file system;
  • mount point - a directory in the file hierarchy;
  • file system type;
  • mount options (often set to default).
The contents of the first two fields of each entry are passed to the mount command from the startup script as its first and second arguments, the remaining two as options, required (file system type) and optional (all others).

Consistent separation of startup scripts and their configuration files is one of the cornerstone principles of system-wide configuration. In essence, during the normal course of configuration, there is practically no need for the user to get acquainted with the contents of the scripts (although this is not harmful), nor, even more so, to change anything in them (the latter is only permissible if this same user knows for sure what it does, otherwise the system can easily be rendered inoperable). But making changes to the values ​​of parameters of configuration files is not only possible, but also necessary, and, as we will soon see, different ways. Of course, such permission does not relieve the user of understanding the meaning of his actions.

Finally, the third essential task of the init process is to ensure user registration in the system, which can also be done different ways: in a text console or via graphic managers sessions.

The described initialization sequence occurs if it proceeds smoothly—if no errors occur at any of the stages. The most serious consequences will be caused by errors when mounting file systems, the usual source of which is an incorrect description in the /etc/fstab file (that is, elementary typos) or the lack of support by the kernel (or its module) for the type of file system that bears the root of the file tree. In the latter case, the kernel will go into panic (the so-called Kernel panic) and it will be impossible to continue loading.

Errors in the execution of initialization scripts usually lead to the fact that the service whose startup script failed will simply not be available after the system boots.

Finally, errors during preparation for user registration are also quite unpleasant, and, as a rule, lead to the impossibility of starting normal work.

However, there is no reason to panic in any of these cases - even if the core goes into panic. All possible errors during system initialization can be corrected in one way or another. Because light flirting, including with the operating system, like a runny nose, is tolerated on the feet, and bed rest is necessary only in severe cases. In some situations it is enough to complete the boot process and slightly change the settings, in others it is enough to boot into single-user mode, in others you will have to boot from rescue media (for example, LiveCD). But surgical intervention, that is, a complete reinstallation of the system, will most likely never be required.

The flip side of system initialization is stopping or restarting it; there are practically no differences between these processes. And the shutdown command is responsible for it, which can be given on behalf of the superuser or a member of the operator group. With the -h option it causes the machine to stop, with the -r option it reboots. And this command also requires an argument - the time when the stop or restart should occur. However, there is a way to instantly stop or restart:

# shutdown -h now or # shutdown -r now respectively. It is the last command that is processed when the machine is rebooted from the keyboard using the "Salute from three fingers", as Patrick Volkerding puts it.

In addition, there are also halt and reboot commands with the same purpose. However, they do not play an independent role, simply calling the shutdown command with the option to stop and reboot, respectively.

The system stops in the reverse order of its initialization. First, an attempt is made to correctly terminate all running applications, and if this is not possible, they are force termination. Then all starting services and daemons are stopped. Finally, the contents of the disk caches are written to disk and the file systems are unmounted. After this, a message about the possibility usually appears safe shutdown machine power supply or it turns off automatically. When restarting, everything happens exactly the same, but after the system stops, the machine automatically reboots. The entire shutdown and/or restart process is defined by scripts similar to the initialization scripts.

For many years, one of the first safety regulations was that it was prohibited to stop by simply turning off the power. And indeed, until recently this was fraught with various troubles.

However, the modern Linux kernel supports ACPI (Advanced Configuration and Power Interface) power management. It makes it possible to stop the system by simply turning off the power to the machine - by pressing Power buttons on the computer case (but in no case to switching the power supply toggle switch or pulling out the power cable), the system reacts in exactly the same way as to the shutdown -h now command. In particular, in Zenwalk this procedure is performed absolutely painlessly. Of course, on more or less modern hardware.

To understand the system initialization process, the concept is very important runlevels. This is one of those terms, any Russian translation of which can only confuse a novice user. Because frequently used translations like run levels or loading levels create the impression that the system, during the initialization process, sequentially goes through certain stages corresponding to them. In fact, these are sets of the very same scenarios that we talked about above, and which are executed in a given situation.

Calling a certain runlevel, that is, such an interconnected group of scripts, is carried out when the system is initialized with the /sbin/init program. And these groups themselves are described in its main configuration file - /etc/inittab, which describes the entire course of the init process - from checking file systems to preparing for registration.

Theoretically, the init process calls seven runlevels- from zero to six, although it seems that not one distribution uses all of them. Three of them have fixed groups of scenarios for a specific purpose:

  • 0 - halt, that is, stopping the system;
  • 1 - single user mode, that is, single-user mode;
The use of the rest is left to the creators of the distributions. This is what we will now see using the example of our hero, the Zenwalk distribution. To do this, let’s take a closer look at the structure of its /etc/inittab file.

After all sorts of copyright notices, it first lists all the runlevels and explains their significance for the Slackware distribution, since in Zenwalk, its direct descendant, they differ only in details. So we will focus on these details:

  • 0 = system stop;
  • 1 = single-user mode;
  • 2 = not used, but configured similar to runlevel 3;
  • 3 = multiplayer text mode;
  • 4 = multi-user graphical mode with authorization through the GDM session manager;
  • 5 = not used, but configured similar to runlevel 3;
All these lines are closed with comments, that is, they are provided for reference only. And now the lines that actually define the configuration begin. The format for any of the lines in /etc/inittab is as follows:

identifier:runlevel:action:running process

Not all rows have values ​​assigned to each field.

To begin with, the default runlevels are defined. In Zenwalk, unlike Slackware, the default “default” level is 4, which is described by the following line:

Id:4:initdefault: If you need to switch to loading in text mode (this can happen if there are failures graphics system), it should be replaced with the line id:3:initdefault: What follows is a series of lines describing which scripts should be run for each of the runlevels involved and some other events, such as:

  • system startup (executed in any case, regardless of the default runlevel);
  • loading into single-user mode or switching to it from any multi-user mode;
  • loading in any of the multi-user modes;
  • “three finger combinations” (Three Finger Salute, according to Patrick Volkrding);
  • normal system shutdown;
  • ordinary soft reboot;
  • emergency power outage;
  • restoring power after a failure.
We will consider these scenarios themselves in one of the subsequent chapters devoted to setting up the system itself, especially since most likely nothing will have to be changed here.

In the meantime, let me just say that the transition from one runlevels to another is carried out by the command

# /sbin/init # where # is the required runlevel. For example: # /sbin/init 0 will cause the system to stop, similar to the command # shutdown -h now command # /sbin/init 6 will reboot it, as with the command # shutdown -r now and the command # /sbin/init 1 will switch to single-user mode - a situation that sometimes has to be resorted to in practice. However, this is not a specific feature of Zenwalk, but a common property of all Linux systems.

c1:1235:respawn:/sbin/agetty 38400 tty1 linux c2:12345:respawn:/sbin/agetty 38400 tty2 linux c3:12345:respawn:/sbin/agetty 38400 tty3 linux c4:12345:respawn:/sbin/agetty 38400 tty4 linux c5:12345:respawn:/sbin/agetty 38400 tty5 linux c6:12345:respawn:/sbin/agetty 38400 tty6 linux

There are six of them by default. Why “as if” - we’ll see now: in the runlevels field of all lines all levels available to users are listed, and only the first of them skips runlevel 4. But it is the default one in Zenwalk. This is due to the fact that the first virtual terminal is reserved to run the X server and session manager.So in normal life, only 5 virtual terminals are available to the user.

However, since Zenwalk is focused on working in graphic mode, this is quite enough. Moreover, the number of virtual terminals can be reduced: to do this, just close the corresponding lines with comments.

If necessary, no one forbids increasing the number of consoles: to do this, just add the required number of lines, not forgetting to change their identifiers.

Let's also pay attention to the action field: the respawn value, which means automatic restart of the process if it ends. That is: upon completion of the user session on any console, an authorization prompt immediately appears.

The last line defines the script when starting graphics mode:

X1:45:respawn:/etc/rc.d/rc.4 You can see that it is confined to levels 4 and 5, and also entails “self-recovery” at the end of the session.

At this point, the consideration of system initialization can be considered complete. If I missed anything, I would appreciate pointing out the spaces. I will only add that this issue is covered in detail in Vladmir Popov’s article Init et cetera or About Linux boot styles. The date should not confuse her - nothing fundamentally new has changed in distributions that do not use upstart or initng.

When creating programs, you must know the basic terms of computer terminology. Take for example the term initialization. Do you know what it means? This article will help you understand its meaning. Let's figure out what professionals mean by this term, what types of initialization there are, and also deal with the most common problems associated with this process.

What is initialization?

This term today refers to the processes of activation, creation, preparation for work, and determination of the required parameters for high-quality and error-free operation of the application. Initialization is a necessary step towards bringing any program or device into a usable state. The very principle of operation of the initialization procedure is directed from outside the object. Most often, this word refers to the setup process required parameters, as well as setting the basic operating rules by which this program will function.

Initialization: examples

Let's see what initialization is. The easiest way to understand this issue is with clear examples.

1. Initializing a hard drive is the process of formatting it. This may also include recording control information, such as volume labels, track descriptors, and other manipulations.
2. Program initialization involves setting the necessary variables or setting program variables such as counters, addresses, and switches to zero. Everything is installed according to what needs to be done for this type of software. Installation instructions may be contained in the file itself.
3. Initialization of the printing subsystem for output to the printer. This operation means the following: it is necessary to transfer data onto paper using some kind of device and take into account all the needs. For example, it is necessary to determine the extension, paper type and many other parameters. First of all, a special control signal is sent to the device, after which its capabilities are scanned. This is done in order to fulfill initial setup printing device and offer the user the appropriate option, which this type technology can implement.

Let's consider in practice the case of launching applications. Suppose at startup computer game An initialization error occurs. As an example, consider the game The Sims 3. This application today it is very popular. For what reasons might an initialization error occur in this case? The most common variant of this problem is error code 0x0175dcbb. This number used to indicate the error number associated with application initialization. It most often occurs due to the fact that the game conflicts with drivers, add-ons and mods. Even those users who prefer to use licensed games are not immune from this problem.

The license does not lead to automatic solution such problems. What to do if an initialization error occurs? Let's figure out how to remove this error. Although in this case we will be looking at a game, the recommendations given are quite useful when working with more serious applications. It is worth remembering that the oldest problem is the use of archaic program components. First of all, we will be interested in video card drivers. They can be downloaded from the official website of the manufacturer. It would also be a good idea to install NETFramework, updated to latest version. It is advisable to download this component from the official website of the developer - Microsoft.

Let's look at the most popular reasons for this problem: these are additional mods that are written by third-party developers. In this case, unfortunately, you will have to remove the extension itself. If there is information that makes you not want to do this, then you can try simply renaming the Mods folder. If this error occurs after installation, you can try to remove the program using the uninstaller, and then try to reinstall the program again. If this measure does not help, then the disk on which the game was recorded may be damaged. In this case, the only reasonable solution would be to change it.

Conclusion

Only you have to decide what to install on your Personal Computer. But before adding content created by third-party developers to your computer, it is recommended that you be especially careful about the quality of the add-ons you download. An update initialization error may occur. As a rule, there is no rollback option in this case. Then you will have to delete this program and install it again. If you decide to do this, you need to take special care of the safety of the accumulated information. A copy of the data must be placed in a secure location, such as a flash drive.

The system that runs all other processes. Runs as a daemon and usually has a PID of 1. Typically (according to the Filesystem Hierarchy Standard) located at /sbin/init. There are differences in the organization of the subsystem in operating systems descending from System V and BSD-style systems.

For a long time it was the main initialization subsystem in Linux, until it was replaced by systemd in most distributions. Solaris 10 uses the Service Management Facility instead of init. A number of Unix systems use alternatives to init: Upstart, Runit, Daemontools, Launchd, Initng, OpenRC.

During the boot process, after the kernel is initialized, /sbin/init is typically launched as the first user-mode process, and init is responsible for further booting the system. To do this, startup scripts are launched that check and mount file systems, launch the necessary daemons, configure the kernel (including loading kernel modules according to the installed hardware, setting up IP addresses, routing tables and other tasks), and launch the graphical shell. Basic boot information is usually located in /etc/inittab.

The System V style implementation of init uses the concept of run level - load level operating system; in this case, the starting scripts for each level are arranged in directories from /etc/rc0.d to /etc/rc6.d, where the number after rc corresponds to the number of the initialization level.

inittab

Example /etc/inittab file:

id:5:initdefault: si::sysinit:/etc/rc.d/rc.sysinit l0:0:wait:/etc/rc.d/rc 0 l1:1:wait:/etc/rc.d/rc 1 l2:2:wait:/etc/rc.d/rc 2 l3:3:wait :/etc/rc.d/rc 3 l4:4:wait:/etc/rc.d/rc 4 l5:5:wait:/etc/rc.d/rc 5 l6:6:wait:/etc/rc .d/rc 6 1:2345:respawn:/sbin/mingetty tty1 2:2345:respawn:/sbin/mingetty tty2 3:2345:respawn:/sbin/mingetty tty3 4:2345:respawn:/sbin/mingetty tty4 5:2345:respawn:/sbin/mingetty tty5 6:2345:respawn:/sbin/mingetty tty6 x:5:respawn:/etc/X11/prefdm -nodaemon

The first line describes the terminal and its default configuration. This file first describes the initialization levels. The virtual consoles are then initiated. The console initialization record consists of colon-separated fields and looks like this:

  • 1 - console serial number
  • 2345 - numbers of initialization levels for which the console is initialized
  • respawn - this option means that init should restart the process serving the console after logging out of the session or in the event of a crash.
  • /sbin/mingetty tty6 - a program (with parameters) that will serve the console.

Thus, you can easily create your own initialization level (numbered 4 or 7, 8...) simply by editing the /etc/inittab file and creating the necessary links in the /etc/rc.d/rc*.d directory.

SysVinit

Compared to its predecessors, AT&T UNIX System III introduced a new style of system startup configuration, which continued (with changes) into UNIX System V and is therefore called " SysVinit ».

At any moment, the operating system V is in one of the predetermined states called runlevel. At least one execution level is the normal operating state of the system; Typically, other runlevels represent single-user mode (used to recover a faulty system), system shutdown, and various other states. Switching from one runlevel to another causes a set of scripts to run for each runlevel, which typically mount file systems, start or stop the daemon, start or stop the X Window System, shutdown the machine, etc.