Re: Porting BeFS to FreeBSD for GSoC2025

From: <paige_at_paige.bio>
Date: Mon, 03 Mar 2025 21:04:44 UTC
I’ve collectively been making an ExFAT native driver (uses VFS instead of fuse) 

https://github.com/paigeadelethompson/exfat

And I’ve been using an LLM to do it. I recommend using something like Claude if you can, not sure when I’ll be done with this but if you want some advice: 

- start with newfs and use a known good chkdsk or fsck program on another computer; macOS is good starting point if you can get befs.fsck there otherwise plan on having to copy stuff back and forth a bit.

If you use an LLM and can get this converted to text: https://www.nobius.org/dbg/practical-file-system-design.pdf it will help you a lot 
ExFAT is documented extensively on MSDN and Claude-3.5-sonnet seems to have pretty decent RAG. In any case I recommend having a look through my README and making heavy use of bootverbose.. but you will also want to enable the various kernel level options in my readme, VFS is a little tricky but once you get through this initial mount trace:

https://github.com/paigeadelethompson/exfat/commit/187c6694c68554f7961b427501373984a0742366

The rest shouldn’t be as bad.. you can see the snippet of bootverbose messages have the function name that its calling from (very helpful to have honestly especially if you’re using an LLM) but be prepared to drop into DDB and reset / retry a few dozen or a hundred times until you figure out VFS in any case xD

At least with lock debugging enabled in the kernel it’s a little more actionable. 

Sent from my iPhone

> On Mar 3, 2025, at 6:05 AM, Pedro Giffuni <pfg@freebsd.org> wrote:
> 
> 
> Hello Krutarth;
> 
> Thank you for the interest!
> 
> Yes, the idea is still open. In all honesty FreeBSD does have much better filesystems than openBFS, but we don't have a "true" journalling filesystem and BFS is rather well documented with an open implementation so it could still be a nice to have.
> 
> At a time I spoke with some Haiku guys and Bruno was interested in co-mentoring this project.
> 
> As I mentioned in private, you are probably better of checking the ext2fs sources (sys/fs/ext2fs), for a simplified UFS. We don't have any open issues AFAICT, but maybe fedor@ has something pending.
> 
> For documentation "The Design and Implementation of the FreeBSD OS", seems pretty much compulsory.
> 
> Pedro.
> 
> ps. I am somewhat retired from FreeBSD, if such a thing exists, but if no one else steps in I would co-mentor.
> 
> 
> On Monday, March 3, 2025 at 12:53:00 AM GMT-5, Krutarth Patel <krutarthpatel929@gmail.com> wrote:
> 
> 
> Hello,
> 
> I am interested in porting BeFS from Haiku. I see that it is listed as one of the GSoC ideas.
> 
> I have done some contributions in the PCI subsystem over at Haiku and have some Linux kernel debugging experience. 
> 
> I am new to FreeBSD( not entirely, I am in the process of porting a driver from FreeBSD to Haiku) and filesystems in general( I have an idea of the basic terminologies like inode, block etc. but thats about it).  But I am willing to learn.
> 
> Here are my questions:
> 
> Is the idea still open?
> Are there any smaller issues I can resolve to get myself familiar with codebase?( something related to UFS/ZFS would be perfect)
> Where is the UFS and ZFS implementation in the source tree?
> Any recommended resources for learning about filesystems( specifically FreeBSD, I am reading a guide about BeFS )?
> Looking forward to hearing from you
> 
> 
> 
>