Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 06 May 2005 13:35:31 -0700
From:      Bakul Shah <bakul@BitBlocks.com>
To:        David Parfitt <diparfitt@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: FS impl. 
Message-ID:  <200505062035.j46KZVu0041406@gate.bitblocks.com>
In-Reply-To: Your message of "Fri, 06 May 2005 15:56:03 EDT." <3c220db005050612561d05cefa@mail.gmail.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
>   I have been trying to write my own UFS-like filesystem
> implementation for fun. I had read somewhere that UFS was developed in
> user space (correct me if I'm wrong on that one) and then moved over
> to kernel-space. I was wondering if there are any existing facilities
> in the kernel source tree that would allow me to develop an fs in user
> space easily or with a little tweaking? As of right now, I have to
> develop, compile, panic, reboot, debug etc. which is frustrating and
> time consuming.

A stub FS that directs all vfs calls to userland would be a
handy thing....  Similarly a stub disk --  one should be able
to debug support for Petabyte size disk without having to buy
one.

As for shortening the compile/debug/panic/reboot cycle, you
can use qemu.  Once a guest os is installed on a disk-image,
you can do this:

# qemu -s disk-image
# cd /usr/obj/usr/src/sys/<KERNEL>
# gdb kernel.debug
(gdb) target remote localhost:1234

That is it!  No need to set up serial console or anything.

I haven't tried this but I guess this should work: If you
make the FS module a kernel module, and use qemu's snapshot
feature, after a crash you can reload from your image right
before FS module loading and go from there.

Now with a kernel module `kqemu', qemu runs approx twice as
slow as real h/w for usercode (as opposed to about 25 times
slower without kqemu).



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505062035.j46KZVu0041406>