Writing a plain text file to disk from kernel space

Marc Lörner marc.loerner at hob.de
Tue May 15 06:47:44 UTC 2007


Hello Lawrence,

in file kern/vfs_syscalls.c you can see the kern_open function that uses 
vn_open to open a file/vnode.

There are more vn_* functions like vn_rdwr for reading and writing to a vnode 
or vn_close to close a vnode. To see how theses functions work, I suggest you 
grep for them in the kernel-files.

BTW, you can get an thread-struct pointer from curthread (c.f. sys/pcpu.h).

HTH,
Marc Lörner


More information about the freebsd-hackers mailing list