Thread: Emulator book?

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    15

    Emulator book?

    Hello!

    I am having some problems with an emulator that I have to write, does anybody knows any good reference book? I am trying to emulate some hardware. Tips?

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Exactly what hardware are you trying to emulate?

    [I don't know specifically about any books on the subject, but I have worked with various type of emulators:
    - Graphics chips
    - Communications chips
    - CPU emulators.
    - PC IO emulation (QEMU as used by Xen)

    If you have specific questions, I'll try to answer.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    15
    Hello again!

    My first question is about memory management. There is a piece of software that it is going to be testeg agains the emulator that I am working, that software has to read and write from / to some specific addresses, so when the software writes to those addresse, how do I read from those addresses? I mean is the software going to actually write to a "physical address"? and does my emulator have to read from those addresses?

    I know I can consider the memory as a an internal array in my emulator, but what about reading from actuall memory addresses?

    I dont know if you understand what I mean. But I am quite thankful for some help!

    Steffi

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    In a generic system, you can't allocate physical addresses (at least, you can't in "usermode"), and even if you could, you can't make your software intercept those addresses.

    The common solution for this is that the emulator offers a way to "connect" with the emulator, and some functions to read/write hardware registers.

    As how that works in your particular case, that will depend on the exact implementation of the test-software. You'll need to talk to whoever is doing the test-software to see if there's a design-specification for the interface. If there isn't, then you and the test-sofware author will have to make your own interface.

    Exactly how this interface should be designed depends on several factors, including which OS you are using, how the emulator is supposed to be combined with the test or application software, etc, etc. For example, are you linking the emulator to the test-software, or are they standalone pieces of software. There are several other considerations, but that would be the primary ones.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed