From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34018 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pkzh5-0007tg-Mf for qemu-devel@nongnu.org; Thu, 03 Feb 2011 08:57:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pkzh4-0006A9-Kd for qemu-devel@nongnu.org; Thu, 03 Feb 2011 08:57:55 -0500 Received: from [188.95.114.51] (port=55074 helo=vps146.softec-internet.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pkzh4-00069t-EY for qemu-devel@nongnu.org; Thu, 03 Feb 2011 08:57:54 -0500 Received: from vps146.softec-internet.com (unknown [127.0.0.1]) by vps146.softec-internet.com (Postfix) with ESMTP id 6B2CFC8D084 for ; Thu, 3 Feb 2011 13:57:51 +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 13:57:51 +0000 (UTC) Message-ID: <4D4AB482.5010701@securiforest.com> Date: Thu, 03 Feb 2011 14:58:26 +0100 From: =?ISO-8859-1?Q?Juan_Antonio_Moya_Vic=E9n?= MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Help initializing a hw module List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi list, I'm new to qemu, and developing a new hw module. And I'll appreciate any 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 my 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: 0xFED40000 The code in the kernel module that makes the call: ioremap(0xFED40000, 0x5000); if(ioread8(0xFED40000) == 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] = { my_access_read, NULL, NULL }; void my_register_function(void) { int addr = 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 -- *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 / /!\ 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 the information by any means./