Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AVR Support to avatar-qemu for use in HALucinator. #8

Closed
wants to merge 1 commit into from

Conversation

diagprov
Copy link
Contributor

Hi. I'm submitting a PR for the AVR supporting code we've been carrying in our fork on top of qemu-6.2, as I'd like this to not disappear or require me to rebase as new qemus arrive.

The code to support it is reasonably straightforward. The only complexity is that QEMU internally exposes and considers the PC register in terms of words, i.e. 2-byte instructions it will execute. Since we, and most of the rest of the world, typically talk about entry points in bytes, we have to do a quick shift in order to convert what is supplied from reading the firmware image.

This only really gets the CPU booted. Other nice features of Avatar aren't included here.

I have corresponding support in avatar2 proper integrated also. However, step at a time.

Happy to leave this open as long as we need to iterate over it to get it merged!

This commit adds AVR Support to avatar-qemu. In theory,
any AVR is supported. In practice we have only tested
this with CPU Models avr5-avr-cpu, avr51-avr-cpu and
avr6-avr-cpu.

AVR has a strange representation in QEMU, using words
and not bytes. Thus the entry point needs to be
divided by two compared to its byte-representation.

Signed-off-by: Antony Vennard <antony@vennard.ch>
@github-actions github-actions bot closed this Apr 21, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 21, 2022
@avatartwo avatartwo unlocked this conversation Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant