From owner-freebsd-hackers Wed Jul 25 17:35:49 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from hotmail.com (f227.pav2.hotmail.com [64.4.37.227]) by hub.freebsd.org (Postfix) with ESMTP id CE74F37B406 for ; Wed, 25 Jul 2001 17:35:44 -0700 (PDT) (envelope-from weiguang_shi@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 25 Jul 2001 17:35:44 -0700 Received: from 129.128.29.128 by pv2fd.pav2.hotmail.msn.com with HTTP; Thu, 26 Jul 2001 00:35:44 GMT X-Originating-IP: [129.128.29.128] From: "Weiguang SHI" 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 Date: Wed, 25 Jul 2001 18:35:44 -0600 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 26 Jul 2001 00:35:44.0657 (UTC) FILETIME=[E806F010:01C1156A] Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >From: Terry Lambert >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