avatartwo / avatar2

Python core of avatar²
Apache License 2.0
518 stars 98 forks source link

avatar2/handbook/0x03_memory.md Qemu Properties dict possible types and values details #127

Open RazerNinjas opened 6 months ago

RazerNinjas commented 6 months ago

Hi there! I was trying to figure out what are the possible values for the QEMU properties when adding a QEMU device memory range or where I could be directed to find how set that up within the QEMU docs. I was just curious since Firmwire on the Shannon loader for the timers uses a different format than the provided example in the handbook, so I wanted to understand that better for what types, and their values etc. and how that works if you a list of properties. I tried checking the documentation as well but didn't get anything on what are the possible values to add in the type and values in the qemu_properties kwarg.

Any help would be appreciated. Thanks!

mariusmue commented 6 months ago

Hi @RazerNinjas,

You are totally right, this is not a well documented feature of avatar2.

Under the hood, avatar2 creates a "configurable machine", which takes a json file and generates a QEMU machine from this on the fly. You can find the implementation here (it does not differ significantly from the PANDA configurable machine implementation FirmWire uses).

Now, the qemu_properties is a way to directly pass arguments to created peripherals in case they take additional one. In the instance of shannon_timer, a specialized timer was created which can be configured via these properties, the according code example is here.

I hope that helps!