From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51875 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pl04N-00059q-Md for qemu-devel@nongnu.org; Thu, 03 Feb 2011 09:22:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pl04M-0002O2-BS for qemu-devel@nongnu.org; Thu, 03 Feb 2011 09:21:59 -0500 Received: from [188.95.114.51] (port=38088 helo=vps146.softec-internet.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pl04M-0002Nj-0S for qemu-devel@nongnu.org; Thu, 03 Feb 2011 09:21:58 -0500 Received: from vps146.softec-internet.com (unknown [127.0.0.1]) by vps146.softec-internet.com (Postfix) with ESMTP id 40D30C8D084 for ; Thu, 3 Feb 2011 14:21:56 +0000 (UTC) Received: from [192.168.2.136] (unknown [84.88.234.5]) by vps146.softec-internet.com (Postfix) with ESMTP for ; Thu, 3 Feb 2011 14:21:56 +0000 (UTC) Message-ID: <4D4ABA26.1080307@securiforest.com> Date: Thu, 03 Feb 2011 15:22:30 +0100 From: =?ISO-8859-1?Q?Juan_Antonio_Moya_Vic=E9n?= MIME-Version: 1.0 Subject: Re: [Qemu-devel] Help initializing a hw module References: <4D4AB482.5010701@securiforest.com> In-Reply-To: <4D4AB482.5010701@securiforest.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org I'm sorry I made a typo. The code in the kernel module that makes the call REALLY IS: iobase =3D ioremap(0xFED40000, 0x5000); if(ioread8(iobase) =3D=3D 0) return -ENODEV; On 03/02/11 14:58, Juan Antonio Moya Vic=E9n wrote: > Hi list, > I'm new to qemu, and developing a new hw module. And I'll appreciate an= y > help or link any of you can provide relating to the following problem > I'm experiencing, that I'm certain it is because of inexperience: > > > I'm getting ENODEV error codes each time I load the kernel module for m= y > specific device. > > ** I have a guest OS Linux. The hw I'm emulating is a stupid device, > whose kernel module tries to find at a certain IO mem position: 0xFED40= 000 > The code in the kernel module that makes the call: > ioremap(0xFED40000, 0x5000); > if(ioread8(0xFED40000) =3D=3D 0) > return -ENODEV; > > ** My device initialization code in qemu: > > static uint32_t my_access_read(void* opaque, target_phys_addr_t addr) { > return (uint32_t) 0xFF; > } > static CPUReadMemoryFunc* const my_access_read_str[3] =3D { > my_access_read, NULL, NULL }; > > void my_register_function(void) { > int addr =3D cpu_register_io_memory(my_access_read_str, NULL, s= ); > cpu_register_physical_memory(0xFED40000, 0x5000, addr); > } > > > ** I do know that Qemu is calling and executing "my_register_function()= " > ** I do know that the guest OS kernel module is executing the two lines > I pasted before. > > But looks like "my_access_read()" function gets never called. Do you > guys have any idea how to fix this mess? > Thanks in advance > > > =20 --=20 *Juan Antonio Moya* Scientific Developer, Securiforest Sant Joan de La Salle 42, 4th floor 08022 Barcelona (Spain) Email: juan@securiforest.com Web: http://www.securiforest.com =20 / /!\ Disclaimer -- The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy th= e information by any means./