From owner-freebsd-fs@FreeBSD.ORG Tue Oct 19 09:06:28 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DEAC916A4CE for ; Tue, 19 Oct 2004 09:06:28 +0000 (GMT) Received: from axe-inc.co.jp (axegw.axe-inc.co.jp [61.199.217.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id BEBE943D2D for ; Tue, 19 Oct 2004 09:06:27 +0000 (GMT) (envelope-from takawata@axe-inc.co.jp) Received: from localhost (localhost [127.0.0.1]) by axe-inc.co.jp (8.9.3+3.2W/3.7W) with SMTP id SAA28825; Tue, 19 Oct 2004 18:05:57 +0900 (JST) Message-Id: <200410190905.SAA28825@axe-inc.co.jp> X-Authentication-Warning: axegw.axe-inc.co.jp: localhost [127.0.0.1] didn't use HELO protocol To: "Daniel Gustafsson" In-reply-to: Your message of "Mon, 18 Oct 2004 10:19:54 +0200." <200410180814.i9I8ET70015904@space.se> Date: Tue, 19 Oct 2004 18:05:56 +0900 From: Takanori Watanabe cc: freebsd-fs@freebsd.org Subject: Re: Extracting FFS from FreeBSD X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Oct 2004 09:06:29 -0000 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 #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; }