Hello everyone,

I've been working on trying to set up a RAM disk and obtain an
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL instance that "points" to a FAT32 volume in
it.
My team managed to accomplish this by loading the RamDisk.efi driver and
reproducing a portion of the code that implements the 'mount' command[1].
We had to do it because simply loading the RamDisk.efi driver(which
installs a BlockIO protocol instance providing access to a FAT32-formatted
memory buffer) does not trigger the creation of an
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL by the filesystem driver: we needed to
reinstall the BlockIO protocol provided by the driver in order to finally
make the filesystem driver get notified and detect the new volume in the
RAM disk.

This solution is working so far, but we've been bugged by having to rely on
this workaround: after all, wasn't the filesystem driver supposed to be
notified every time a new BlockIO is registered and then, if it detects a
valid FAT volume in it, generate the appropriate
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL instance? Why is it only notified when the
BlockIO protocol instance is reinstalled?

The comment below can be found just before the code we checked in*mount.c*,
but we couldn't relate it to the scenario we have:

  //
  // In EFI the file system driver registers to get notified when DiskIo
  // Devices are added to the system. DiskIo devices register to get
notified
  // when BlkIo devices are added to the system. So when a block device
shows
  // up a DiskIo is added, and then a file system if added if the media
  // contains a file system. This works great, but when you boot with no
media
  // in the device and then put media in the device there is no way to make
  // the notify happen.
  //
  // This code reads a block device. If the BlkIo device returns
  // EFI_MEDIA_CHANGE then it must reinstall in BlkIo protocol. This cause
the
  // notifies that make the file system show up. The 4 loops is just a
guess it
  // has no magic meaning.
  //

So could anyone explain what piece of understanding is missing here?
Thank you all in advance.

[1] at
*EdkCompatibilityPkg/Other/Maintained/Application/Shell/mount/mount.c*,
around line 250.

-- 
[image: LSBD] <http://www.lsbd.ufc.br/>
*Felipe Martins Mesquita*

Technical Lead

BSc in Computer Science - UFC

GTalk: felipe.mesqu...@lsbd.ufc.br

Skype: felipe.martins23
------------------------------------------------------------------------------
Time is money. Stop wasting it! Get your web API in 5 minutes.
www.restlet.com/download
http://p.sf.net/sfu/restlet
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to