Re: Grub and the VSTa filesystem

From: Thomas J. Erdos <erdost_at_nospam.org>
Date: Sat Jul 31 1999 - 18:00:33 PDT

Gary Wong wrote:

> Thomas J. Erdos writes:
> >into the vstafs_read subroutine. So I tried with the newer version, but
> >that didn't work either because the installation procedure of GRUB
> >assumes that the second stage file on the harddrive begins at offset 0
> >of a sector. This is however not the case for vstafs. The begin of the
> >file is somewhere at the end of the first block. Here an exempt from the
> >headerfile:
> >
> >struct fs_file {
> ...
> > /* ...this keeps fs_dirent's aligned
> >304 */
> > char fs_data[0]; /* Data starts here 320 */
> >};
> >
> >The solution would be to move "char fs_data[0]" to the begin of the next
> >block, whereever it is, in the current extent or in the next extent, or
> >the first entry in the fs_file could be jump instruction to the start
> >of the data, or modify the bootloader. The last option is not simple at
> >all. I have to discuss it with the current developer of GRUB.
>
> I must be missing something, but can't you just add (512-320) zero bytes
> to the start of the bootloader, so that the "real" data starts on the next
> block boundary?
>

Yes. You are missing something. The GRUB consists of two parts, (sometimes
three):
   -stage1, is loaded by the BIOS from the bootsector of a floppy or
harddrive.
   (-stage1.5, is loaded by stage1 and contains only one filesystem unlike
stage2)
  -stage2 is loaded by stage1.

The question is now, how does the first stage bootloader, - which is only 512
bytes big, and does not know about filesystems- where to find stage2, that
might be stored on a harddrive, as a file on a filesystem, is much bigger
than 512 bytes, has the knowledge about the filesystem, and the blocks need
not succeed each other.

When the stage2 is installed, while reading the stage2 file, the bootloader
stores the sectors which were read, in the stage1. When stage1 is loaded by
the BIOS, it just loads the stored sectors, and voila stage2 is there
whithout any information about the filesystem. This means also, that one
shouldn't move stage2 from the original position, else the system won't boot
again.

>
> Cheers,
> Gary.
> --
> Gary Wong, Department of Computer Science, University of Arizona
> gary_at_cs.arizona.edu http://www.cs.arizona.edu/~gary/

Thomas J. Erdos
Received on Sat Jul 31 22:16:20 1999

This archive was generated by hypermail 2.1.8 : Thu Sep 22 2005 - 15:12:56 PDT