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

Re: [Minios-devel] [UNIKRAFT PATCH v2 0/6] Move VFS initialization to ukboot



On 08.09.19 17:05, Costin Lupu wrote:
Hi Simon,

We clearly need to come up with a solution for initializing filesystems.
However, these series have to be reworked:
1. You should add your changes once > 2. We should add this init thing in 
vfscore instead of bloating the
boot.c code.

I originally chose libukboot because of our current boot logic. The reason is that we should not use any pre-init or init table entries for our system initialization. We should treat the tables as reserved to the Unikernel(-ized) program and its libraries. So far we used them for the case when we need memory and/or scheduling support. However, whenever we port existing standard user space programs (e.g., Linux program) to our environment, we actually should be aware that its constructor and init functions interact already with or system components. Effectively, they should be fully initialized at that point. I expect that most interactions are done with the VFS.
Overall our current boot stages should look like this:

 0) Entry and early platform init (platform library)
 1) Unikraft constructors
    Cannot use ukalloc or uksched because it is not initialized yet.
 2) Unikraft init
    2.1) ukalloc
    2.2) uksched
    2.3) VFS
    2.4) Networking
    2.5) etc.
 3) Program constructors
    These are the entries that we find in the pre-init and init
    sections.
 4) Enter main() of the program

Everything of point 2 is currently hard-coded to libukboot. So it makes currently sense to put our VFS initialization there instead of registering it to the pre-init or init section. In fact, I agree that we need to introduce a "Unikraft init table" (similar to Unikraft constructors) where our system libraries can register themselves to. As intermediate solution I could introduce a vfscore_init() function that is called from libukboot, similar to what we did with lwip. This way, we keep the VFS init code in vfscore.

However, I also had a second reason for putting the VFS init code to libukboot: I had in mind that we could add initrd support with another patch series relatively easy:
 1) Mount ramfs for /
 2) Search for an archive in initrd section
 3) Decompress archive to /
 4) Add initrd memory region to initialized ukalloc
    because we do not need it anymore.

A decompressing algorithm that creates directories and files from the archive (e.g., based on zlib) is the only missing piece. No. 4 requires knowledge about which allocator to add memory regions to. This would be currently much easier with libukboot that could dictate this. However, we can also find another solution for doing this when implementing initrd support as part of vfscore...

What do you think?


Cheers,
Costin

On 9/6/19 3:03 PM, Simon Kuenzer wrote:
This patch series moves mounting filesystems as part of the Unikraft
initialization to lib/ukboot. This will later simplify adding more features
to the automount code because it is at a single place (e.g., loading initrd
as root filesystem, enable mounting 9pfs shares as root mountpoint).

Previously, the option to automatically mount a ramfs to / was hidden.
It only appeared when devfs was selected. This series is also making devfs
and ramfs permanently visible in the menu to simplify the usage.

Changes since v1:
  - Adopt to latest staging state
  - Add ability to configure root fs with kernel parameters

Simon Kuenzer (6):
   lib/ukboot: Application constructors right before calling application
   lib/devfs, lib/ukboot: Move option to automatically mount root to
     libukboot
   lib/ukboot: devfs automount option
   lib/ramfs: Config.uk: Use select for dependency
   lib/ukswrand: Clean-up: devfs nodes are independent of MWC algorithm
   lib/ukboot: Root filesystem as library parameter

  lib/devfs/Config.uk               |   8 +--
  lib/devfs/devfs_vnops.c           |  25 --------
  lib/ramfs/Config.uk               |   2 +-
  lib/ukboot/Config.uk              |  29 +++++++++
  lib/ukboot/Makefile.uk            |   3 +
  lib/ukboot/boot.c                 | 102 +++++++++++++++++++++++-------
  lib/ukswrand/Config.uk            |   5 +-
  lib/ukswrand/Makefile.uk          |   6 +-
  lib/ukswrand/{mwc_dev.c => dev.c} |  26 +++++---
  9 files changed, 134 insertions(+), 72 deletions(-)
  rename lib/ukswrand/{mwc_dev.c => dev.c} (83%)


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.