[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
some semi-technical GRUB questions
From: |
Simon Kitching |
Subject: |
some semi-technical GRUB questions |
Date: |
Thu, 10 Jan 2002 20:49:34 +1300 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.7) Gecko/20011221 |
Hi,
I'm trying to figure out generally how GRUB works. I'm interested in
getting into
some kernel hacking (gnumach/hurd), rather than GRUB hacking, but am
trying to get
a feel for what happens before the kernel gets to execute.
Your doc at http://www.gnu.org/manual/grub-0.90/html_mono/grub.html,
together
with the partition documentation at
http://www.win.tue.nl/~aeb/partitions/partition_tables.html
have given me a pretty good idea, but I would appreciate it if you could
spare some time to answer the following questions. If you like, I could
type up the answers
& submit a patch to the grub.html doc (or the base document if this is
generated from
something else)...
Alternatively, if there is more documentation on GRUB somewhere, please
point me at it!
1. where does the stage1.5 get written to on a hard-drive?
(*) if using FFS or ReiserFS, and there is sufficient space in the
"boot area"
reserved by these filesystems, is that space used? Is it the
first choice
location?
(*) does GRUB check the partition table to look for "gaps" between
partitions,
and assume that they are available for use? If so, what kinds of gaps
qualify (eg would space after the last partition be used?)
[a note in the existing doc implies that the first partition *often*
starts at (cyl=0,head=1,sector=0) rather than immediately after the
MBR (cyl=0,head=0,sector=1), but not always]
(*) if there aren't any gaps between partitions, then what does grub do?
does it resize partitions? does it print an error message & give up?
does it write the stage1.5 into the filesystem containing the boot
partition?
2. What are the implications of "defrag"-type operations on a filesystem
containing a stage2 (or a stage1.5 if these do get stored within
filesystems)?
Considering the stage1 or stage1.5 has a "block-list" pointing to it, I
presume this is unhealthy...
3. Is there a copy of the "multiboot standard" document anywhere?
4. Where does GRUB get its file-system implementations from? Are they taken
from linux/hurd/bsd, or rewrites? If taken from a kernel release, do they
need to be modified to run in the GRUB environment (eg if grub
doesn't have
paging enabled)? Related issue: will GRUB support booting to
ext3/jfs/jffs/etc
partitions?
5. When invoking the kernel's entrypoint, is the CPU in 16-bit or 32-bit
mode?
6. What exactly is the entry point to the GNUMACH kernel from grub? Yes,
I know
this isn't exactly a GRUB question, but it is related to Q6 above.
Symbol boot_entry[i386/i386at/boothdr.S] looks a very likely
candidate, provided
that the transition to 32-bit mode has already happened. However,
there is this
critical variable "phys_mem_va" that appears to be initialised in
only one place:
function i16_init(void) in i16_init.c. I can't see how this 16-bit
code could
have been called, because the multiboot header defined in boothdr.S
appears to
tell grub that the entry point is boot_entry. But that phys_mem_va
variable
is pretty important!
Can anyone help me out on this?
Thanks in advance,
Simon
- some semi-technical GRUB questions,
Simon Kitching <=