1

As we all know, GRUB can boot an ELF executable kernel. But here, in source code of GRUB, in which file and/or directory, the source of ELF loader resides? Also which file contains source code of Stage1 and Stage2?

Amir Khan
  • 43
  • 5
  • 1
    https://github.com/coreos/grub/blob/2.02-coreos/grub-core/kern/elf.c – Michael Petch Nov 29 '18 at 15:06
  • Thank you so much for your response, also if you could tell me about source code of stage1 and stage2 . – Amir Khan Nov 30 '18 at 08:17
  • 1
    Stage1 can be found in these files: https://github.com/coreos/grub/tree/2.02-coreos/grub-core/boot/i386/pc . A different assembyl file is sued for each type of boot method (cdrom, network boot,floppy, hard drive etc) – Michael Petch Nov 30 '18 at 08:29
  • Thanks again for your reply, you've really helped me a lot. I also wanted to know weather STAGE2 is a simple assembly file compiled with assembler or is an elf file? – Amir Khan Dec 01 '18 at 13:01

0 Answers0