Giter Site home page Giter Site logo

ashwio / arm64-pgtable-tool Goto Github PK

View Code? Open in Web Editor NEW
59.0 59.0 18.0 82 KB

Tool for automatically generating MMU and translation table setup code, whether to drag and drop into your own bare metal arm64 projects or to assist you in your own learning.

License: MIT License

Python 100.00%
arm arm64 armv8 armv8-a memory-management tool

arm64-pgtable-tool's People

Contributors

ashwio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

arm64-pgtable-tool's Issues

AttributeError: 'Region' object has no attribute 'map'

If I process the following map using commit hash fdc0fb0 (current HEAD of master):

0xA4000000, 512K, CODE, PROGRAM_TEXT
0xA4080000, 255M, RW_DATA, Non-Trusted-DRAM
0xB3FE0000, 128K, RW_DATA, NT-DRAM(MMU_TABLE)

using this command:

python3.9 generate.py -vv -i mmu_map_virt.txt -ttb 0xB3FE0000 -el 1 -tg 16K -tsz 32 -o mmu_map.S

I generate the expected map

<cut out for brevity>
[DEBUG] mapping complete chunk at index 2014
[DEBUG] mapping complete chunk at index 2015
[DEBUG] mapping complete chunk at index 83
[DEBUG] mapping complete chunk at index 84
[DEBUG] mapping complete chunk at index 85
[DEBUG] mapping complete chunk at index 86
[DEBUG] mapping complete chunk at index 87
[DEBUG] mapping complete chunk at index 88
[DEBUG]
[DEBUG] mapping region 0xb3fe0000 in level 2 table
[DEBUG] Region(lineno=3, label='NT-DRAM(MMU_TABLE)', addr=0xb3fe0000, length=0x20000, memory_type=MEMORY_TYPE.rw_data
[DEBUG] floating region, dispatching to next-level table
[DEBUG]
[DEBUG] mapping region 0xb3fe0000 in level 3 table
[DEBUG] Region(lineno=3, label='NT-DRAM(MMU_TABLE)', addr=0xb3fe0000, length=0x20000, memory_type=MEMORY_TYPE.rw_data
[DEBUG] mapping complete chunk at index 2040
[DEBUG] mapping complete chunk at index 2041
[DEBUG] mapping complete chunk at index 2042
[DEBUG] mapping complete chunk at index 2043
[DEBUG] mapping complete chunk at index 2044
[DEBUG] mapping complete chunk at index 2045
[DEBUG] mapping complete chunk at index 2046
[DEBUG] mapping complete chunk at index 2047
<runs to completion and generates mmu_map.S>

If I process the following map using a slight offset:

0xA4000000, 512K, CODE, PROGRAM_TEXT
0xA40C0000, 255M, RW_DATA, Non-Trusted-DRAM
0xB3FE0000, 128K, RW_DATA, NT-DRAM(MMU_TABLE)

using the same command:

python3.9 generate.py -vv -i mmu_map_virt.txt -ttb 0xB3FE0000 -el 1 -tg 16K -tsz 32 -o mmu_map.S

I receive the following error:

<cut out for brevity>
[DEBUG] mapping complete chunk at index 2007
[DEBUG] mapping complete chunk at index 2008
[DEBUG] mapping complete chunk at index 2009
[DEBUG] mapping complete chunk at index 2010
[DEBUG] mapping complete chunk at index 2011
[DEBUG] mapping complete chunk at index 2012
[DEBUG] mapping complete chunk at index 2013
[DEBUG] mapping complete chunk at index 2014
[DEBUG] mapping complete chunk at index 2015
[DEBUG] mapping complete chunk at index 2016
[DEBUG] mapping complete chunk at index 2017
[DEBUG] mapping complete chunk at index 2018
[DEBUG] mapping complete chunk at index 2019
[DEBUG] mapping complete chunk at index 2020
[DEBUG] mapping complete chunk at index 2021
[DEBUG] mapping complete chunk at index 2022
[DEBUG] mapping complete chunk at index 2023
[DEBUG] mapping complete chunk at index 2024
[DEBUG] mapping complete chunk at index 2025
[DEBUG] mapping complete chunk at index 2026
[DEBUG] mapping complete chunk at index 2027
[DEBUG] mapping complete chunk at index 2028
[DEBUG] mapping complete chunk at index 2029
[DEBUG] mapping complete chunk at index 2030
[DEBUG] mapping complete chunk at index 2031
[DEBUG] mapping complete chunk at index 83
[DEBUG] mapping complete chunk at index 84
[DEBUG] mapping complete chunk at index 85
[DEBUG] mapping complete chunk at index 86
[DEBUG] mapping complete chunk at index 87
[DEBUG] mapping complete chunk at index 88
[DEBUG] mapping complete chunk at index 89
[DEBUG]
[DEBUG] mapping region 0xb3fe0000 in level 2 table
[DEBUG] Region(lineno=3, label='NT-DRAM(MMU_TABLE)', addr=0xb3fe0000, length=0x20000, memory_type=MEMORY_TYPE.rw_data
[DEBUG] floating region, dispatching to next-level table
Traceback (most recent call last):
  File "/home/goldfish/Downloads/arm64-pgtable-tool/generate.py", line 20, in <module>
    import pgtt
  File "/home/goldfish/Downloads/arm64-pgtable-tool/pgtt/__init__.py", line 27, in <module>
    from . import table
  File "/home/goldfish/Downloads/arm64-pgtable-tool/pgtt/table.py", line 202, in <module>
    [root.map(r) for r in mmap.regions]
  File "/home/goldfish/Downloads/arm64-pgtable-tool/pgtt/table.py", line 202, in <listcomp>
    [root.map(r) for r in mmap.regions]
  File "/home/goldfish/Downloads/arm64-pgtable-tool/pgtt/table.py", line 92, in map
    self.entries[start_idx].map(region)
<Errors here and exits>

Did I overlook a boundary/range condition or is this a bug? The same behavior exists in python3.8.

Thank you

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.