Re: Accessing filesystem from a KLD

2005-07-02 Thread Seb
Andrey Simonenko wrote : > You got page fault from namei(), which is called from vn_open() to lookup > a path name. namei() tries to obtain a reference on current directory for > the current thread. This current directory (fd_cdir field) is NULL in > your kthread. At this point a page fault in k

Re: Accessing filesystem from a KLD

2005-06-29 Thread Andrey Simonenko
On Wed, Jun 29, 2005 at 11:55:50AM +0200, Seb wrote: > > Why not to use VOP_READ? See how it is called in dev/md.c:mdstart_vnode, > > check kern/vfs_vnops.c:vn_open_cred for information how to lookup a file > > name and open it. > > That's what I do, however I use the wrapper functions vn_open(),

Re: Accessing filesystem from a KLD

2005-06-29 Thread Seb
> Why not to use VOP_READ? See how it is called in dev/md.c:mdstart_vnode, > check kern/vfs_vnops.c:vn_open_cred for information how to lookup a file > name and open it. That's what I do, however I use the wrapper functions vn_open(), vn_rdwr() and so. But I have a problem, when I call this cod

Re: Accessing filesystem from a KLD

2005-06-29 Thread Seb
> There's also a desire to provide an easier to use interface for > drivers to load, for example, firmware. Is there an existing development ? I think I'll separate retreiving firmware from the filesystem in another KLD, so maybe I should contact the developers... ___

Re: Accessing filesystem from a KLD

2005-06-25 Thread M. Warner Losh
In message: <[EMAIL PROTECTED]> Suleiman Souhlal <[EMAIL PROTECTED]> writes: : You can use vn_open() to open the file, and then read it using vn_rdwr : (), and finally, vn_close() to close it. Look at src/sys/kern/ : link_elf_obj.c for an example. There's also a desire to provide an

Re: Accessing filesystem from a KLD

2005-06-25 Thread Daniel O'Connor
On Sat, 25 Jun 2005 19:33, Seb wrote: > How can I access the filesystem from a kernel module ? > In fact, I want my device driver to retreive a firmware image stored on the > filesystem (instead of putting the firmware data in a static array at > compile-time) for memory usage and legal concerns. B

Re: Accessing filesystem from a KLD

2005-06-25 Thread Suleiman Souhlal
Hi, On Jun 25, 2005, at 6:03 AM, Seb wrote: Hello, How can I access the filesystem from a kernel module ? In fact, I want my device driver to retreive a firmware image stored on the filesystem (instead of putting the firmware data in a static array at compile-time) for memory usage and legal

Accessing filesystem from a KLD

2005-06-25 Thread Seb
Hello, How can I access the filesystem from a kernel module ? In fact, I want my device driver to retreive a firmware image stored on the filesystem (instead of putting the firmware data in a static array at compile-time) for memory usage and legal concerns. Blocking calls are OK. I have searched