SvarDOS / bugz

SvarDOS bug tracker
http://svardos.org/
7 stars 0 forks source link

4dos crashes under QEMU (non-KVM) #120

Open boeckmann opened 2 months ago

boeckmann commented 2 months ago

After JWASM, this is another case of software crashing under non-KVM QEMU which occurs under both FreeDOS and EDR based kernels. The sofware runs fine on physical machines and other emulators like 86box. This to me starts smelling like a possible qemu bug?

EDR crash:

Bildschirmfoto 2024-09-15 um 18 11 23

FreeDOS crash:

Bildschirmfoto 2024-09-15 um 18 10 54
boeckmann commented 2 months ago

see https://github.com/SvarDOS/bugz/issues/94

ecm-pushbx commented 2 months ago

Which qemu version?

boeckmann commented 2 months ago

9.1 currently. But the JWasm problems did also occur with earlier versions...

boeckmann commented 2 months ago

I finally had a chance to test this under Linux. I can now confirm that it runs fine under Qemu if KVM is enabled and that it crashes if KVM is disabled.

boeckmann commented 2 months ago

Failing image: hd0.img.gz. Just boot. Will crash after 4dos start.

mateuszviste commented 2 months ago

Not sure what we could with this... Sounds like either a glitch in QEMU's CPU emulation (have you tried with a different CPU? "-cpu help") or a 4DOS bug.

Maybe it would be better to report this to the QEMU team?

boeckmann commented 2 months ago

I will try a few more QEMU options. There is also JWasmr that has problems under QEMU. Maybe both 4dos and JWasmr have some bugs, but it is a strong indication there is something going on with QEMU, as these programs run fine under other emulators and on real hardware. I could also not debug JWasmr. It behaved good under influence of a debugger when running single-stepped, and otherwise crashed randomly with no indication what was going on...

Will ask at the QEMU bug tracker if I get not further along...

ecm-pushbx commented 2 months ago

Bugs in qemu's non-KVM CPU emulator are not unheard of, eg https://hg.pushbx.org/ecm/ldosboot/file/439448ca4188/boot.asm#l1445

roytam1 commented 2 months ago

old good QEMU-0.15.1 works.

image

boeckmann commented 2 months ago

@roytam1 thanks for testing. Are you sure it is not using KVM?

roytam1 commented 2 months ago

@roytam1 thanks for testing. Are you sure it is not using KVM?

there is no KVM for QEMU-0.15 on Windows host.

mateuszviste commented 2 months ago

Maybe the default machine type (-m) changed between 0.15 and current version?

roytam1 commented 2 months ago

Maybe the default machine type (-m) changed between 0.15 and current version?

you may try -M pc-0.15 to run a QEMU-0.15 machine?

boeckmann commented 2 months ago

pc-0.15 is not supported for my QEMU version (9.1). I tried several machine types supported, mainly i440fx and q35 versions and isapc, but could not get one to work. I also tested the CPU types down to 486-v1. Still no luck :(

roytam1 commented 2 months ago

then it could be a regression in non-KVM(TCG?) emulation.

boeckmann commented 2 months ago

then it could be a regression in non-KVM(TCG?) emulation.

I think most likely this will be the case.