Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Jun 2005 06:15:18 -0400
From:      Suleiman Souhlal <ssouhlal@FreeBSD.org>
To:        Seb <sebastien.b@swissinfo.org>
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: Accessing filesystem from a KLD
Message-ID:  <42F160E7-9B19-4A8A-8656-A86E0076EBB3@FreeBSD.org>
In-Reply-To: <200506251203.13569.sebastien.b@swissinfo.org>
References:  <200506251203.13569.sebastien.b@swissinfo.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 concerns. Blocking calls  
> are OK.
> I have searched the manpages and the web, but I haven't found anything
> relevant.
> Thanks,
> Sebastien

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.

--
Suleiman Souhlal     | ssouhlal@vt.edu
The FreeBSD Project  | ssouhlal@FreeBSD.org




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42F160E7-9B19-4A8A-8656-A86E0076EBB3>