How does the GRUB stage bootloader load the stage 2 bootloader?

Since last week, I have been puzzled by the question that, as a grub boot loader, which is only 446 bytes, is able to search for the second stage when the second stage is in a complex file system! How to find the second stage?

When the complex scheme of splitting windows and linux is in place, and the linux system is completely in the extended partition, whereas in stage 1 is stage 2? Even stage 1.5?

All grub tutorials look at this important part. I searched on the Internet but could not find anything that explains this. Unfortunately, I am not an assembly programmer.

I want to understand the boot process with confusion, in terms of which partitions of the hard drive tickle (and something like) during boot. * Please indicate me a good resource or answer here. This will help me a lot with the rake reasonably. *

Some resources looked for:

+6
source share
1 answer

Stage 1 “knows”, where stage 2 is the entries in the built-in table for loading the list of blocks. It loads the block lists from the boot disk, and then goes to the specified CS: IP in 16-bit real mode. They are described on the page in the embedded data. It queries the BIOS for disk geometry and compares the line block numbers there with the C: H: S addresses used by the INT 13h BIOS interface.

http://www.uruk.org/orig-grub/technical.html

Also a lot of time with a new disk alignment, there is only less than 1-2 MB of unallocated space between the MBRs, and the first partitions and stage 2 sometimes get stuck.

+3
source

Source: https://habr.com/ru/post/944710/


All Articles