Public bug reported: QEMU version: 4.1.0.
Full command used to launch: qemu-system-arm -machine raspi2 -kernel main (Technically, the first term of the command is actually "~/Applications/QEMU/qemu-4.1.0/build/arm-softmmu/qemu-system-arm", but I shortened it for readability.) Host information: Running debian 9.9 on a 64-bit x86 processor (Intel i5-2520M). Guest information: No operating system. I'm providing my own kernel, which I assembled from a 60-line ARM assembly program using arm-none- eabi-as and then linked with arm-none-eabi-ld, both version 2.28-5+9+b3. Additional details: To view the screen output of the program, I am using vncviewer version 6.19.1115 (r42122). All of the above software packages were installed as debian packages using apt, except for QEMU, which I built from source after downloading from the official website. . The issue here is that I have written a program in assembly and it isn't doing what I expect it to when I emulate it. Here's a summary of the code: 1) Read a number from zero-initialized memory. 2) Add one to the number and write it back. 3) Use the number to determine a screen location to write to. 4) Use the number to determine what color to write. 5) Write 4000 half-words to the screen starting at that offset and using that color. This should result in a stripe across the whole screen that's about 6 pixels tall. The expected behavior is that *one* stripe should appear on the screen in a single color. However, the actual behavior is that up to *four* stripes appear, each in a different color. Furthermore, if I comment out the line that writes the incremented counter back to memory, then only one stripe will appear. I will also note that the Raspberry Pi 2, which is the system I'm emulating, has four cores. What I suspect is going on here is that my code is being loaded onto all four cores of the emulated machine. I couldn't find anything about this anywhere in the documentation, and it strikes me as bug. I have attached the assmebly code that I'm using, as well as a short makefile. Since I can only add one attachment to this report, I've combined the two into a single text file and labeled each. After separating the two into two files, you will need to change the first line of the makefile to point to your installation of qemu-system-arm v4.1.0. After that, type "make run" to run the program. Thanks in advance, Evan Rysdam ** Affects: qemu Importance: Undecided Status: New ** Tags: baremetal raspi2 ** Attachment added: "attach.text" https://bugs.launchpad.net/bugs/1853781/+attachment/5307568/+files/attach.text -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1853781 Title: Baremetal kernel built from assembly runs multiple times Status in QEMU: New Bug description: QEMU version: 4.1.0. Full command used to launch: qemu-system-arm -machine raspi2 -kernel main (Technically, the first term of the command is actually "~/Applications/QEMU/qemu-4.1.0/build/arm-softmmu/qemu-system-arm", but I shortened it for readability.) Host information: Running debian 9.9 on a 64-bit x86 processor (Intel i5-2520M). Guest information: No operating system. I'm providing my own kernel, which I assembled from a 60-line ARM assembly program using arm-none- eabi-as and then linked with arm-none-eabi-ld, both version 2.28-5+9+b3. Additional details: To view the screen output of the program, I am using vncviewer version 6.19.1115 (r42122). All of the above software packages were installed as debian packages using apt, except for QEMU, which I built from source after downloading from the official website. . The issue here is that I have written a program in assembly and it isn't doing what I expect it to when I emulate it. Here's a summary of the code: 1) Read a number from zero-initialized memory. 2) Add one to the number and write it back. 3) Use the number to determine a screen location to write to. 4) Use the number to determine what color to write. 5) Write 4000 half-words to the screen starting at that offset and using that color. This should result in a stripe across the whole screen that's about 6 pixels tall. The expected behavior is that *one* stripe should appear on the screen in a single color. However, the actual behavior is that up to *four* stripes appear, each in a different color. Furthermore, if I comment out the line that writes the incremented counter back to memory, then only one stripe will appear. I will also note that the Raspberry Pi 2, which is the system I'm emulating, has four cores. What I suspect is going on here is that my code is being loaded onto all four cores of the emulated machine. I couldn't find anything about this anywhere in the documentation, and it strikes me as bug. I have attached the assmebly code that I'm using, as well as a short makefile. Since I can only add one attachment to this report, I've combined the two into a single text file and labeled each. After separating the two into two files, you will need to change the first line of the makefile to point to your installation of qemu-system-arm v4.1.0. After that, type "make run" to run the program. Thanks in advance, Evan Rysdam To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1853781/+subscriptions