How do OS installers works if there isn’t any OS that could manage applications in an empty computer?

1.16K views

How do OS installers works if there isn’t any OS that could manage applications in an empty computer?

In: Technology

12 Answers

Anonymous 0 Comments

A CPU is a machine for executing machine code instructions. You put machine code instructions at a location in memory, set the CPU’s instruction pointer to the starting point of those instructions, and let it run.

The OS, once installed, has to be on a piece of persistent storage like a hard drive. So it would have to be copied into RAM before the CPU could run it. Copying data into RAM from a hard drive is a *very* complicated task, relative to what a CPU knows how to do on its own. So instead, a little bit of code is built into your motherboard that knows how to

1. Find a storage device
2. Copy the first 512 bytes of that storage device into RAM at an architecture-defined address
3. Set the instruction pointer to that address

The true way to run software on your machine is therefore to put code in the first 512 bytes of a USB stick or something, plug it in, tell the BIOS to use that drive, and then let it boot. Usually the code in these 512 bytes just copies *more* code from the rest of the drive, and points the IP there.

Anonymous 0 Comments

Just to avoid confusion should you choose to research this a bit more:

The BIOS is no more. The technology had quite a number of restrictions. Intel developed something called the “Extensible Firmware Interface” (EFI) way back together with a now failed hardware plattform (Itanium).

It took a while until this became widely adopted (I think, Apple first used it on the – at the time – new Intel-based Macs). Nowadays, basically every modern PCs (and other platforms) come with the Universal EFI (UEFI) technology on board which, aside from starting up the whole computer, supports a lot more (e.g. to remotely manage computers in enterprise environments etc.)

But regarding your question: Today, on a modern computer, the UEFI does what the BIOS did – just not in such a very basic manner anymore.

Most computers still allow “legacy booting” with the old BIOS interface but that will disappear in time (and has disappeared for a lot of “made for business” PCs e.g. from Dell or HP)