Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Oct 2004 18:05:56 +0900
From:      Takanori Watanabe <takawata@axe-inc.co.jp>
To:        "Daniel Gustafsson" <daniel.gustafsson@space.se>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: Extracting FFS from FreeBSD
Message-ID:  <200410190905.SAA28825@axe-inc.co.jp>
In-Reply-To: Your message of "Mon, 18 Oct 2004 10:19:54 %2B0200." <200410180814.i9I8ET70015904@space.se>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <200410180814.i9I8ET70015904@space.se>, "Daniel Gustafsson" wrote:
>
>Hello.
>
>I am working in a project which is in need of a stand-alone file system and
>I am interested in extracting FFS from BSD and modyfi it to a stand-alone
>module. I have some questions before I begin:
>
>1. Is there any simple way to get FFS source code including all the layers
>nessesary to make a separate module (any tips and hints)?
>
>2. Is there any Blockbased RAM driver available (or something like it) that
>can be used to test the system on RAM?
>
>3. Can somebody give me some information about the footprint of FFS?
>
>4. Does somebody have any tips of other file systems that already work as a
>stand-alone module (requirements: blocksize(4-16K), partitions(>=1GB))? 

How about libstand(3) in /usr/src/lib/libstand, 
which is used in /boot/loader(8)?
I don't think the FS support code in it does
not support multi user. 

Following code is not work, but  can be linked with 
%cc -nostdlib -ffreestanding -static hoge.c -lstand

% file hoge
hoge: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), statically linked, stripped
% ls -l hoge
-rwxr-xr-x  1 takawata  wheel  16020 10 19 17:57 hoge
%size hoge
   text    data     bss     dec     hex filename
  13257     264     536   14057    36e9 hoge
# size ufs.ko
   text    data     bss     dec     hex filename
 203060    6404     452  209916   333fc ufs.ko

==hoge.c
#include <stand.h>
#define STUB

struct fs_ops *file_system[] = {
  &ufs_fsops,
  NULL
};

struct devsw mydev = {
};

struct devsw *devsw[] = {
  &mydev,
  NULL
};
#ifdef STUB
int getchar(void)
{
  return 0;
}
int ischar(void)
{
  return 0;
}
void putchar(int c)
{
  return ;
}
int devopen(struct open_file *of, const char *name,const char **file)
{
  return EBUSY;
}
void panic(const char *msg, ...)
{
  for(;;);
}
#endif
main()
{
  int a;
}



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