Hi Suhel,I recently created a wrapper for fs_shell to make xfs_shell just like
you're attempting to make ufs_shell.My commit could be of help to you:
https://review.haiku-os.org/c/haiku/+/2096
When trying to make the ufs_shell, you don't necessarily need to know the
internals of the file system you are implementing.There are two steps that will
help you better understand my commit:1) Visit src/add-ons/kernel/file-systems
- Here you find all the file systems. You make a dir here which will hold your
core file system code.2) Visit src/tests/add-ons/kernel/file_system - Here
you will find fs_shell wrappers that Haiku has in it's bag, eg., for bfs,
btrfs, xfs, udf etc.
Knowing this, you should now be able to relate to the code in the commit above.
Thanks,cruxbox
On Sunday, 8 March, 2020, 2:59:53 pm IST, Suhel Mehta
<mehtasuhel@xxxxxxxxx> wrote:
On Mon, Mar 2, 2020 at 11:39 PM Adrien Destugues
<pulkomandy@xxxxxxxxxxxxx> wrote:
I have compiled Haiku and I am running it on my virtual machine.
I want to work on UFS2 file system.
Ok, in that case the first step will be to create some directories and
Jamfiles in Haiku
to add the new filesystem to it. You can look at
https://review.haiku-os.org/c/haiku/+/2096
as a reference, it recently added similar things for the XFS filesystem.
The idea is to get an "fs_shell" running. This is an application that will
run the filesystem
code in a controlled environment and allow to run specific parts of the code
through a command
line interface, with the availability of an user-space debugger. It makes it
a lot simpler to
test the filesystem code.
You will need to read about the structure of the filesystem, an entry point
for this is the
wikiepdia article (https://en.wikipedia.org/wiki/Unix_File_System) and in
particular the references:
- The original specifications:
https://people.eecs.berkeley.edu/~brewer/cs262/FFS.pdf
- The 64bit extensions:
https://www.usenix.org/legacy/events/bsdcon03/tech/full_papers/mckusick/mckusick_html/
- The variant implemented in Solaris (which may be a bit different from the
one in FreeBSD):
http://ptgmedia.pearsoncmg.com/images/0131482092/samplechapter/mcdougall_ch15.pdf
Once you have some understanding of the filesystem structure, you should be
able to start
implementing the first commands of the fs_shell, to identify (recognize if
it's ufs or not)
and then mount a filesystem image.