From owner-cvs-src@FreeBSD.ORG Wed Feb 16 17:49:53 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 618) id 3A50C16A4CF; Wed, 16 Feb 2005 17:49:53 +0000 (GMT) In-Reply-To: <200502162127.56278.doconnor@gsoft.com.au> from "Daniel O'Connor" at "Feb 16, 2005 09:27:55 pm" To: doconnor@gsoft.com.au (Daniel O'Connor) Date: Wed, 16 Feb 2005 17:49:53 +0000 (GMT) X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20050216174953.3A50C16A4CF@hub.freebsd.org> From: wpaul@FreeBSD.ORG (Bill Paul) cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: des@des.no Subject: Re: cvs commit: src/sys/compat/ndis hal_var.h kern_ndis.c kern_windrv.c ndis_var.h ntoskrnl_var.h pe_var.h resource_var.h subr_h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Feb 2005 17:49:53 -0000 > On Wed, 16 Feb 2005 21:14, Dag-Erling Sm_rgrav wrote: > > Bill Paul writes: > > > Log: > > > Add support for Windows/x86-64 binaries to Project Evil. > > > [...] > > > The original patches provided macros to wrap every single routine at > > > compile time, providing a secondary jump table with a customized > > > wrapper for each exported routine. I decided to use a different > > > approach: the call wrapper for each function is created from a template > > > at runtime, and the routine to jump to is patched into the wrapper as it > > > is created. [...] > > > > I think this qualifies as "Project Eviler". I can't wait to find out > > what you'll come up with next... > > "Pure Evil" (like in Time Bandits) That's "Pure, _Concentrated_ Evil" to you, mister. Note that the runtime wrapper construction is only for the cases where the Windows binary has to call Project Evil routines. There is only one wrapper template, which can handle up to 16 arguments. This is kind of gross because it always translates 16 arguments, even if the function requires less than that. It was the best compromise I could come up with, especially given that I need to handle some varadic functions too. For the other direction, where Project Evil invokes a function in the Windows binary (MiniportInitialize(), etc...), the wrapping is done at compile time with macros. There are 6 small assembly wrappers that can handle from 1 to 6 arguments (MSCALL1() to MSCALL6()). It happens none of the functions we need to call take more than 6 args. I'm hoping to get IRP support and, as a consequence, USB devices working next. Last on the hit list is WPA support. Note: the document at http://www.freebsd.org/~wpaul/80211.ps is a copy of Microsoft's 802.11 adapter design guide for Windows XP, which describes the API for using WPA with NDIS 5.1 drivers. If some enterprising individual wants to step in and do the WPA support, I wouldn't say no. :) -Bill -- ============================================================================= -Bill Paul (510) 749-2329 | Senior Engineer, Master of Unix-Fu wpaul@windriver.com | Wind River Systems ============================================================================= you're just BEGGING to face the moose =============================================================================