Bug 196673

Summary: emulators/dosbox: Hangs when exeuting a dos program e.g. "settlers 2"
Product: Ports & Packages Reporter: Nikolaus Klepp <dr.klepp>
Component: Individual Port(s)Assignee: Kubilay Kocak <koobs>
Status: Closed Feedback Timeout    
Severity: Affects Some People CC: dr.klepp, knyght, rmm1.bob, trasz, w.schwarzenfeld
Priority: --- Flags: bugzilla: maintainer-feedback? (knyght)
Version: Latest   
Hardware: amd64   
OS: Any   

Description Nikolaus Klepp 2015-01-13 08:35:09 UTC
emulators/dosbox-0.74_10 for amd64 hangs when exeuting a dos program e.g. "settlers 2", while for i386 it works as expected.

to reproduce:
$ dosbox

Z:\> mount c <path_to_settlers_2>
Z:\> c:
Z:\> s2
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2015-01-13 08:35:09 UTC
Maintainer CC'd
Comment 2 Nikolaus Klepp 2015-01-13 13:58:51 UTC
Sorry, forgot to define "hangs":

Z:\> s2

is expected to swith to VESA graphics mode 1024x768 but it does not switch to graphics mode. Instead the cursor keeps blinking and nothing happens. dosbox itself is responsive and reacts to key presses (e.g. <ctrl>+<F1> brings up the keymapper).(In reply to Nikolaus Klepp from comment #0)
Comment 3 John Marino freebsd_committer freebsd_triage 2015-01-25 18:55:40 UTC
Assign PR to maintainer-committer
Comment 4 Tom Carrick 2015-02-21 15:43:37 UTC
I can confirm this is an issue, I can't get any VESA programs to run on amd64. VGA and older modes all work fine.

I don't have a fix. I'm assuming it's got something to do with the last patch to fix compilation, but I'm not sure what the issue is.
Comment 5 Nikolaus Klepp 2015-06-25 14:03:25 UTC
As the bug is still there I recompiled dosbox with internal debugging turned on. The emulator fills the screen with this lines:

52889: CPU:Illegal Unhandled Interrupt Called 6
52890: CPU:Illegal/Unhandled opcode 63
52891: CPU:Illegal Unhandled Interrupt Called 6
52892: CPU:Illegal/Unhandled opcode 63
Comment 6 Nikolaus Klepp 2015-08-26 17:18:32 UTC
The bug is still there on FreeBSD 10.2 with dosbox 0.74_11 from ports or packages.
Comment 7 Edward Tomasz Napierala freebsd_committer freebsd_triage 2015-09-15 14:29:57 UTC
Looks like setting "core=normal" makes things work.
Comment 8 Tom Carrick 2015-09-15 14:42:43 UTC
(In reply to Edward Tomasz Napierala from comment #7)

Edward, I think you're right. This bug is in the dynamic core. It mostly affects only modern programs.

I don't see this as a very long-term fix since the dynamic core has much better performance, but I guess it's better than being broken for certain things.
Comment 9 Edward Tomasz Napierala freebsd_committer freebsd_triage 2015-09-15 20:43:09 UTC
(In reply to Tom Carrick from comment #8)

No idea how to fix it properly, to be honest.  The code looks like... well, perhaps the original author knows how it works.

I guess the question to ask at this point is: does it work properly for anyone on amd64?  If not, then perhaps we should change the default setting, to make it work, albait slower.
Comment 10 Nikolaus Klepp 2015-09-16 10:15:09 UTC
Thank you, "core=normal" works, but is a bit on the slow side.
Comment 11 Sebastian Schwarz 2017-06-10 11:07:26 UTC
(In reply to Edward Tomasz Napierala from comment #9)

core=auto or core=dynamic don't work for me here on an amd64 either.  core=normal as a default on FreeBSD would make sense.
Comment 12 Walter Schwarzenfeld freebsd_triage 2018-02-05 21:55:19 UTC
Any new here?
Comment 13 Martin Matuska freebsd_committer freebsd_triage 2019-03-19 00:14:12 UTC
Sorry, no time for this port.
Comment 14 Nikolaus Klepp 2020-01-07 07:59:46 UTC
Some news?
Comment 15 Robert McIsaac 2021-05-11 20:01:33 UTC
I start a dosgame this way on FreeBSD 13.0

- CD to game directory
- enter dosbox fullscreen game.exe   .. for example

Fullscreen is blank. If started without fullscreen, the console will show
- MIDI: Open device:none

I also tested the Xubuntu Linux version with same result.

I suspect there are issues with the sound system, keyboard, or other hardware that the game expects.  These can be disabled in dosbox but the primitive game program just hangs.

There are warnings during dosbox compile which seem trivial.

Of course it works on Windows 10
Comment 16 Robert McIsaac 2021-05-13 01:24:59 UTC
The Ports:doxbox compiles with 190 warnings. Most are trivial signed-unsigned mismatch but some may be actual bugs. The C++ templates use 'register' type which is incompatible with C++17.  And there are unaligned pointers to packed structures.

On the other hand, the dosbox-staging on github is relatively advanced with focus on ease-of-use.

My opinion: close this bug and wait for the new, improved dosbox to be proven on Linux.  If it works well, then port it to BSD if you must have it.
Comment 17 Kubilay Kocak freebsd_committer freebsd_triage 2021-05-13 01:55:40 UTC
^Triage: 

Closing. This issue appears to be best reported upstream for analysis and resolution. If someone is able to isolate the issue and provide a patch to address it, please -reopen this issue with additional information.

It may also be worth testing https://www.freshports.org/emulators/dosbox-staging/  or looking for a bugfix from that codebase which addresses this issue, from which a patch can be created.