-1

let's say I have a file full of ARM processor instructions which are already represented as bytes. What is the best way to execute them directly with qemu-arm?

Thanks!

  • Perhaps asm `.incbin` (if that's the right GAS directive) into an object file you can link into an executable. (With the `_start` entry point on that code.) – Peter Cordes Jul 13 '20 at 17:28
  • arm instructions are only a tiny fraction of the problem its like saying I have a book written using the alphabet, how do I read a book. The instruction set just gets you to the memory space and peripherals so executing instructinos can/will simply crash if you dont match it up with the system it was built/designed for. – old_timer Jul 13 '20 at 20:05

1 Answers1

1

If your data is a bootable image, qemu can be started directly with the image file:

qemu-system-arm -hda data.img

where data.img is the name of your binary file.

Otherwise, as Peter Cordes wrote, the easiest way would be to create an ELF executable (see How to run a bare metal ELF file on QEMU?) and start it via

qemu-system-arm -kernel data.elf

where data.elf is the name of the created ELF executable.

(too long for a comment, so I posted it as an answer)

fcdt
  • 2,371
  • 5
  • 14
  • 26