[openbeos] Re: userspace FS, device driver in userspace?

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Tue, 30 Oct 2007 16:52:31 +0100

On 2007-10-30 at 13:44:23 [+0100], Clemens Zeidler 
<clemens.zeidler@xxxxxxxxxxxxxx> wrote:
> 
> a long time after my first ask I finally try to compile the userlandfs for
> r5.
> I checked out the haiku source and configure it with
> ./configure --target=r5
> But after a jam I can't found any lib related to the userlandfs. Is it
> not't in the r5 target? or did I miss something?
> 
> Could someone give me some more detail how to compile/ install and use the
> userland FS under r5? I'm not very familiar with the haiku build system.

The easiest way is to ask the build system to collect the components for 
you. I've added the following to my build/jam/UserBuildConfig:

# UserlandFS installation
local userlandFSDir = [ FDirName $(HAIKU_OUTPUT_DIR) userlandfs ] ;

HaikuInstall install-userlandfs : $(userlandFSDir)
        : # userlandfs
          <test>userlandfs
          <test>UserlandFSServer
          <test>ufs_mount

          # netfs
          <test>AuthenticationServer
          <test>netfs
          <test>netfs_config
          <test>NetFSServerPrefs
          <test>NetFSServer

          # ramfs
          <test>ramfs

          # reiserfs
          <test>reiserfs

        : installed!userlandfs!tests
;

I can build with

  TARGET_PLATFORM=r5 jam -q install-userlandfs

and everything (the userland FS itself and the netfs, ramfs, and reiserfs 
components) ends up in "generated/userlandfs/". Some of the files are 
expected to live in special directories. I've simply symlinked them there, 
but copying/moving works just the same:

  userlandfs -> ~/config/add-ons/kernel/file_systems/
  netfs, ramfs, reiserfs -> ~/config/add-ons/userlandfs/

The other files are executables that don't care where they are located.

Some file systems' tools require special ioctls to be passed to the file 
system, which the userland FS add-on cannot know without explicitely being 
told. This is done via the settings file 
~/config/settings/kernel/drivers/userlandfs. There's a sample in the 
repository with entries for (Haiku's) BFS and netfs: 
src/tests/add-ons/kernel/file_systems/userlandfs/r5/userlandfs.sample.

As for using: Run UserlandFSServer (e.g. in the background) and mount using 
ufs_mount. The usage is

  ufs_mount <file system> <device> <mount point> [ <parameters> ]

where <file system> is the add-on name of the file system (e.g. 
"reiserfs"), <device> the path of the device/image file to be mounted 
(usually some "/dev/disk/...", or "" if no device is needed (ramfs, 
netfs)), <mount point> the directory where to mount the file system, and 
<parameters> is a file system specific parameter string, usually omitted.

CU, Ingo

Other related posts: