Date: Fri, 13 Jul 2001 19:32:31 -0400 From: Sergey Babkin <babkin@bellatlantic.net> To: Alfred Perlstein <bright@sneakerz.org> Cc: Greg Lehey <grog@FreeBSD.org>, y-carden@uniandes.edu.co, FreeBSD Hackers <hackers@FreeBSD.org> Subject: Re: Some questions about kernel programming Message-ID: <3B4F850F.28ABECBD@bellatlantic.net> References: <M2001071206580901828@Ayax.uniandes.edu.co> <20010713113822.V45037@wantadilla.lemis.com> <20010712212809.F6664@sneakerz.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Alfred Perlstein wrote: > > * Greg Lehey <grog@FreeBSD.org> [010712 21:08] wrote: > > On Thursday, 12 July 2001 at 6:58:09 -0500, y-carden@uniandes.edu.co wrote: > > > Dear Friends > > > > > > I have some questions about kernel programming: > > > > You'd be better off sending mail like this to -hackers. I've followed > > up there. > > I also got this in private mail, hrmm.. > > > write() doesn't exist in the kernel. The simple answer is "you're > > going to have to read what the send() syscall does and emulate it". > > First, though, you need to answer the question "why do I want to do > > this in the kernel?" > > it actually exists, however the problem is that copyin and friends > assume a seperate address space, I wonder if one could do some trick > to alias the seperate address space on top of the kernel, that should > allow copyin and friends to work on pointers into the kernel's address > space. Such as looking at dofilewrite() which is what write() calls internally. dofilewrite() fills up a struct uio and calls the file descriptor's filesystem-dependent write routine. The difference for writing from kernel would be using UIO_SYSSPACE instead of UIO_USERSPACE when preparing the uio structure. -SB To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B4F850F.28ABECBD>