From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J91gr-0000O1-H5 for qemu-devel@nongnu.org; Sun, 30 Dec 2007 12:11:09 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J91gp-0000Np-Og for qemu-devel@nongnu.org; Sun, 30 Dec 2007 12:11:08 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J91gp-0000Nm-Ls for qemu-devel@nongnu.org; Sun, 30 Dec 2007 12:11:07 -0500 Received: from bsdimp.com ([199.45.160.85] helo=harmony.bsdimp.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J91gp-0003DM-Bl for qemu-devel@nongnu.org; Sun, 30 Dec 2007 12:11:07 -0500 Date: Sun, 30 Dec 2007 10:10:27 -0700 (MST) Message-Id: <20071230.101027.1474623298.imp@bsdimp.com> Subject: Re: [Qemu-devel] qemu networking help From: "M. Warner Losh" In-Reply-To: References: Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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, ryanwsmith@gmail.com In message: Ryan W Smith writes: : I'm currently working on a project where we're using qemu to trace : information flow through the operating system. One of the things : that we'd like to do is trace network data as it flows through the : operating system. I've been reading through the code, and I've : gotten a bit lost. I gather that slirp is where data comes and goes : from the host operating system, but I'm looking for the section of : code that sends and receives data from the guest operating system. I : read through the network device code (ne2000.c), and my guess is that : the inb and outb functions are used to transfer data to the guest, : but I'm not quite certain how that is done. Is there anything that : anyone can point me to that would explain the process of getting data : from the networking device to the guest operating system? Also, is : there anything that explains the ne2k networking device a little : more, and could explain what all the registers are and how to use : them? Thanks in advance for any help you may offer. Well, the ne2000 has a shared memory area that the packets live in, and a i/o port area that signals the host O/S what's going on. I'd suggest reading the FreeBSD if_ed driver for some more information about the card. From it you'll see that the NE2000 has a DS8390 packet engine that does a DMA directly into the shared memory. The ds8390 datasheet can be foudn on the network. You may also find good comments in the Linux ne.c driver: http://www.gelato.unsw.edu.au/lxr/source/drivers/net/ne.c Warner