grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

the question about grub_fs_probe.


From: liu Aleaxander
Subject: the question about grub_fs_probe.
Date: Tue, 3 Mar 2009 23:35:29 +0800

Hi, all.

in the function grub_fs_probe, there something i can't understand.
the environment i'm on is :
a bootable image create by grub-mkrescue, boot with bochs. so in the grub's view, there are two devieces, fd0 and memdisk.
fd0 with no filesystemm, memdisk with a tarfs filesystem.
i have set the fs debug on.

here is the key code;

for (p = grub_fs_list; p; p = p->next)
    {
      grub_dprintf ("fs", "Detecting %s...\n", p->name);
      (p->dir) (device, "/", dummy_func);
      if (grub_errno == GRUB_ERR_NONE)
        return p;

      grub_error_push ();
      grub_dprintf ("fs", "%s detection failed.\n", p->name);
      grub_error_pop ();

      if (grub_errno != GRUB_ERR_BAD_FS)
        return 0;

      grub_errno = GRUB_ERR_NONE;
    }

      /* Let's load modules automatically.  */
      if (grub_fs_autoload_hook && count == 0)
    {
      count++;
     
      while (grub_fs_autoload_hook ())
        {
          p = grub_fs_list;
         
          (p->dir) (device, "/", dummy_func);
          if (grub_errno == GRUB_ERR_NONE)
        {
          count--;
          return p;
        }
         
          if (grub_errno != GRUB_ERR_BAD_FS)
        {
          count--;
          return 0;
        }
         
          grub_errno = GRUB_ERR_NONE;
        }

      count--;
    }

in my environment,  when i using command ls (fd0), it will put something i can't understand.
cause, in the first time, there is only one fs in the grub_fs_list list, and can't dir the fd0, so,  it will do the while loop for autoloading the fs mode one by one, but the place where i can't understand happens here:
say, it will autoload the affs first, then p=grub_fs_list, and try p->dir(device, "/",dummy_func), but why it will goto the above sentence in the for loop, that's to say, why it puts the debug message : Detecting affs...     and something like this.

there are no callback or directly call, why it exectue the back instruction?

Thanks!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]