How does the Windows operating system load? What is BIOS and UEFI. How to boot a computer. Turning on the computer, POST, BootMonitor

Tired of Windows 7,8,10 loading slowly? YES, the more time the operating system is installed, the more this topic begins to torment. Computers are becoming more powerful and productive, but at the same time the demands for programs that are developed for new equipment are also growing. For example, Windows XP boots an order of magnitude faster than Windows 7/10 on the same hardware.

So now, should we give up new features for the sake of fast loading of the operating system? No, fortunately, there are tricky and not so tricky tricks that will help us solve this problem. In this article, you will learn how to programmatically reduce Windows boot time to 20 seconds or less.

Step one, services and processes

In Windows OS, unnecessary services are often launched, which slow down the loading and operation of the system. There is also support for a variety of hardware, so the services that ensure it works properly start with the system. Of course, if the system considers that the service is not necessary (since there is simply no corresponding device on the computer), then it is disabled. But starting, checking and stopping the service still takes time.

We launch the “System Configuration” program, to do this, press “Win ​​+ R”, write in the window: msconfig and press Enter. To disable temporarily necessary services, go to the tab of the same name:

But you need to understand which services can be turned off and which need to be left running. It is easy to find information on the Internet for most services, so I will not dwell on this in detail. I’ll just say: don’t rush and turn off everything, this can have a sad effect on the operation of the operating system.

Using the same logic, we disable programs that are loaded at system startup on the next “Startup” tab. More details are provided in a separate article. You will need to restart your computer to apply the new startup settings.

Step two, registry

There is a weak point in Windows - the registry. It just so happened from ancient times that most vital Windows settings stored in a hierarchical database. Both the loading speed and the operation of the Windows OS as a whole directly depend on the speed with which the OS finds the necessary entries in the registry.

It is not uncommon for program uninstallers to work ineffectively, leaving entries in the registry about their presence and work (parameters, registered libraries, binding to certain file extensions, etc.). Such records can be considered garbage, cluttering up the database. And you need to get rid of this garbage, for which you should use utilities such as, for example, Reg Organizer, CCleaner, Ashampoo WinOptimizer and others.

Launch CCleaner, go to the “Registry” section, click “Search for problems”, and when finished click “Fix selected”:

During such cleaning, and simply while Windows is running, the registry is constantly subject to fragmentation. This means that you will need to DEFRAGMENT the registry. This can be done using the Defraggler program, from the same developer. However, I will make an important note that in some cases, “cleaning” the registry may also affect important parameters. Therefore, be sure to first, and in case of problems in Windows work you can immediately recover to your previous state.

Step three, the main one

Now you can begin to deeply optimize the process of loading the system and programs. During application execution, many side effects can occur, such as long loading of additional libraries and routines, conditional branch prediction, cache misses, and the like. Analyzing such data is called profiling.

Since the OS in question was created by Microsoft, we will use a profiler created by the same company - Windows Performance Toolkit. Recently, this tool has become part of the Windows SDK. You can download the web installer from the Microsoft website.

It is not necessary to install all the included components; you can only get by with the Windows Performance Toolkit

This tool allows you to trace the boot of the operating system from the very beginning. We need the executable file “xbootmgr.exe”, which is located in the folder where you deigned to install the Windows Performance Toolkit; by default, it is located in the directory “C:\Program Files\Microsoft Windows Performance Toolkit\”.

Watch the video or continue reading the article:

To call the utility, run xbootmgr.exe with a parameter, for example, the “-help” parameter will display a list of all possible functions. To do this, press the “Win ​​+ R” buttons or go to the “Start -> Run” menu and enter the command in the window:

xbootmgr –help

It is not necessary to add the path to the file if it starts like this:

Just for fun, if you want to see how your system behaves when running in this moment, then run the command:

xbootmgr -trace boot

It will reboot your computer and collect data during startup. The result of her work can be seen in the file boot_BASE+CSWITCH_1.etl, which xbootmgr will save in its own folder or in the “C:\Users\yourname” folder. This file contains all the information about the behavior of programs when the system starts, you can see a lot of interesting things. To do this, double-click on the file to open the Analyzer:

If you are interested, study the information, here is everything in great detail about the download process: how many seconds it took to start each process, how computer resources were used, etc.

Now let's get down to business - let's start the process of automatically analyzing and speeding up Windows loading. Run the command:

xbootmgr -trace boot –prepsystem

During optimization, by default, 6 reboots will be performed and 6 files with information about the behavior of programs at each reboot will be saved in the same directory. This whole process is quite lengthy, but does not require user participation. You can successfully have lunch while the program is running. And don't forget to check first that there are a couple of Gigabytes free space on drive "C:"!

After reboots, messages will appear in a white window, for example “Delaying for boot trace 1 of 6” with a countdown:

In this case, you don’t need to try to work on your laptop, just wait. More messages will appear. At the second stage, the “Preparing system” window hung there for about 30 minutes, while the processor was not loaded with anything, but then a reboot occurred and the remaining stages went quickly. In reality, the whole process can take an hour.

What does Xbootmgr do? It does not disable unnecessary services and processes, as it might seem. Xbootmgr optimizes booting so that maximum computer resources are used at any given time. That is, so that it doesn’t happen when the processor is 100% loaded and the hard drive is resting, or vice versa. Also happens. After the last reboot, you don’t need to do anything, Windows will boot, and even work, faster.

Step four, dangerous

The seven, as well as XP (although not everyone realizes this), has support for multi-core processors. It is not clear why the system itself is not always able to use all available resources when it starts, but only begins to use them when it has already fully loaded and the user has started working.

This means we need to help her use the available resources in the system startup parameters. To do this you need to delve into the configuration. Using the key combination “Win ​​+ “R”, open the “Run” window and write the command msconfig, click “OK”. In the system configuration window that appears, select the “Download” tab

Select "Advanced options"

In the window that appears, set the “Number of processors” and “Maximum memory” parameters to maximum. Now attention! Close and open the program again, see that the “Maximum memory” value has not been reset to “0”. If so, then uncheck this box, otherwise the system may won't start at all. Reboot, done.

Note: If you decide to add RAM or replace the processor with a different one (with big amount kernels), then the above parameters will need to be changed. Otherwise, the system simply will not use additional memory and/or additional processor cores.

It will not be possible to run from one operating system to another for a long time if there are two of them installed on the computer. After carefully studying both, sooner or later you will have to choose only one of them - main, with which the work will be carried out primarily. If for the most part only one Windows system is used, its other versions or editions located on other disk partitions, does not have to be deleted. Of course, provided that the space hard drive not limited in size.

The ability to work in the future with other computer systems can be left, but for convenience, it is possible to simplify the entrance to the main one by removing temporarily unused ones from the boot. In this case, starting the computer will be simplified by automatically loading only the required operating system. Another option to make it easier to get started with your computer is not to remove the window for choosing to boot all systems, but to designate the desired version of Windows as the default boot one and reduce the time it takes to select other options in the bootloader window.

How to edit the boot process for multiple operating systems Windows systems installed on one computer - more on this below.

So, in our case we have a computer with installed versions Windows 7 and 8.1. When you turn on the computer, you see a bootloader window with a list of systems to select.

Every time you boot your computer, you get into the right system possible by making the appropriate choice. Otherwise, after a certain time has elapsed - and by default this is 30 seconds– Windows will automatically load, first on the list. In our case it is Windows 7, since it is the last one installed on the computer, and it is its bootloader, as we see, that greets us after the computer starts.

Well, let's change that. Let's set up automatic loading of the main system - Windows 8.1. To do this, of course, you need to enter it.

We need a settings section, and in Windows 8.1 you can get to it using the context menu on the button.

In the system window select Extra options.

You can also get to the settings section in Windows 7 using the context menu, but called up on the icon "Computer" in Explorer. Among the commands you must select .

In Windows 7 we also select Extra options.

The further steps in both systems are identical.

In the system properties window that appears, in the tab "Additionally" Click the parameters button in the last section.

Now you can start editing the boot of multiple systems. Change the default Windows boot from the options in the drop-down list. In our case, we change the pre-installed Windows 7 to Windows 8.1.

As mentioned, by default Windows boot loader waiting half a minute so that the user can select the operating system.

If work is primarily carried out in only one system, there is no point in leaving half a minute waiting for it to automatically load. Another operating system may not be prevented from starting, but the preset time for selecting boot options may be reduced. In displaying the list of bootable systems, in our case we will install 5 second Waiting before Windows 8.1 main system boots automatically. This time will be more than enough to make a choice if you ever need to log into Windows 7.

To completely remove another system from the boot list, you need to uncheck the option display system list. In this case, only the system selected for booting by default will boot without any time delay.

If a second operating system is ever needed, you can enter it by making this option active again.

After making changes, click "OK" at the bottom of this window, as well as at the bottom of the system properties window.

Everything - download list operating systems edited.

Above we looked at editing the boot of existing operating systems. But often, when starting a computer, we can see a list of operating systems that are already on the computer No. This is a natural development of events after the second operating system was removed by simply formatting the disk partition or destroying it. system files manually, but at the same time The entry about the possibility of loading it in the system configuration was not removed. The boot loader may also display the option to start a non-existent main Windows after the system has been reinstalled. This, by the way, is not the main one, but one of the reasons why system specialists advise performing a so-called clean installation of Windows - without saving files previous system and formatting the disk partition.

It is better to completely remove the existing operating system from the boot options so that it does not delay the process of starting the main Windows.

In the main system we call the command. On Windows 8.1 fast access it is implemented in the context menu on the button.

We need system configuration section. Enter the value in the command field:

Click "OK".

In Windows 7, you can launch the system configuration window more easily by entering a key query in the menu search field.

The system configuration window will appear, go to the tab. Select the entry about loading a non-existent system and delete it.

In our case, the download list contained different versions Windows, and decide on the one to be deleted "Seven" It obviously wasn't difficult for us. But if the download list contains entries about two identical Windows versions, descriptions of the systems will help in orientation with the one that needs to be deleted. The Windows we are actually in will be designated as current.

Save the changes made with the button. After clicking "OK" the system will offer reboot.

After restarting the computer, we can observe immediate startup of the main system.

Have you ever wondered what happens to the operating system at the moment when it draws its logo and says “Starting Windows”? And in general, why does it take so long to load? After all, when the system starts, no problems that are complex from a computational point of view are solved!

What then does loading the operating system mean? For the most part, this involves mapping executable modules into memory and initializing service data structures. Data structures live in memory, so operations with them should, in theory, be fast. Everything suggests that time is consumed precisely by the process of loading executable modules into memory.

For fun, let’s figure out which modules, in what quantity and in what order are loaded when the OS starts. To find out, you can, for example, get the system boot log. The test OS in my case is Windows 7 Enterprise x64. We will log the boot process using the kernel debugger. There are several options for kernel debuggers, personally I prefer WinDbg. We'll also need some tools to magically transform the log into something more pleasing to the eye.

Mining and crafting

Setting up debugging is easy to Google, so I won’t describe this process in detail. Since we are interested in everything that happens from the moment the system starts, we need to check the “Cycle Initial Break” item, with the help of which the debugger will stop as soon as the kernel debugging subsystem is loaded in the system being debugged. Duplicating the output to a file can be done using the ".logopen" and ".logclose" commands, it's simple. Other useful command- ".cls". It clears the command screen, and yes, only the command screen.

The function we are interested in is “MiCreateImageFileMap”. This is an internal function of the memory manager that maps the executable file into memory. Memory projection occurs when a section is created, for example, at startup executable file. However, please note that just because an executable file is mapped into memory does not guarantee that its code will be executed! This function simply creates a projection, most often “in reserve,” so that if someone decides to run the module for execution, it can save loading time. Let's set a logging breakpoint on this function.

