Home > categories > Machinery & Equipment > Loaders > What loads the loader?
Question:

What loads the loader?

At the lowest level each program is machine code. And that code is fed into the CPU.For that to happen a 'loader' loads the executable file (program).But then what loads the loader in the first place?

Answer:

The loader is part of your operating system. It is invoked by the operating system when it receives a request to run the executable file. Then the question rises: what loads the operating system?. When you power on your computer, the first thing which runs is the BIOS (basic input/output system), which is built-in to the motherboard. The BIOS performs a POST (power-on self test), to locate and verify that all necessary hardware is attached to the system. When that is done, the BIOS will try to locate a boot loader on any of the designated boot devices, load it, and feed it into the CPU. The boot loader is a small piece of code which is designed to load and set up the operating system, i.e. the starting point of the operating system. Although not as advanced as the loader which is part of the operating system (which has things like dynamic linking, command-line arguments, permission validation etc.), the BIOS is essentially the very first loader.

Share to: