All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Juan Antonio Moya Vicén" <juan@securiforest.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] Help initializing a hw module
Date: Thu, 03 Feb 2011 14:58:26 +0100	[thread overview]
Message-ID: <4D4AB482.5010701@securiforest.com> (raw)

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 <mailto: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./

             reply	other threads:[~2011-02-03 13:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-03 13:58 Juan Antonio Moya Vicén [this message]
2011-02-03 14:22 ` [Qemu-devel] Help initializing a hw module Juan Antonio Moya Vicén

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D4AB482.5010701@securiforest.com \
    --to=juan@securiforest.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.