Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
51
rated 0 times [  51] [ 0]  / answers: 1 / hits: 115035  / 2 Years ago, fri, may 27, 2022, 9:26:24

According to the wikipedia entry, a bootloader is a small program stored in ROM(a part of the main memory(RAM), isn't it??) which can only be read and not erased. I am a little puzzled here. Does this mean that every RAM we buy has a bootloader installed by default?
And also, I read from a book which says that there is typically an area called the MBR (Master Boot Record) on the hard drive which includes a bootloader...



So where exactly is this bootloader located? Do different Operating Systems store their bootloader in different places?


More From » boot

 Answers
1

ROM is a separate chip from the RAM. It does not require power to retain its contents, and originally could not be modified by any means, but came hard wired from the factory. Later PROM, or Programmable Read Only Memory replaced true ROM. These chips came blank from the factory, and could be written to once using a special procedure that essentially burned out bits of the chip causing their state to change. This was then replaced with EPROM, or Eraseable Programmable Memory. These chips had a little window on them and if you shined ultraviolet light into them, could be erased, allowing them to be programmed again. These were then replaced with EEPROM, or Electrically Erasable Programmable Memory. These chips have a special software procedure to erase them so they can be reprogrammed. ROM generally is still used to refer to all of these types generically.



The motherboard has some type of ROM chip that holds the firmware, which in PC parlance is usually called the BIOS, or Basic Input Output System, though it is being replaced these days with EFI firmware. This is the software that the CPU first starts executing at power on. All firmware performs initialization of the hardware, typically provides some diagnostic output, and provides a way for the user to configure the hardware, then locates and loads the boot loader, which in turn locates and loads the OS.



With PC BIOS, it simply loads and executes the first sector off the disk it decides to boot from, which typically is the first hard disk detected. By convention the first sector of a hard disk, called the Master Boot Record, contains a DOS partition table listing the locations of the partitions on the disk, and and leaves some space for the boot loader. Ubuntu uses the GRUB boot loader, which places enough code in the MBR to load and execute /boot/grub/core.img. Normally a copy of this file is placed in the sectors following the MBR, but before the first partition, and that is actually what the MBR loads, since finding the location of /boot/grub/core.img is too difficult to do properly in the very limited space available in the MBR.



The grub core image contains the base grub code, plus any modules needed to access /boot/grub so that it can load additional modules there, and the grub config file that describes what operating systems can be booted, and where they can be found.



The EFI firmware used on Intel Macs and becoming available as a replacement to BIOS on most recent PC motherboards requires a dedicated partition that holds boot loader files, and the firmware is smart enough to find those files and load one instead of just loading and executing whatever is in the first sector of the disk.


[#36307] Sunday, May 29, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
kneducator

Total Points: 226
Total Questions: 111
Total Answers: 108

Location: Mexico
Member since Sun, Jul 25, 2021
3 Years ago
;