If you have enough mana, enter the following command:
bu nt!MiCreateImageFileMap "dt nt!_EPROCESS -d ImageFileName @$proc; dt nt!_FILE_OBJECT -d FileName @rcx; g"
The magic line literally means the following:

  • bu (Set Unresolved Breakpoint) - set an unresolved breakpoint. It’s not that someone or something doesn’t allow it, it’s just that to install it you need to decide at what address to put it. The fact is that it is not known in advance at what address it should be located. When loading any module, the presence of required function, and if such a function is found, a breakpoint is set automatically. This installation method is indispensable when ASLR is enabled - address space randomization, since the modules will be loaded one by one each time different addresses, and a breakpoint set at a fixed address is likely to fail.
  • nt!MiCreateImageFileMap is the symbol to stop at. WinDbg accepts an entry in the form "module_name!function_name". In this case, nt is a predefined alias for ntoskrnl.exe.
  • What follows is part of the WinDbg script, which will be executed every time this function is stopped. “dt nt!_EPROCESS -d ImageFileName @$proc” in Russian means “display the ImageFileName field of the _EPROCESS structure from the nt module, provided that it is displayed at the address defined in the “current process” pseudo-register.” Next after the separator ";" the command means approximately the same thing, only the address of the structure is taken from the rcx register, in which the first parameter of the function is passed to the Microsoft x64 ABI. "g" means "go", i.e. continue execution.

A quick tip for using logging breakpoints: try not to use debugger extensions (commands starting with "!"), as this will make logging an order of magnitude slower.

Go! Release the breakpoint brake and wait. I waited until the desktop loaded, i.e. I'm logged in. The resulting “harvest” is slightly edited, all unnecessary is cut off for the convenience of further processing and fed to the python. Let's not focus on parsing the log. Let us only note that the graph fit into the shape of an Archimedes spiral with further manual correction, since the nodes overlapped each other. The resulting graph takes into account the order in which the libraries are loaded. Unfortunately, we had to sacrifice taking into account the loading order of executable files relative to libraries for the sake of readability of the graph.

Star map


Let's tentatively select several loading groups.

The OS starts working in the ntoskrnl.exe module, which is the core of the OS. And to be even more specific - from the KiSystemStartup() function. Together with downloadable system components, it forms the foundation of the OS: separation of operating modes, basic services for user applications, etc. This group also includes drivers marked for loading during system startup. In a nutshell, Windows OS is born in this shell.

The next node is the session manager. He is introduced by the first one after system process, starting in Windows - smss.exe. The process is notable for being native. Windows process, that is, it does not use the Win32 subsystem, which is generally not loaded yet. This process uses only native operating system services through ntdll.dll, which is the user mode interface to OS services. This process is also a trusted component of the operating system and has exclusive rights, for example, it can create security tokens. But its main purpose is to create sessions and initialize subsystems, both graphical and various executable ones (Windows, POSIX). This shell meets everyone's needs.

A logon group consists of several processes. In general, they are responsible for initializing sessions. This includes displaying the welcome screen, creating desktops, starting startup processes and initializing the security subsystem, etc. This broom sweeps away all strangers.

The group of services turned out to be the most massive. It owes much of its volume to the SuperFetch service. This is the one about which they say that she loads in advance on weekends office suite, and at the beginning of the work week - Steam with toys. Superfetch loads a huge number of modules when the system starts, so that later “everything works faster.” And besides it, the system has enough service applications and auto-starting drivers. I think everyone has seen the Services and Applications snap-in. This star of life brings into the system everything that is needed and not so much.

The last one I’ll mention is everyone’s favorite explorer.exe. It is noteworthy that by the time it starts, all the modules it uses are already loaded into memory. The screenshot also included a certain vcredist_x64.exe - the poor fellow was lying on the desktop of the experimental virtual machine and was loaded into memory by the conductor.

In general, there are many ways for a module to be loaded into memory. For example, it is enough to request information from the resources of the executable file, including its icon. Specifically in in this example Explorer checked whether this program requires elevated privileges, i.e. Is it worth adding a corresponding picture with a yellow-blue shield to the icon? Let me note once again that loading a module into memory does not mean executing its code!

Personally, I keep the resulting picture close by. It clearly shows dependencies, for example, of drivers. Also, paired with the Sysinternals Autoruns utility, you can see at what stage of loading certain modules are pulled up.

The download graph was built for Windows 7 Enterprise x64 installed on virtual machine VMware. Below are vector image graph and directly a file in gml format, which you can play with in any graph editor.

The operating system files are located on a disk (hard or floppy). However, programs can only run if they are in RAM, so the operating system files must be loaded into RAM.

When you turn on your computer, it tests its devices and tries to boot into the OS, the program that controls the computer.

This process is called bootstrap. It runs automatically when you turn on the computer's power.

After turning on the computer, the operating system is loaded from system disk into RAM, which must be executed in accordance with the boot program.

The computer contains a read-only memory (ROM) that contains programs for testing the computer and the first stage of loading the operating system, which are called BIOS ( basic input/output system). The ROM is located on the system board and is powered by a battery, so the programs recorded in it are not erased when the computer is turned off.

After turning on the computer, these programs begin to execute, and information about the progress of this process is displayed on the display screen. First, the hardware is tested and configured, then the operating system starts loading.

At this stage, the processor accesses the disk and looks in a certain place (in 1 sector of the disk) for the presence of a very small bootloader program Master Boot. If the disk is a system one, then Master Boot appears in place, is read into memory, and control is transferred to it. In turn, Master Boot searches for the main boot loader on the disk Boot Sector, loads it into memory and transfers control to it. Next, the main boot loader searches for the remaining operating system modules and loads them into RAM.

If a non-system disk is inserted into the drive or there is no disk at all, a message appears on the monitor screen: Not system disk, and the computer freezes.

After the operating system has finished loading, control is transferred to the command processor. If you use the interface command line a system prompt appears on the screen, otherwise it boots GUI.

All operating system files cannot be simultaneously located in RAM, since the volume of modern operating systems is tens and hundreds of megabytes. For the computer to function, there must be a module in RAM that controls file system, command processor and connected device drivers. Operating system modules that provide a graphical interface can be loaded into RAM at the user's discretion.

Questions for self-control 1. Why is an operating system needed? 2. What components are included in the operating system? 3. What is a file called, how is its name set? 4. What extensions can there be? text files? 5. What is the difference between quick and full disk formatting? 6. What is the difference between single-level and hierarchical file structures? 7. What operations with files are possible? 8. What are the main stages of loading an operating system?
Settings Windows interface Questions to study: 1. Windows desktop. 1.1. Object icons and labels. 1.2. Window. 1.3. Task bar. 1.4. Display panel. 2. Folder window structure. 2.1. Title line. 2.2. Buttons for controlling window sizes. 2.3. System icon. 2.4. Menu bar. 2.5. Toolbar. 2.6. Address bar. 2.7. Working field. 2.8. Status bar.

OS Windows family– the most universal. They can be used to work with office programs, for consumer Internet use, educational and entertainment purposes. Like all operating rooms

The computer boot process is briefly described in the article “Turning on the PC” in the BIOS section. Let's look at this process in more detail.

Initializing the system using BIOS

  1. Pressing the power button. When you turn on the Power button on items motherboard supply voltages are supplied; the Power Good signal starts the clock generator; A reset signal is sent to the processor, which resets it to its original state. System BIOS programs start running.
  2. BIOS check. The checksum of system programs located in ROM is located in one of the cells. After startup, the checksum is recalculated and compared with the reference value.
  3. Processor identification. The motherboard provides the ability to install various models processor. The BIOS submits a request to identify the processor and, based on the response received, determines the processor type, frequency, voltage, etc.
  4. Setting up basic elements. Basic components are initialized and tested motherboard: direct memory access block, timer, hardware interrupt block.
  5. RAM testing. The type of memory modules, their volume, and organization are determined; The first 64 KB of RAM are tested.
  6. Organization of working RAM structures. An area for the BIOS is allocated and interrupts are configured.
  7. Checking CMOS memory and battery. If the CMOS battery is faulty, all BIOS settings data stored in memory are lost. Loading the latest configuration becomes impossible, as indicated on the monitor screen. It is possible to load standard factory BIOS values.
  8. Initializing motherboard devices. Boot devices are searched and configured ( HDD, CD drive, FDD), boot process controls (keyboard, mouse), input/output devices (COM, LPT). Devices are allocated appropriate interrupt lines.
  9. PnP. Devices connected via system connectors are identified. Devices are allocated resources and interrupts.
  10. Turn on the video system. The Video BIOS starts, which configures the video controller to VGA or EGA mode, which is supported by all video controllers. After this, the video controller is ready for use.
  11. Displaying a message on the monitor screen. The first message appears on the monitor screen: BIOS manufacturer, processor type and frequency, RAM type and amount.
  12. RAM testing. A random check of unused RAM is performed.
  13. Initializing the disk drive controller.
  14. Initializing the hard drive controller.
  15. Initializing the keyboard. The keyboard controller is turned on, the contact matrix is ​​tested, the temporary parameters for polling keys and the NumLock mode are set. The keyboard is ready to use. A message appears on the screen informing you that you can use it. BIOS programs Setup (usually the Del key is used for this).
  16. Search for devices with their own BIOS. If such devices are found, then control is transferred to the BIOS programs of these devices and they are initialized.
  17. Transferring control to the OS bootloader. Based on the software interrupt Int 19h, the OS boot loader is searched for on disk drives ( Boot Record). It must be located on one of the devices (HDD, CD, FDD, SCSI). The bootloader location is the same everywhere. Once the OS loader is found, control is transferred to it.

Loading the operating system

The operating system (OS) kernel is loaded into RAM, after which the main part of the OS is stored in system memory.


BIOS performs a "rough" setup computer system. Its main task is to “breathe” life into computer hardware, regardless of its specific modification. New models of processors, motherboards, chipsets and other devices are released almost quarterly. It is impossible to immediately include the identification of all this diversity in the BIOS. Yes, this is not necessary. The main task of the BIOS is to initialize the hardware and start the operating system, which itself fine-tunes the computer components.


At the dawn of the development of personal computers, system configuration required users to have appropriate qualifications. Surely, experienced users still remember files such as config.exe And autoexec.bat, which had to be adjusted correctly in order for the “cart” to move normally.


What to do - this was the other side of the coin of IBM's open architecture. For the convenience of getting a computer with the desired configuration, you had to pay for the knowledge of how to configure it correctly. Such inconveniences scared off unprepared users, therefore, PC manufacturing companies could not put up with this state of affairs for long. Manufacturers computer equipment and software developers have tried to remove as much as possible from the consumer the need to configure their computer. For the first time, the new system setup procedure was applied to the OS Windows- the operating system itself “queried” the connected devices and configured them correctly:

  • a list of devices requiring software configuration was determined;
  • appropriate programs were sought for proper operation such devices;
  • The procedure for software initialization of devices and setting them up for operating modes was carried out.

The task, in general, is quite difficult. To facilitate its implementation, chipset manufacturers and software developers have agreed and established certain rules for the bootstrap mechanism. Now the components of the computer system that require initialization and configuration were equipped with the appropriate software(initializing programs, drivers, INF files):

  • Initialization programs enter control codes at specific addresses (one-time procedure);
  • Drivers- these are programs that control the operation of the controller of the corresponding device;
  • INF file- a command file that helps the OS organize the procedure for setting up a specific computer unit.

Initial Windows boot is managed batch file, which contains a list of programs and drivers executed during the OS boot process. This is the so-called “blank” command file, which should, during the initial Windows installations on a computer, converted into a working version, according to the installed equipment on this computer.


Windows has a certain set of universal drivers (which is constantly updated with the release of new version OS), allowing you to configure all system components. To be fair, it should be said that universal drivers Windows is not always able to produce optimal setting of one or another device, which reduces the performance and stability of the entire computer system. Therefore, all devices are supplied with their own installation software (usually on CD). At initial installation new Windows devices may ask you to install a disk with the appropriate drivers for correct settings new device. It is also recommended to monitor the release of new versions of drivers (in which errors are fixed, performance optimizations are made, etc.) for the chipset of your motherboard and update them regularly.