[Prev][Next][Index][Thread]

RE: fopen()



>Yes, but you have to do some more initialization beyond mounting the
>partition. I suggest you look at the example program:
>
> examples/x86/more/netbsd_fs_posix.c
>
>which is a demonstration kernel that does something like what you want to
>do. Specifically, there is a call to start_fs() in that program. That
>routine lives in oskit/startup/start_fs.c. Start_fs() arranges for the
>the filesystem namespace to be created from the blkio (partition), and for
>that namespace to be made available to the C/Posix library so that the
>fopen call has something to operate on (that is, the filesystem namespace).
>Put another way, after the mount and getroot, you need to initialize the
>namespace and the clientos library. The example program you started with
>(linux_fs_com) was intended to talk to the COM interfaces directly, not to
>the C/Posix library.
>
>Look for the call to oskit_create_fsnamespace() in start_fs(). Note that
>this stuff is mostly documented in the oskit manual in the chapters
>describing the clientos (Chap 11), filesystem namespace (Chap 20), Posix
>LIbrary (Chap 17), and the C libraries (Chap 12 or 18).
>
>Good Luck. Let us know if you have any more questions.
>
>Lbs


Thanks for the help! I've added fs_init(dir) and now "fopen" seems to work
fine. But when I try to use fread() I get an assertion failed error. Am I
missing something? Thanks for All!!

Facundo Arena