To do mount, you need to define all the vnops for your filesystem. To register a new filesystem you call vfs_fsadd(), which includes the high level
https://github.com/openzfsonosx/zfs/blob/master/module/zfs/zfs_vnops_osx.c#L98 VFS calls. From that, you need to define the
https://github.com/openzfsonosx/zfs/blob/master/module/zfs/zfs_vnops_osx.c#L3920 vnops (vnode-operations). We define one set for directory-vnodes, file-vnodes, symlink-vnodes, extended-attribute vnodes and finally error-vnodes. Each list of vnops called depending on the type of the vnode object.
As you can see, the vnops include everything, like listing directories (readdir) to basic file IO (read/write) and all that. You will have to implement nearly all of them for a basic functional filesystem.
If you are just starting out, you should like at FUSE, which does all this for you and lets you define a filesystem in userland. Far fewer panics that way.
As for adding virtual device (a new /dev/diskX) entry, I used the example:
https://github.com/elsteveogrande/osx-n ... Device.cpp