Search code examples
windowsfilesystemsdriverkmdfirp

FS Development - KMDF Windows Driver


I am new here and am trying to develop a concept fs driver for the tar 'filesystem' (mount tar). My question is, how does the OS detect that a partition has the TAR filesystem and automatically load my driver?


Solution

  • first of all loaded FS called IoRegisterFileSystem - this routine inserts the device object into the list of file systems in the system. then you must have a WRK. when say file opened on device with VPB IopCheckVpbMounted is called and he call IopMountVolume - this is key point for mount understand. this routine first walk through list with registered FS and send IRP_MN_MOUNT_VOLUME to all until some FS not return success code. also the last entry in the list - special File system recognizer - he try determinate format of the volume. and if yes - he return STATUS_FS_DRIVER_REQUIRED - indicates that need load new FS for this volume. system in this case call IopLoadFileSystemDriver. this routine is invoked when a mini-file system recognizer driver recognizes a volume as being a particular file system, but the driver for that file system has not yet been loaded. at the current moment FS_Rec.sys support next FS:

    cdfs
    ReFS
    ReFSv1 // begin from win 10
    ExFat
    FastFat
    Udfs
    Ntfs
    

    for support other - you need or auto load self FS driver or self recognizer (mini driver) which recognize your FS and return STATUS_FS_DRIVER_REQUIRED on IRP_MJ_FILE_SYSTEM_CONTROL.IRP_MN_MOUNT_VOLUME and load your FS (by ZwLoadDriver call ) on IRP_MJ_FILE_SYSTEM_CONTROL.IRP_MN_LOAD_FILE_SYSTEM