reading a file in kernelmode

Fernando Apesteguía fernando.apesteguia at gmail.com
Thu Jul 17 07:06:29 UTC 2008


On 7/17/08, Marc Lörner <marc.loerner at hob.de> wrote:
> Hello David!
>
> On Thursday 17 July 2008 01:46, David wrote:
> > Hello,
> >
> >
> >
> > I'm developing a FreeBSD kernel module and I'm searching for a good
> > solution to open/read/close a file.
> >
> > My goal is to generate a MD5-Hash of a given file (path).
> >
> >
> >
> > Open-Syscall  seems to be improper.
> >
> >
> >
> > Any ideas/solutions/examples?
> >
>
> Look at file kern/kern_ktrace.c at the use of vn_open in function
> ktrace(td, uap) and VOP_WRITE in function
> ktr_writerequest(struct thread *td, struct ktr_request *req)
>
> I think reading is done quite analogue to writing in case above.

Hi,

I'm just curious, is it proper to read a file from kernel space? Is it
something the kernel is supposed to do?

Thanks in advance.
>
> HTH,
> Marc
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>


More information about the freebsd-hackers mailing list