Date: Wed, 25 Jul 2001 18:35:44 -0600 From: "Weiguang SHI" <weiguang_shi@hotmail.com> To: tlambert2@mindspring.com, y-carden@uniandes.edu.co Cc: hackers@FreeBSD.ORG, gvega@uniandes.edu.co Subject: Re: Invoking a userland function from kernel Message-ID: <F227cew8k69RKLpgTFu00004f9f@hotmail.com>
next in thread | raw e-mail | index | archive | help
>From: Terry Lambert <tlambert2@mindspring.com> >Reply-To: tlambert2@mindspring.com >To: y-carden@uniandes.edu.co >CC: hackers@FreeBSD.ORG, gvega@uniandes.edu.co >Subject: Re: Invoking a userland function from kernel >Date: Wed, 25 Jul 2001 00:16:33 -0700 > >y-carden@uniandes.edu.co wrote: > > > > I need pass asynchronously data from kernel > > to a userland process, include a quantity variable of > > data (void *opaque). > >The easiest way to do this is to have the user space process >register a kevent, and then KNOTE() in the kernel when the >event takes place. > >Another way to do this is to create a pseduo device driver, >and read the data in user space. > >What it really sounds like you want is callbacks into user >space from the kernel, a la VMS AST's (Asynchornous System >Traps). To implement true AST's, you need to know that the >kernel runs in supervisor mode, and the user space runs in >user mode, and that these correspond to "rong 0" and "ring 3" >protection domains for protected mode Intel processors, >respectively. To implement AST's correctly, you would need >to run them in "system mode", which in the Intel processor >vernacular, would be "ring 2". Just reading the system programming manual from Intel which says "the processor does not allow a transfer of program control from a procedure running at CPL of 0, 1 or 2 to a procedure running at a CPL of 3, except on a return." Weiguang _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp 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?F227cew8k69RKLpgTFu00004f9f>