this is what people always suggest. read the code that is already there.
my experience has been that you quickly need to then learn how several other major parts of the kernel work which is non trivial and something i struggle with.
there is also no comments in the code which makes it even harder.
and the books that are there are not up to date with recent kernels AFAIK.
https://github.com/gotoco/dummyfs
Maybe this will help?