Click to See Complete Forum and Search --> : i have started grubbing instead of thinking


linuxardo
11-16-2007, 07:37 AM
first of all i would like to congratulate saikee for writing such a amazing how to boot 145 os. after having a hand on grub and installing 5 os in my pc. i have cleared many doubts and learned a lot. Still there are some doubts..

1) what actually chainloader +1 command does? does chainloader can have any attrib other than +1.

2) what are stage1 , stage 2, stage 1.5 of the grub?

3) what are the other commands of grub?

4)can i boot versions of linux using ntldr boot loader of windows?

bwkaz
11-16-2007, 07:56 PM
1) what actually chainloader +1 command does? does chainloader can have any attrib other than +1. I bet that's in the grub manual (http://www.gnu.org/software/grub/manual/grub.html#chainloader). ;)

The "chainloader" command reads a file into memory and jumps to the first byte in that file. It can take either a filename or the special name +1 -- if you use +1, then it reads in the first sector (512 bytes) from the current root device, and jumps to the first byte of code from there. It is possible to use arguments other than +1, but it's not common (there aren't many other bootloaders that reside in a file).

2) what are stage1 , stage 2, stage 1.5 of the grub? stage1 is the bare minimum grub code required to load stage1.5 (or stage2) from a fixed sector offset on your hard drive. It has to be tiny, because it has to fit inside your master boot record's code area (the area before the partition table).

stage1.5 is different for each supported filesystem. It's the bare minimum code required to interpret a filesystem's structures on disk. The file can't be moved on disk after the stage1 is pointed to it, but anything loaded after stage1.5 can be. stage1.5 also loads stage2 and starts running it.

stage2 is the code required to read in the menu.lst file and generate the menu (if the file exists), or provide the grub prompt (if configured to, or if menu.lst doesn't exist). It uses the filesystem code from the stage1.5 to do this, which is why you don't need to reinstall grub every time you change the config file (with lilo, you had to do that).

3) what are the other commands of grub? Too many to list -- see the manual, above. ;)

4)can i boot versions of linux using ntldr boot loader of windows? Only indirectly. ntldr isn't nearly smart enough to interpret any Linux filesystems, so it can't load up a Linux kernel and boot it. However, it does have functionality that's superficially similar to grub's chainloader -- if you take an image of the first sector of whichever device grub installed itself into, and write that sector to a file that ntldr can get at, then ntldr will be able to chainload that file, and grub will start. Then grub can load Linux.

But no, ntldr can't load Linux directly.

saikee
11-20-2007, 10:52 AM
linuxardo,

Welcome to JustLinux !

bwkaz is my teacher and one of the village elders here.

He is answering the thread because I am on currently on holiday in Hong Kong.