Closed Jammmmm closed 4 years ago
Some hardware is not emulated by qemu. You can try adding enable_serial=true to the cmdline.txt parameters and see how far it's getting.
BTW: enable_serial=true will use the tx/rx GPIO 14/15 @ 115200 bps for logging. I'm not sure how you tell qemu to interpret that though. But there is probably a way.
Unfortunately that didn't do anything.
-append "console=ttyAMA0,115200 console=tty highres=off console=ttyS0" -nographic is how I was able to get Raspbian to display everything to stdio so it definitely works. It just doesn't work with bmc64.
It's a shame, but I guess any dev I do will mean writing changes to SD and trying on a physical Pi.
AFAIK raspi3 emulation has no USB support, so default Raspbian has neither working input in a window nor networking. Only serial console. If the emulator has not been finished yet, it is hard to say how the Circle library reacts when it experiences lack of some functionalities. Some hints are there: https://github.com/rsta2/circle/blob/master/doc/qemu.txt
I tried everything there and nothing. I even tried building a minimal circle-stdlib kernel image and it doesn't seem to work either. Everything works fine on a normal Pi though.
Oh well. Thanks for the tips!
EDIT: Whoops. I was using the wrong command line. I got the circle-stdlib kernel booting in qemu. I'll see if I can get bmc64 booting too.
I think this issue should be closed.
qemu's Pi emulation is really really flaky and getting Circle and BMC64 to play nice with it is a nightmare for subpar results.
My hope was to be able to debug to screen, or even stdio/stderr/etc. on my dev machine but realistically that's not going to happen anytime soon. Hopefully qemu improves but for now I've found that if anyone's serious about developing for BMC64, you need a USB to Serial cable.
In case anyone is interested, I managed to start bmc64 in QEMU 5.2.0 (v5.2.0-11850-g0f27b14b91-dirty) from Stefan Weil's Windows builds: https://qemu.weilnetz.de/w64/2021/
The modifications needed can be found in my fork: https://github.com/randyrossi/bmc64/compare/master...pppq:qemu
To summarize: VideoCore emulation for sound, OpenGL ES and dispmanx support is missing, so I have disabled these features and wrote a very rudimentary FrameBufferLayer
implementation that uses the emulated frame buffer, with "nearest neighbor" interpolation, a hard-coded screen resolution and a timer-based FPS limiter.
Some of the layers are stacked incorrectly, but the VIC-II screen is visible, and the menu also works by and large.
I also had to enable the serial port and set the SD card's first partition for use by default, as command line parsing also seems to have problems (although this should be supported, in theory).
I used the following CLI options:
$ qemu-system-arm -M raspi2b -kernel kernel7.img -serial stdio -device usb-kbd -sd sdcard.qcow2
It should be possible to compile the C64 build using make_all.sh pi2
; I have only tried this one, not the other emulated machine types.
I've been trying for hours to get bmc64 running in qemu with no success. I can get a Raspberry Pi3 with Raspbian running just fine though.
I've tried every combination of this command:
Where:
It just sits at a blank screen. I've tried qemu-system-arm, -M raspi2, different versions of the kernel, with and without the "append" parameters (and every combination within it too), with and without the dtb, etc. Nothing.
I've even tried redirecting all output to qemu's stdio with "console=ttyAMA0,115200 console=tty highres=off console=ttyS0" in the append parameters and adding -nographic. This works for Raspbian but again, nothing for bmc64.
Help!