0

I was wondering if a bootloader was specific to the device you are booting on?

For exemple if a usb bootloader to install windows is exactly the same as a cd bootloader to install windows or if it is device specific?

My guess is it the same because in either case the bios loads the first 512 bytes (of the first block of the device) into memory and if the machine code is compatible with the cpu the data will be processed the same!

But i'm unsure! Any answer welcomed! Thanks!

MaxiCom
  • 9
  • 2
  • This may be partially answered if you read about the "El Torito" standard for CDs. – u1686_grawity Apr 24 '22 at 20:30
  • 3
    I suspect the answer is much more nuanced, and is, to some degree, device specific - especially when you consider uefi vs bios and mbr vs gpt – davidgo Apr 24 '22 at 20:31
  • 2
    Interesting answer [here](https://superuser.com/a/1527373/432690), somewhat related. – Kamil Maciorowski Apr 24 '22 at 21:40
  • There is no specific answer to your question simply because the term "*bootloader*" covers a wide variety of programs. Some bootloaders are very simple, they only load another boot program, and execute silently (e.g. the DOS boot sector program, aka MBR). Other bootloaders, such as U-Boot, try to be as versatile/capable as possible that some people mistakenly think they are operating systems! – sawdust Apr 24 '22 at 23:59

2 Answers2

0

It depends on what you mean by "device you are booting on". If you are referring to your storage device, there is nothing specific to it in the first stage of the boot process. (AHCI specific driver stuff is part of a later stage).

If you consider the (UEFI)-BIOS as a device, it is device specific because a UEFI boot process is different from a legacy BIOS boot process.

My guess is it the same because in either case the bios loads the first 512 bytes (of the first block of the device) into memory and if the machine code is compatible with the cpu the data will be processed the same!

This assumption holds true until UEFI-BIOS was introduced. On a modern UEFI-BIOS this is a kind of rarely occuring boot setting that is only used to circumvent certain boot problems.

This becomes obvious if you compare the size of the file "bootmgr.efi" to the code stored in the master boot record.

You can't put the code in the master boot record into the file "bootmgr.efi" and expect it to boot a UEFI machine.

The article referred to in another answer to your question

https://en.wikipedia.org/wiki/Bootloader

is outdated because it does not take into account the different boot process when a UEFI-BIOS is booting in UEFI mode. (An UEFI-BIOS can boot the old way when it contains a so-called CSM (compatibility support module).

r2d3
  • 3,298
  • 1
  • 8
  • 24
-1

No, a bootloader is not specific to the device it is booting on.

During the boot process, and until the operating system is loaded and takes over, the bootloader uses functions that are published by the BIOS.

In other words, the BIOS is specific to the device, not the initial bootloader. Note that bootloaders may be chained, but that subject is too complex to detail here.

For more information, see Wikipedia Bootloader.

harrymc
  • 455,459
  • 31
  • 526
  • 924
  • Why the downvote? The downvoter could perhaps give another explanation for how the same boot media can work for almost all devices? – harrymc Apr 26 '22 at 20:22