From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C6zg0-00031m-CK for qemu-devel@nongnu.org; Mon, 13 Sep 2004 18:52:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C6zfx-00031a-MR for qemu-devel@nongnu.org; Mon, 13 Sep 2004 18:52:00 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C6zfx-00031X-JW for qemu-devel@nongnu.org; Mon, 13 Sep 2004 18:51:57 -0400 Received: from [144.254.224.140] (helo=ams-iport-1.cisco.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C6zZz-00040v-DH for qemu-devel@nongnu.org; Mon, 13 Sep 2004 18:45:48 -0400 Received: from cisco.com (edinburgh.cisco.com [144.254.112.76]) by ams-core-1.cisco.com (8.12.10/8.12.6) with ESMTP id i8DMj72P014691 for ; Tue, 14 Sep 2004 00:45:08 +0200 (MEST) Received: (from dfawcus@localhost) by cisco.com (8.8.8/2.6/Cisco List Logging/8.8.8) id XAA07589 for qemu-devel@nongnu.org; Mon, 13 Sep 2004 23:45:07 +0100 (BST) Date: Mon, 13 Sep 2004 23:45:07 +0100 From: Derek Fawcus Message-ID: <20040913234507.A25117@edinburgh.cisco.com> References: <20040912221747.F23092@edinburgh.cisco.com> <41460E1E.8060104@bellard.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <41460E1E.8060104@bellard.org>; from fabrice@bellard.org on Mon, Sep 13, 2004 at 11:16:14PM +0200 Subject: [Qemu-devel] Host API escape Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Mon, Sep 13, 2004 at 11:16:14PM +0200, Fabrice Bellard wrote: > Derek Fawcus wrote: > > I was adding a fake instruction So will you at all interested in this bit, want to wait for it to cook some more first, or not interested? It's basically a "new" instruction, using opcodes that should normally generate undefined/illegal opcode traps, hence it should still be usable (in some form) if/when doing fast/native x86-on-x86. The point being to provide a a controlled escape to talk with the host - therefore it's called "hostapi"... At the moment I've defined a hidden "address register" which can be loaded with an immediate value 16/32 bit offset from a specified segment register, the address register getting the equivalent linear address and causing the emulation to break ala a trap/debug. >>From there I then treat the address as a pointer to an argument block in memory specifying what the request is; service the request and return. No real target registers are altered, but arbitrary modifications to target memory can be performed. What I suspect I'll want at somepoint is the ability to convert a set of virtual region descriptions into scatter-gather physical descriptions, such that they can be passed to an external process which happens to mmap the target physical memory file. I've got it going well enought that I'm now working on the target and host code which are communicating, and seeing what if anything needs to alter in the hostapi stuff. I said I was working on a more complex form of file access... My plan at the moment is DOS REDIR access (8.3 filenames) which should be usable in all DOS derivatives (inc Win 3.1/WFW 3.11/w95/w98/wMe). Other stuff, say cut through video/mouse/kbd support, LFN support, virtual network (winsocks) can be done later, but maybe not by me :-) Once I started on this I realised that the ultimate progression is effectivly the same as Win4Lin. Hmm... DF