linux - How does GRUB's stage 1 boot loader loads the stage 2 bootloader? -


from past week puzzled question how grub first stage boot loader 446 bytes able search second stage, when second stage in complex file system! how locate second stage?

when complex partitioning scheme of windows , linux in place, , linux system entirely in extended partition, how stage 1 finds stage 2? stage 1.5?

all of grub tutorials skim through important part. have searched though internet couldn't find explains this. sadly, not assembly programmer.

i want understand boot process intricately in terms of sectors of hard disk tickled (and how) during bootup. *please point me resource or answer here. me play grub wisely.*

some resources searched:

  1. how linux works : every superuser should know brian ward
  2. http://www.dedoimedo.com/computers/grub.html
  3. some past stackoverflow questions.

stage 1 "knows" stage 2 entries in block-list loading table embedded in it. loads lists of blocks off of booting drive, jumps specified cs:ip in 16-bit real mode. these described in page on embedded data. queries bios disk geometry, , maps linear block numbers there c:h:s addresses used int 13h bios interface.

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

also lot of time new disk alignment, there under 1-2 mb of unallocated space between mbr , first partitions , stage 2 stuck there.


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -