Giter Site home page Giter Site logo

armulator's Introduction

Description

A pure python ARM emulator

Installation

Install the last released version using pip:

python3 -m pip install --user -U armulator

Or install the latest version from sources:

git clone [email protected]:matan1008/armulator.git
cd pyiosbackup
python3 -m pip install --user -U -e .

Usage

To create a processor object, you need to import it first:

from armulator.armv6.arm_v6 import ArmV6

Then you can just create it:

arm = ArmV6()

Getting familiar with the Memory controller concept is crucial for using the processor.
In short, there is one "hub" to which you can connect several controllers.
A "Memory Controller" can be a stick of RAM, Memory mapped LCD screen or whatever you wish.

For example, let's create a RAM controller:

from armulator.armv6.memory_types import RAM
from armulator.armv6.memory_controller_hub import MemoryController

mem = RAM(0x100)
mc = MemoryController(mem, 0xF0000000, 0xF0000100)
arm.mem.memories.append(mc)

Now, trying to access a memory between 0xF0000000 and 0xF0000100, will access the mem object.
You can also change the memory manually:

mem.write(0, 2, "\xfe\xe7")

Another useful feature is playing with the memory protection or management unit, for example cancelling memory protection will look like:

arm.registers.sctlr.m = 0
arm.take_reset()

Please note that after changing internal features it is recommended to reset the processor.

When running the armulator, you will probably want to start from a defined address, so:

arm.registers.branch_to(0x100)

The last thing we need to do is to really run the processor, which can be done with:

arm.emulate_cycle()

Running the tests

Running the tests can be done easily with pytest:

python3 -m pytest tests -vv

Acknowledgments

  • At first, I did it to learn the ARM architecture better. I guess I was carried away.
  • Feel free to report bugs.
  • Feel free to ask for more features.

armulator's People

Contributors

matan1008 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.