Setting up hardware and software

Operating system loading algorithm. Open Library - open library of educational information

Loading algorithm operating system

The operating system is stored in external memory usually on a hard disk, less often on a floppy disk.

It is worth saying that for normal operation of the computer it is extremely important that the main modules of the operating system are in RAM. For this reason, after turning on the computer, the operating system is automatically rewritten (booted) from the disk in RAM.

- rewriting the operating system from a disk (hard or floppy) into RAM.

After turning on the computer, a change in numbers is observed on the screen. These numbers reflect the process of testing RAM with the BIOS program. If a fault is detected in the RAM cells, a message will be displayed.

After successfully completing the hardware testing, the drive with floppy disk A is accessed, and the indicator light next to it lights up. If the operating system is loaded from a floppy disk, then you need to insert the system disk into drive A before or during testing. otherwise If there is no operating system on disk A, the hard drive is accessed, as evidenced by the indicator light that lights up next to it.

Reading into the RAM of the 0th sector of the 0th side of the disk in which the bootloader is located (BOOT RECORD) begins. Control is transferred to the bootloader, which checks for the presence of the IO.SYS expansion module and the MSDOS.SYS base module on the system disk. If they are in the place allocated for them, then it loads them into RAM, otherwise a message will be displayed about their absence. In this case, it is recommended to re-download. The reboot signal transfers control to the permanent BIOS module, which again writes the block from the disk into RAM bootstrap etc.

NOTE! For reboot the operating system press the keys simultaneously into memory<Сtгl> <АLT> .

After successfully loading the IO.SYS expansion module and the MSDOS.SYS base module into the RAM, the COMMAND.COM command processor is loaded and the CONFIG.SYS configuration file, which contains connection commands, is processed necessary drivers. This file may be missing if the user is satisfied with the basic version of the operating system.

Then the command file AUTOEXEC.BAT is processed. This file is used to configure parameters operating environment. For example, create virtual disk, provide a change of printing modes, load auxiliary programs etc.

Note! Files with the .BAT extension play a special role when working in a system environment. Οʜᴎ contain a set of operating system commands or names executable files. After launching a file with the .BAT extension, all commands written in it are executed automatically one after another.

A file with the standard name AUTOEXEC.BAT differs from other files of the .BAT type in that the execution of commands placed in it begins automatically immediately after the operating system boots.

If the AUTOEXEC.BAT file is missing, you will be prompted to enter the date and time:

if you press the enter key, the so-called system parameters determined by the computer timer will be accepted as the current date and time;

If you want to reset the system date and time, then in response to the prompt, enter the values ​​in one of the provided forms, for example:

10-25-1997 (month day year)

7:30:10.00r (hours: minutes: seconds)

After the AUTOEXEC.BAT file has finished working, and also if this file not detected, a prompt will be displayed on the display screen system disk, For example C:\>. This indicates that the boot process has completed normally and you can begin working by entering the name of the application program or operating system command.

Note. The CONFIG.SYS and AUTOEXEC.BAT files may be missing. In this case, the operating environment settings will be set to default.

Remember! It is extremely important to ensure that the operating system is permanently stored on the hard drive. When you turn on your computer, all floppy drives must be open.

Insert a floppy disk with application programs into the drive after the download is complete.

Tested by the program

Load No Load

on flexible hard no

disk disk

Reading from floppy disk Read. with gesture disk

IO.SYS, MSDOS.SYS in the boot sector"

Load No Message

correct? "No system files"

Command. Com "No system files"

and CONFIG.SYS file

The operating system is stored in external memory, usually on a hard disk, less often on a floppy disk. For normal operation of a computer, it is necessary that the main modules of the operating system be in RAM. Therefore, after turning on the computer, the operating system is automatically rewritten (loaded) from the disk into RAM. Most important aspects This loading is reflected in the form of an algorithm in Fig. 9.13.

Rice. 9.13. Algorithm for loading the operating system from disk into RAM

After turning on the computer, you watch the numbers change on the screen. These numbers reflect the process of testing RAM by the BIOS program. If a fault is detected in the RAM cells, a message will be displayed.

After successfully completing the hardware testing, the drive with floppy disk A is accessed, and the indicator light next to it lights up. If you are loading the operating system from a floppy disk, then before or during testing you must insert the system disk into drive A. Otherwise, if there is no operating system on disk A, the hard disk is accessed, as evidenced by the indicator light next to it.

Reading into the RAM of the 0th sector of the 0th side of the disk in which the bootloader is located (BOOT RECORD) begins. Control is transferred to the bootloader, which checks for the presence of the IO.SYS expansion module and the MSDOS.SYS base module on the system disk. If they are in their designated place (cm. rice. 9.10), then it loads them into RAM, otherwise a message about their absence will be displayed. In this case, it is recommended to re-download. The reboot signal transfers control to the permanent BIOS module, which again writes the boot block from the disk into RAM, etc.

Remember! For reboot the operating system press the keys simultaneously into memory .

After successfully loading the IO.SYS expansion module and the MSDOS.SYS base module into the RAM, the COMMAND.COM command processor is loaded and the CONFIG.SYS configuration file is processed, which contains commands for connecting the necessary drivers. This file may be missing if you are happy with the base version of the operating system.

The batch file AUTOEXEC.BAT is then processed. Using this file you can configure the operating environment parameters. For example, create a virtual disk, change printing modes, load auxiliary programs, etc.

Attention! Files with the .BAT extension play a special role when working in a system environment. They contain a set of operating system commands or executable file names. After running a file with the .BAT extension, all commands written in it are executed automatically one after another.

A file with the standard name AUTOEXEC.BAT differs from other files of the .BAT type in that the execution of commands placed in it begins automatically immediately after the operating system boots.

If the AUTOEXEC.BAT file is missing, you will be prompted to enter the date and time:

if you press the enter key, the so-called system parameters determined by the computer timer will be accepted as the current date and time;

If you want to reset the system date and time, then in response to the prompt, enter the values ​​in one of the provided forms, for example:

10-25-1997 (month day year)

7:30:10.00r (hours:minutes:seconds)

After the AUTOEXEC.BAT file finishes running, and if this file is not found, a system disk prompt will be displayed on the display screen, for example C:\>. This indicates that the boot process has completed normally and you can begin working by entering the application name or operating system command.

Note. The CONFIG.SYS and AUTOEXEC.BAT files may be missing. In this case, the operating environment settings will be set to default.

Remember! The hard drive must permanently store the operating system.

When you turn on your computer, all floppy drives must be open.

The floppy disk with application programs must be inserted into the drive after the download is complete.

A long time ago, when I was little, I worked in an institute laboratory at big computer SM-3 (something like the famous PDP-11), bootstrapping (loading) the computer looked like this. A short paper tape with a boot program punched on it was inserted into the photo reader, the reading process was started, and then... depending on your luck.

The fact is that the paper tape gradually wore out, began to be difficult to read, and the computer might not start the first time. In this case, the process had to be repeated, sometimes several times, until the bitter end. When the tape completely failed and the machine did not want to “come to life”, it was necessary to temporarily enter the boot program manually using the switches located on the front panel. The main thing here was to take your time and not make mistakes.

IN modern computers The download process is mostly automated, but that doesn't mean it's not worth getting to know.

Basic definitions and stages of loading an operating system

Turning on the computer, POST, BootMonitor

The initial stage of loading the operating system after turning on the computer begins in the BIOS (Basic Input/Output System - basic system input/output). IN BIOS settings we specify a boot device, or a series of boot devices, in order of priority. Possible various options loads and their combinations: with hard drive, CD/DVD disks, USB flash drives and others.

Immediately after passing POST (Power-On Self-Test - self-test after switching on) Computer BIOS will begin to search through the specified boot devices one by one until it finds a suitable special entry on one of them, which contains information about further actions.

Level 1 loader. Master Boot Record

Master Boot Record - main boot record, located in the first physical sectors of boot storage devices. It contains a Partition Table and executable code.

The main task of the program written in the MBR is to search for the active system partition of the disk and transfer control to its boot sector. Thus, this stage can be called preparatory, due to the fact that the OS itself is not directly loaded yet.

The system partition is usually called the partition of the disk (storage device) on which the operating system files responsible for the OS boot process are located (the operating system itself can be located in another partition). Basically, system partitions there may be several, so one of them is marked as active. This is what the program loaded from the MBR is looking for.

Level 2 bootloader. Partition Boot Sector

The next stage of booting the computer is transferring control to the executable code recorded in the PBS (Partition Boot Sector - the boot sector of the active partition). PBS is located in the first sector(s) of the corresponding disk partition. The PBS code specifies the name of the operating system loader file, to which control is transferred at this stage.

The initial stage of loading the operating system. OS boot manager

Initially, the boot loader in Linux was LILO (Linux Loader). Due to the shortcomings it had, the main one of which was the inability to understand those used in Linux file systems, later the GRUB (GRand Unified Bootloader) bootloader began to be used, in which the shortcomings of LILO were corrected.

If we are talking about Windows versions before Vista, for example Windows XP, then Ntldr will be loaded. It, in turn, reads information from text file Boot.ini, which records information about installed operating systems.

Loading the operating system kernel

The final stage of loading the operating system is loading the OS kernel and transferring control to it.

Several years ago there was such a funny case in my practice.

I was asked to help a man buy and organize a computer for his home. This friend had just retired at that time, and before that he worked as a boss and saw the computer, for the most part, from afar, on his secretary’s desk. After retirement, he had the time and desire to master the computer. Well, I think that's great. We found him an inexpensive, but high-quality computer with a good monitor, for those times. I installed and configured some programs and showed them how to use them. The gentleman acquired a book from the series “ Something for dummies“And we parted absolutely satisfied with each other.

About a week later, my ward called me on the phone and, almost crying, told me that everything was gone and the computer no longer worked. Fortunately, he did not lock himself away and honestly told how it happened. And it was like this. A friend went to explore the contents of his computer and found several suspicious and “unnecessary” files, in his opinion, in the root of the C:\ drive. He decided to free up space and simply deleted these files. I think that everyone had already guessed that it was boot.ini, ntldr, ntdetect, etc. It wasn’t difficult to correct the situation, except that I had to go to him again.

By the way, in order to get problems with loading Windows XP, it was possible not to erase anything, but to slightly “correct”, for example, boot.ini.

Apparently Microsoft somehow found out about this case and in the next version of its OS decided to hide the bootloader files better.

Features of loading Windows Vista / 7 / 8 operating systems

IN Windows Vista or Windows 7/8 boot manager is called Bootmgr. It reads the list of installed operating systems not from a simple text file, which is boot.ini, but from the system BCD (Boot Configuration Data) store, which is accessed through special utility bcdedit.exe.

But that is not all. Open “Computer Management” -> “Disk Management” >

The standard installation process of the Windows Vista / 7 / 8 operating system creates an additional “System Reserved” partition at the beginning of the disk. It is not assigned a drive letter, so unless additional steps are taken, both the partition itself and its contents will be hidden from the user. This main partition has the status “System” and “Active” and, therefore, cannot be deleted either.

In Windows 7, the size of such a partition is 100 MB, of which about 30 MB is occupied; in Windows 8, it is already 350 MB, of which 105 MB is occupied. This difference is explained by the fact that in Windows 8 the “Recovery” folder was moved to this partition.

Let's look at the contents of the "Reserved by the system" section. To do this, assign it a drive letter, for example, “W” in “Disk Management”. Additionally, open “Control Panel” -> “Folder Options” and on the “View” tab uncheck “Hide protected files” system files" and put a check mark on "Show hidden files, folders and disks."

If the system has file manager FAR Manager, you can use it to view it and not have to worry about setting up the visibility of hidden files.

This is what the contents of the “System Reserved” section look like in Windows 8 >

As expected, at the root of the partition we see the Bootmgr bootloader.

And this is what part of the contents of the “Boot” folder looks like >

In the folder we find the BCD Boot Configuration Database and its accompanying folders with language and font files.

To complete the picture, it remains to say which partition is called the boot partition. The answer is already shown in the picture with Windows volumes 7. Obviously, this is the partition on which all the main files of the operating system are located.

Well, it’s very easy to remember the names of disk partitions according to the principle “it’s the other way around” - on the system one there is no system (operating system), but there is a third-level bootloader, on the boot one there is no bootloader, but the system itself is located. Naturally, this “memory” only works when there are several sections. If there is only one partition, then it can be system, active and boot at once.

The main task of the 3rd level bootloader, which, depending on the type of OS, is Bootmgr, Ntldr or GRUB, is reading from boot disk and loading the operating system kernel. In addition, in the case of multiple booting, when several operating systems are installed on the computer, the 3rd level boot loader allows you to select the one you need every time you start the computer.

A classic mistake that Microsoft has dedicated to is Windows installation XP after Windows Vista/7/8. Windows Installer XP marks its partition as active, after which, during boot, the MBR transfers control to the PBS of this partition, which, in turn, passes control to Ntldr. Windows boot loader XP knows nothing about later operating versions Windows systems and loading them becomes impossible. It is quite easy to treat, but this situation can confuse an inexperienced user.

There is practically nothing to add to this and you can proceed directly to editing the boot menu. Let's start with .

10 comments

    • Thanks for your feedback. In the near future, I plan to continue describing methods for correcting loading errors using specific examples. I know from experience that while you read everything seems to be clear, but when it comes down to it in practice, difficulties begin.

  1. Please tell me how exactly to treat?:
    “The Windows XP loader does not know anything about later versions of Windows operating systems and loading them becomes impossible. It is quite easy to treat, but this situation can confuse an inexperienced user.”

    I installed XP after Vista on the laptop - as a result, the system starts until XP starts loading and everything reboots again, and if you turn off the power adapter (while the OS is loading), then everything boots normally. If you upload to safe mode, then there is no need to disconnect the adapter. What can hit us and how can we fight it?

    PLEASE FOLLOW. THANKS IN ADVANCE. SORRY FOR THE “BROKEN” RUSSIAN.

    • I won’t say anything about the influence of the power adapter on loading XP - I have no specific ideas. Regarding restoring the Vista boot, if this is relevant, then at the end of the post there is a link to the Microsoft support article (919529), which is directly devoted to this topic. To restore you will need installation disk Vista. IN command line With administrator rights you need to run:
      X:\boot\bootsect.exe /nt60 all
      where X: is a letter optical drive.
      But the XP boot will need to be added manually using the editor. The set of commands will be like this:
      Bcdedit /create (ntldr) /d " Microsoft Windows XP"
      If this command fails, then:
      Bcdedit /set (ntldr) description "Microsoft Windows XP"
      Further:
      bcdedit /set (ntldr) device partition=X:
      X: - the drive letter of the partition on which the XP bootloader files are located, and the path to it:
      bcdedit /set (ntldr) path \ntldr
      bcdedit /displayorder (ntldr) /addlast

    I had a laptop, when I loaded and rebooted Windows immediately turned on, but now I purchased desktop computer And loading in progress in three stages. How to do it in order to get rid of these stages. Sorry for the ignorant use of technical terms.

    • Yuri! I'm afraid that the information you provided is clearly not enough to make any recommendations. What Windows and about which ones stages goes speech? Please check.

    Good health, Alexander.
    How to understand, prevent, and if it happens again, how to get out of such a situation correctly.
    Laptop. Windows 7 installed. After turning it on and entering the password, it showed “missing” operating system" - that is, "there is no operating system." Turning it off and on again gave the same result. It was possible to start only by removing and after some time inserting the battery.
    The day before, however, there was an incorrect shutdown: the flash drive and modem were not turned off first. Previously, such forgetfulness also happened, but there was no such effect.
    I would be grateful for an answer that is accessible to an old “teapot” (I am ten years older than the gentleman in a funny case, but I became acquainted with COMP at about the same age).

    • Vladimir, hello. Happy holidays and all the best.
      In this situation, you did everything right - you reset the “stuck” glitch.
      As the song says: “One drop of rain is not enough rain. One snowflake is not yet snow.” It is possible that nothing like this will ever happen again. Now, if regular problems begin with the launch, then it will be necessary to sort it out. In general, Windows 7 and higher are quite resistant to abnormal shutdowns.
      What to do? You yourself answered your own question - try to turn off devices regularly. And if it is possible to connect via USB external disk, then I would definitely make (in fact, I do quite regularly) a backup of the system, for example using .

    Hello. I have the same problem, desktop computer, two hard drives, Windows 10. After the BIOS splash screen, a distorted window appears, the computer does not start, after forced reboot everything starts up and everything works. That is, there is some kind of error between the BIOS and disk selection.

The operating system is stored in external memory, usually on a hard disk, less often on a floppy disk. For normal operation of a computer, it is necessary that the main modules of the operating system be in RAM. Therefore, after turning on the computer, the operating system is automatically rewritten (loaded) from the disk into RAM. The most important aspects of this loading are depicted in the form of an algorithm in Fig. 9.13.

Rice. 9.13. Algorithm for loading the operating system from disk into RAM

After turning on the computer, you watch the numbers change on the screen. These numbers reflect the process of testing RAM by the BIOS program. If a fault is detected in the RAM cells, a message will be displayed.

After successfully completing the hardware testing, the drive with floppy disk A is accessed, and the indicator light next to it lights up. If you are loading the operating system from a floppy disk, then before or during testing you must insert the system disk into drive A. Otherwise, if there is no operating system on disk A, the hard disk is accessed, as evidenced by the indicator light next to it.

Reading into the RAM of the 0th sector of the 0th side of the disk in which the bootloader is located (BOOT RECORD) begins. Control is transferred to the bootloader, which checks for the presence of the IO.SYS expansion module and the MSDOS.SYS base module on the system disk. If they are in their designated place (cm. rice. 9.10), then it loads them into RAM, otherwise a message about their absence will be displayed. In this case, it is recommended to re-download. The reboot signal transfers control to the permanent BIOS module, which again writes the boot block from the disk into RAM, etc.

Remember! For reboot the operating system press the keys simultaneously into memory .

After successfully loading the IO.SYS expansion module and the MSDOS.SYS base module into the RAM, the COMMAND.COM command processor is loaded and the CONFIG.SYS configuration file is processed, which contains commands for connecting the necessary drivers. This file may be missing if you are happy with the base version of the operating system.



The batch file AUTOEXEC.BAT is then processed. Using this file you can configure the operating environment parameters. For example, create a virtual disk, change printing modes, load auxiliary programs, etc.

Attention! Files with the .BAT extension play a special role when working in a system environment. They contain a set of operating system commands or executable file names. After running a file with the .BAT extension, all commands written in it are executed automatically one after another.

A file with the standard name AUTOEXEC.BAT differs from other files of the .BAT type in that the execution of commands placed in it begins automatically immediately after the operating system boots.

If the AUTOEXEC.BAT file is missing, you will be prompted to enter the date and time:

if you press the enter key, the so-called system parameters determined by the computer timer will be accepted as the current date and time;

If you want to reset the system date and time, then in response to the prompt, enter the values ​​in one of the provided forms, for example:

10-25-1997 (month day year)

7:30:10.00r (hours:minutes:seconds)

After the AUTOEXEC.BAT file finishes running, and if this file is not found, a system disk prompt will be displayed on the display screen, for example C:\>. This indicates that the boot process has completed normally and you can begin working by entering the application name or operating system command.

Note. The CONFIG.SYS and AUTOEXEC.BAT files may be missing. In this case, the operating environment settings will be set to default.

Remember! The hard drive must permanently store the operating system.

When you turn on your computer, all floppy drives must be open.

The floppy disk with application programs must be inserted into the drive after the download is complete.



TECHNOLOGY OF WORKING IN MS DOS

§ General information about teams

§ Basic commands for working with directories

§ Basic commands for working with files

§ Basic commands for working with disks

§ Creating and Using a Batch File

§ Operating system auto-tuning command file AUTOEXEC.BAT

§ Configuring the operating system using the CONFIG.SYS configuration file

GENERAL INFORMATION ABOUT TEAMS

The bootloader is system program, performing the download. Many loaders also provide movement and linking. Some systems separate the linking function from the move and load functions. Linking in progress special program linking (or link editor), moving and loading - loader.

Linking is the linking of two or more separate translated programs.

Relocation is the modification of an object program so that it can be loaded from a different address than the original one.

Bootloader functions:

  1. OP distribution;
  2. moving a program;
  3. linking modules;

OP distribution

Moving a program

If there are address constants inside the modules that are calculated from the beginning of the module, then the addresses will be adjusted relative to the Base.

Linking modules

Types of bootloaders

Compile-run loaders

One of possible ways To perform the loader function, there can be such an organization of the assembler's work in which the assembler, working in one part of the memory, places machine instructions and data as they are assembled directly into the memory cells allocated for them. Once compilation is complete, the assembler passes control to the resulting program's entry point. This is a very simple solution that allows you to do without any additional procedures. This scheme is called "compile-execute", and the "loader" consists of a single instruction that transfers control to the assembled program.

Absolute loaders are easy to implement, but have a number of features:

  • the task of distributing the OP is performed by the programmer (using the directive for setting the initial value of the OP);
  • the task of moving the program is performed by the compiler;
  • linking modules - decided by the programmer (call 600);
  • loading programs into the OP and launching them for execution.

Advantages:

  • smaller bootloader size (memory size);
  • separation of the compilation and loading phases, which reduces the time for processing modules;
  • the ability to use several programming languages, because the structures of the created object modules are identical.

Flaws:

A large amount of work falls on the programmer. It is necessary to constantly monitor changes in starting addresses when modifying modules, because their length changes.

Absolute Loader Object File Structure

The information record consists of:

  1. sign;
  2. absolute address of the OP where information can be transferred;
  3. number of information bytes in the message;
  4. bytes of information;
  5. checksums;
  6. numbering.

The control record consists of:

  1. sign;
  2. entry point address.

A simple absolute loader works:

  1. Check whether there is enough memory for this program (viewing the first record).
  2. Sequential reading of the program body and placement at the specified address.
  3. Transfer of control to the address for program execution.

