Received: from eggs.gnu.org ([140.186.70.92]:58507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8XMN-0000wK-2R for qemu-devel@nongnu.org; Tue, 27 Sep 2011 09:06:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R8XMH-00023h-4t for qemu-devel@nongnu.org; Tue, 27 Sep 2011 09:06:07 -0400 Received: from gw.ac.upc.es ([147.83.30.3]:59656 helo=gw.ac.upc.edu) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R8XMG-00023d-UR for qemu-devel@nongnu.org; Tue, 27 Sep 2011 09:06:01 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <87litcs1ly.fsf@ginnungagap.bsc.es> Date: Tue, 27 Sep 2011 15:05:59 +0200 In-Reply-To: (Zhi Yong Wu's message of "Tue, 27 Sep 2011 14:34:31 +0800") Message-ID: <874nzy879k.fsf@ginnungagap.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] Help writing a trivial device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Zhi Yong Wu Cc: qemu-devel@nongnu.org Zhi Yong Wu writes: > 2011/9/26 Llu=C3=ADs Vilanova : >> The testing system is a Linux 2.6.32, with this: >>=20 >> int fd =3D open("/sys/devices/pci0000:00/000000:00:004.00/resource0", O_= RDWR); >> void *addr =3D mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED, fd, = 0); >> printf("-> %ld\n", *(uint64_t*)addr); > This is the way about how to test bar? Does bar1 correspond to guest > file /sys/devices/pci0000:00/000000:00:004.00/resource0? In linux, resourceN corresponds to the Nth BAR. Lluis --=20 "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth