Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-31-2009, 03:11 AM
|
#1
|
|
LQ Newbie
Registered: Dec 2006
Location: Shoreditch, London
Distribution: Debian
Posts: 2
Rep:
|
How does the IPL know to load Stage1_5?
I’ve been searching high & low, but cannot find a definitive answer as to how GRUB Stage_1 (IPL of MBR) knows how to load Stage1_5.
I’ve read the GNU Grub manual and various other forums but since I don’t know C, I can’t reverse engineer or figure out the source code to determine whether Stage1_5 is loaded or not.
I understand that, as part of the OS install procedure, GRUB writes Stage_1 (as the IPL) into the MBR, and that this then calls either Stage1_5 or Stage_2, depending on whether Stage1_5 is installed.
I also believe that Stage1_5 is usually installed into the sectors following the MBR into the so-called DOS compatibility region (the next 62 sectors within the first cylinder before the first partition).
However, assuming Stage1_5 is installed, is there a routine within Stage_1 that checks to see if Stage1_5 is installed and if so jumps & runs to it?
Or, if Stage1_5 is not installed would the same routine then jump to & run Stage_2?
Or, does the GRUB installer intelligently install specific Stage_1 code dependent upon whether Stage1_5 was installed or not? i.e. If the GRUB installer was able to load Stage1_5 then the Stage_1 code it installs would have the routine to jump to & run Stage1_5. Or, if the GRUB installer did not install Stage1_5, it would install different Stage_1 code to jump to & run Stage_2
I appreciate this may be moot, what with GRUB 2 but I’d like to have a better understanding of this process.
TIA – Derrick
|
|
|
|
12-31-2009, 04:11 AM
|
#2
|
|
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 11,225
|
Quote:
Originally Posted by derrickr
Or, does the GRUB installer intelligently install specific Stage_1 code dependent upon whether Stage1_5 was installed or not? i.e. If the GRUB installer was able to load Stage1_5 then the Stage_1 code it installs would have the routine to jump to & run Stage1_5. Or, if the GRUB installer did not install Stage1_5, it would install different Stage_1 code to jump to & run Stage_2
|
This is my understanding. The stage1 code simply (always) jumps out - whether to stage 1.5 or 2 it neither knows nor cares. It is simply a sector number that the install procedure writes into the stage1 code as it's written into the MBR or (partition) boot sector.
|
|
|
|
12-31-2009, 07:57 AM
|
#3
|
|
Senior Member
Registered: Nov 2001
Location: Toledo, Ohio - USA
Distribution: Mageia 1
Posts: 1,079
Rep:
|
The GRUB installer writes the jump instruction in the stage 1 code, directing the CPU where to pick up the next set of instructions. The installer keeps track of if stage 1_5 is installed, and writes the jump instruction to point to it if it is installed. If stage1_5 is mot installed, the installer sets the jump instruction to point to the first instruction in stage_2. If anything changes (e.g.: a GRUB update) that may relocate or eliminate stage 1_5, or relocate stage _2, the boot loader in the MBR is rewritten with a new jump instruction.
HTH,
|
|
|
|
12-31-2009, 08:11 AM
|
#4
|
|
LQ Newbie
Registered: Dec 2006
Location: Shoreditch, London
Distribution: Debian
Posts: 2
Original Poster
Rep:
|
Understood.
I had a feeling that might be the case, but needed positive confirmation instead of my (hopefully) 'educated guesses'!
Thanks guys 
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:30 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|