Tuning bootloader

To avoid the need to reassemble all subroutines when a change is made to one of them, and also to free the programmer from the tasks of memory allocation and communication of subroutines, so-called loaders were developed. This bootloader allows the program to have several program segments and one data segment (common segment). The assembler translates each segment separately and provides the loader with text and information regarding movements and cross-references between segments.

The output of the assembler with this scheme is the object program and information about all other programs to which there are calls in this program. In addition, there is information about those places that must be changed during loading (movement information), i.e. about cells whose contents depend on the location of the program in memory.

For each source program, the assembler produces text (translation result) as output information, preceded by a transition vector containing the addresses of the names of subroutines that are accessed in the source program. For example, if the SQRT routine is the first routine called, then the first cell of the jump vector will contain the symbolic name SQRT. Statements containing a call to an SQRT routine will be translated into a jump instruction indicating the address of the branch vector element associated with the SQRT. The assembler will also convey additional information such as the total length of the program and the length of the branch vector. After loading the program text and the jump vector into memory, the loader will load each routine specified in the vector. Then he will place a command to go to the corresponding subroutine in each element of the vector. Thus, calling the SQRT subroutine will result in the execution of a jump command to the first cell of the transition vector, which will contain a jump command to the called subroutine.

This loading scheme with two-stage control transfer is often used in computers with a fixed instruction format and direct addressing.

This bootloader has a number of disadvantages:

  • the transition vector is not entirely convenient for loading and saving external data (located in another program segment);
  • the transition vector increases the length of the object program;
  • The loader operates on program segments, but does not facilitate access to data segments that may be shared by multiple routines.

Directly linking bootloader

The directly linking bootloader most fully provides the ability to move programs and data in memory and is currently the most common. Such a loader has the advantage that it allows the use of a large number of both program segments and data segments and gives the programmer complete freedom to access data located in other segments, while allowing separate translation.

The assembler (translator) must pass the following information to the bootloader with each program and data segment:

  1. segment length;
  2. a list of all segment symbols that can be accessed from other segments, and their relative addresses;
  3. a list of all symbols not defined in this segment that are accessed in this segment;
  4. information about the location of address constants in the segment and a description of how their values ​​should change;
  5. machine codes resulting from translation and assigned relative addresses.

One of the disadvantages of a direct linking loader in its simplest form is that each time the program is executed, it must repeatedly perform the functions of memory allocation, moving, linking, and loading all necessary subroutines. These problems can be resolved by performing the loading using two separate programs: the combiner and the module loader. The output of the combiner is a set of data in a format that allows the program to be loaded into memory, and is called a load module. There are several types of combiners. One of them is the so-called link editor, which stores the information necessary to move the module in memory, so that the module as a whole can then be configured and loaded into an arbitrary memory location. In this case, the module loader must perform memory allocation and relocation functions, but remains free from the complex task of linking object modules and subroutines.

Dynamic loader

In each of the considered schemes, it was assumed that all the necessary routines were loaded into memory simultaneously. If the total amount of memory required by the routines is less than the machine's available memory, problems arise. These difficulties are overcome by using the scheme dynamic loading with sequential use of a combiner and a loader. This scheme is based on the fact that usually different routines are required at different times and can be mutually exclusive. By explicitly defining which subroutine contains calls to other subroutines, you can define a so-called overlay structure that specifies mutually exclusive subroutines.

A loading module is generated. It is relocatable and must have a relocation table. Also, the structure of the loading module must contain information about connections. The loader must contain such a part as an overlay manager; it selects from the boot modules exactly those that are starting, and in the process of work organizes the loading of the necessary modules into the OP.

Dynamic Linking

There are cases when, to ensure efficient use of machine memory, subroutines are dynamically linked during program execution. That is, subroutines are loaded into memory only as they are called. This can be beneficial because... Under certain conditions in the program, some subroutines may not be needed at all. Let's look at an example:

if (condition 1)
subroutine call 1
if (condition 2)
subroutine call 2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
if (condition m)
call subroutine m

Many of the branches will be skipped, and it will not be necessary to load into the OP, for example, subroutine 2 if condition 2 is not met. In this case, the loader must work simultaneously with the program and perform the functions of linking and loading subroutines.

Did you like the article? Share with your friends!
Was this article helpful?
Yes
No
Thanks for your feedback!
Something went wrong and your vote was not counted.
Thank you. Your message has been sent
Found an error in the text?
Select it, click Ctrl + Enter and we will fix everything!