Annotation of wikisrc/projects/project/kernfs-rewrite.mdwn, revision 1.1

1.1     ! jmmv        1: [[!template id=project
        !             2: 
        !             3: title="Rewrite kernfs and procfs"
        !             4: 
        !             5: contact="""
        !             6: [tech-kern](mailto:tech-kern@NetBSD.org)
        !             7: """
        !             8: 
        !             9: mentors="""
        !            10: [Julio Merino](mailto:jmmv@NetBSD.org)
        !            11: """
        !            12: 
        !            13: category="filesystems"
        !            14: difficulty="medium"
        !            15: duration="2-3 months"
        !            16: 
        !            17: description="""
        !            18: kernfs is a virtual file system that provides the user several information about
        !            19: the current system and, in some cases, allows him to configure some aspects of
        !            20: the kernel through those virtual files.  procfs is another virtual file system
        !            21: that provides information about the currently running processes.
        !            22: 
        !            23: These two file systems are written in a non-extensible way.  For example, kernfs
        !            24: is built on a hardcoded table that always exposes the same set of files; there
        !            25: is no way for other system areas to add or remove entries from the kernfs
        !            26: contents.  procfs has similar issues as someone might think of a subsystem that
        !            27: could benefit from attaching information of its own to each running process.
        !            28: The current code is not modular, not well-designed and, as time has shown, there
        !            29: probably remain serious security bugs in them.
        !            30: 
        !            31: Linux exposes some APIs that abstract procfs' contents and allow external code
        !            32: to manage its entries by adding or removing files and/ or directories.  This is
        !            33: a very interesting feature when writing loadable kernel modules as they can use
        !            34: this virtual file system to provide a way of interaction with the end user.
        !            35: 
        !            36: NetBSD could benefit of similar APIs for both kernfs and procfs.  This project
        !            37: would consist on adding these APIs, which most likely requires (or suggests) a
        !            38: full rewrite of these file systems.  The developer should keep in mind the
        !            39: distinction between the two to avoid having a procfs similar to the one in
        !            40: Linux, which mixes system configuration and process management.
        !            41: 
        !            42: In order to keep the new implementations simple, the developer should
        !            43: investigate the possibility of using tmpfs as a backend for kernfs and procfs.
        !            44: With some changes, one could create a kernel "library" that allowed the creation
        !            45: of virtual file systems with few code.  For example, it's unlikely that the
        !            46: directory management routines will change among the three file systems, so the
        !            47: code from tmpfs should be reused.  Similarly other features should be reusable,
        !            48: making procfs's and kernfs's code a lot simpler than currently is.
        !            49: 
        !            50: Alternatively, investigate FreeBSD's pseudofs and see if this could be a useful
        !            51: for this project and base for all the file systems mentioned above.
        !            52: 
        !            53: When working in this project, it is very important to write a complete
        !            54: regression test suite for procfs and kernfs beforehand to ensure that the
        !            55: rewrites do not add incompatibilities.
        !            56: """
        !            57: ]]

CVSweb for NetBSD wikisrc <wikimaster@NetBSD.org> software: FreeBSD-CVSweb