Re: Accessing filesystem from a KLD

From: Suleiman Souhlal (ssouhlal_at_FreeBSD.org)
Date: 06/25/05

  • Next message: Peter Jeremy: "Re: To C++ or not to C++"
    Date: Sat, 25 Jun 2005 06:15:18 -0400
    To: Seb <sebastien.b@swissinfo.org>
    
    

    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
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
    

  • Next message: Peter Jeremy: "Re: To C++ or not to C++"

    Relevant Pages

    • Re: Accessing filesystem from a KLD
      ... > How can I access the filesystem from a kernel module? ... like building the firmware image into the kernel for cases where you are NFS ... for Genesis Software - http://www.gsoft.com.au ...
      (freebsd-hackers)
    • Accessing filesystem from a KLD
      ... How can I access the filesystem from a kernel module? ... I want my device driver to retreive a firmware image stored on the ... Blocking calls are OK. ...
      (freebsd-hackers)
    • Re: Device-mapper submission for 2.4
      ... > device driver like dm? ... XFS is a totally different filesystem from the ones present in 2.4. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: About device file
      ... abstraction where you can interact with a device driver using filesystem ... primitives (like opening the device special file for a serial port and ...
      (comp.os.linux.development.system)
    • Re: The find tool is failing for a missing fs driver
      ... Phillip Susi wrote: ... It's a bug in the kernel module for the proc ... filesystem. ...
      (Ubuntu)