why no dynamic compilation on arm in popular distros?

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

why no dynamic compilation on arm in popular distros?

Postby carangil » 2018-2-28 @ 04:13

The instructions to download the dosbox source, editing a couple header files, and enabling recompiler support for ARM has been known for years. I've done it myself on an arm chromebook, and on a raspberry pi. So why don't the Raspbian or Arch Linux ARM distributions just package it that way? Being able to apt-get or pacman a working fast emulator should be as easy on ARM as it is on x86. Is this something that the dosbox developers need to work on to get the distros to take it?
carangil
Newbie
 
Posts: 74
Joined: 2009-10-22 @ 05:38
Location: Oakland, CA

Re: why no dynamic compilation on arm in popular distros?

Postby Qbix » 2018-2-28 @ 08:19

maybe the configure test to enable it fails ?

Can you post the config.h (and config.log) after running configure (e.g without doing any edits yourself)
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10649
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: why no dynamic compilation on arm in popular distros?

Postby carangil » 2018-2-28 @ 16:49

This is what my arm chromebook (Nvidia Tegra) gives in the log: (Raspberry pi does something ) similar.

Code: Select all
configure:6274: result: no
configure:6476: checking for target cpu type
configure:6514: result: unknown
configure:6536: checking whether x86 dynamic cpu core will be enabled
configure:6548: result: no
configure:6561: checking whether recompiling cpu core will be enabled
configure:6584: result: no
configure:6598: checking whether fpu emulation will be enabled
configure:6601: result: yes
configure:6618: checking whether x86 assembly fpu core will be enabled
configure:6631: result: no
configure:6648: checking whether to enable unaligned memory access
configure:6656: result: no
configure:6661: checking png.h usability



Now, dosbox has core for arm v4 and arm v7, and a raspberry pi is arm v6. However, an arm v6 runs v4 instructions just fine, its not not perfect... like using only 486 instructions when you have a pentium. Even on my armv7 netbook, armv4 instructions also run fine, and it much faster than pure software emulation. Quake is playable on dynamic (like a slow pentium), but on normal it is a complete slideshow, worse than when I tried on my 486. (On these machines I would run the source port natively, but Quake is a good DOS performance test.)

When I look at the configure script, it seems it doesn't even attempt to recognize any arm cpu: (I do find 68k interesting... are people running DOS games on amigas and old macs? :-) )

Code: Select all
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for target cpu type" >&5
$as_echo_n "checking for target cpu type... " >&6; }
case "$host_cpu" in
  x86_64 | amd64)
    $as_echo "#define C_TARGETCPU X86_64" >>confdefs.h

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: x86-64 bit compatible" >&5
$as_echo "x86-64 bit compatible" >&6; }
    c_targetcpu="x86_64"
    c_unalignedmemory=yes
    ;;
  i?86)
    $as_echo "#define C_TARGETCPU X86" >>confdefs.h

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: x86 compatible" >&5
$as_echo "x86 compatible" >&6; }
    c_targetcpu="x86"
    c_unalignedmemory=yes
    ;;
   powerpc*)
    $as_echo "#define C_TARGETCPU POWERPC" >>confdefs.h

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: Power PC" >&5
$as_echo "Power PC" >&6; }
    c_targetcpu="powerpc"
    c_unalignedmemory=yes
    ;;
   m68k*)
    $as_echo "#define C_TARGETCPU M68K" >>confdefs.h

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: Motorola 68000" >&5
$as_echo "Motorola 68000" >&6; }
    c_targetcpu="m68k"
    c_unalignedmemory=yes
    ;;
   *)
    $as_echo "#define C_TARGETCPU UNKNOWN" >>confdefs.h

    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
$as_echo "unknown" >&6; }
    c_unalignedmemory=no
    ;;
esac

carangil
Newbie
 
Posts: 74
Joined: 2009-10-22 @ 05:38
Location: Oakland, CA

Re: why no dynamic compilation on arm in popular distros?

Postby Qbix » 2018-2-28 @ 17:46

Right.

What does the $host_cpu have for contents at your place and which changes do you usually make to get it running on your pi ?
(C_TARGETCPU ARMV4LE and alligned memory or no alligned memory ?)

M86K isn't used, aside for the alligned memory stuff.
PowerPC, Old macs, yes dosbox runs on those :)
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10649
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: why no dynamic compilation on arm in popular distros?

Postby carangil » 2018-3-01 @ 03:18

armv7l is the host_cpu for my chromebook

Not sure on the raspberry pi, as I haven't done that one in a while, but this old forum post has the instructions for raspberry pi:

https://www.raspberrypi.org/forums/viewtopic.php?t=9542

The armv4 recompiler works fine for armv6 such as the pi and armv7 like my chromebook. But, as far as I can tell, even if I had a real armv4 processor, the build will never use the recompiler.

I was using it aligned, but I am trying an unaligned build. I know on some arms it is a bus error to do unaligned access, so it probably shouldn't be default.
carangil
Newbie
 
Posts: 74
Joined: 2009-10-22 @ 05:38
Location: Oakland, CA

Re: why no dynamic compilation on arm in popular distros?

Postby M-HT » 2018-3-01 @ 07:28

Qbix wrote:maybe the configure test to enable it fails ?

Unless something changed since I made the arm backend for dynrec, there's no configure test for arm dynrec, because I didn't create it - I have no idea how and it doesn't bother me, so it's a job for someone else.
M-HT
Newbie
 
Posts: 62
Joined: 2008-9-01 @ 12:55
Location: Bratislava

Re: why no dynamic compilation on arm in popular distros?

Postby Qbix » 2018-3-01 @ 08:12

I can write those tests. That is not a problem, however I will need information on what needs to be enabled and I need config.log of the chromebook and the raspberry pi

(that forum post doesn't exist btw)
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10649
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: why no dynamic compilation on arm in popular distros?

Postby carangil » 2018-3-01 @ 21:29

That's because I screwed up the pasting.

https://www.raspberrypi.org/forums/viewtopic.php?t=95421

I can get the logs for a raspberry pi zero and the chromebook, but I don't have any armv4 devices, which is what the original recompiler from M-HT seems to target. I don't even know what device has that chip, perhaps an old phone?
carangil
Newbie
 
Posts: 74
Joined: 2009-10-22 @ 05:38
Location: Oakland, CA

Re: why no dynamic compilation on arm in popular distros?

Postby M-HT » 2018-3-02 @ 08:01

carangil wrote:That's because I screwed up the pasting.

https://www.raspberrypi.org/forums/viewtopic.php?t=95421

I can get the logs for a raspberry pi zero and the chromebook, but I don't have any armv4 devices, which is what the original recompiler from M-HT seems to target. I don't even know what device has that chip, perhaps an old phone?

The original armv4 recompiler was written for GP2X.
M-HT
Newbie
 
Posts: 62
Joined: 2008-9-01 @ 12:55
Location: Bratislava

Re: why no dynamic compilation on arm in popular distros?

Postby Qbix » 2018-3-02 @ 10:29

Seems that the ARM is different between versions of the PI ?
Ideally I'd need logs for all, but I am happy with any config.log files that I can get:
https://www.raspberrypi.org/forums/view ... 21#p695887

This has the information with what I have to enable for version 2. do you need to do the same for the zero ? (I am totally not familiar with the versions of the PI)
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10649
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: why no dynamic compilation on arm in popular distros?

Postby carangil » 2018-3-03 @ 02:39

Here is the config log from a raspberry pi zero w. The pi zero, and original pi should have the same CPU.

Note, to build on the current version of Raspbian, I needed to add stddef.h to doc_inc.h.

Those instructions for raspberry pi 2 seem about the same as what I did on the chromebook, except I didn't do any special math flags. Perhaps my floating point is not as optimized as it could be. Probably doesn't matter for anything except maybe quake. I doubt quake will be playable on the pi. It is building right now, this damned thing is sooooo slow. (If I really wanted good Quake on pi, I'd use the source port, not dosbox.) But the default build in Raspbian even made old stuff I used to play like on a 286 like Jill of the Jungle really lag.

Just to give an idea how weak the pi is, my k6-2 machine running 600Mhz, with an old build of DOSBOX plays the above mentioned Jill of the Jungle, just fine.
Attachments
raspberry-pi-config.log
raspberry pi zero-w config log
(51.51 KiB) Downloaded 62 times
carangil
Newbie
 
Posts: 74
Joined: 2009-10-22 @ 05:38
Location: Oakland, CA

Re: why no dynamic compilation on arm in popular distros?

Postby carangil » 2018-3-03 @ 02:46

Here is the arm chromebook config.
Attachments
chromebook-config.log
chromebook(tegra k1) config.log
(50.76 KiB) Downloaded 60 times
carangil
Newbie
 
Posts: 74
Joined: 2009-10-22 @ 05:38
Location: Oakland, CA

Re: why no dynamic compilation on arm in popular distros?

Postby Qbix » 2018-3-04 @ 12:42

Ah the pi zero has arm6, do you have a PI 2 log as well ?
I almost have enough info to add the tests
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10649
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: why no dynamic compilation on arm in popular distros?

Postby carangil » 2018-3-09 @ 05:59

I do not have a pi2, but it is armv7.
carangil
Newbie
 
Posts: 74
Joined: 2009-10-22 @ 05:38
Location: Oakland, CA

Re: why no dynamic compilation on arm in popular distros?

Postby Qbix » 2018-3-22 @ 15:06

I have added something to the code for this.
As I don't have any info on the first pi with regards to if it allows unaligned memory access, i have not enabled this.
It is enabled for the armv7l processors (pi2/3 and chromebook)

Thanks for the logs
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10649
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: why no dynamic compilation on arm in popular distros?

Postby haemogoblin » 2018-4-24 @ 21:20

Hey guys

I recently compiled dosbox with dynamic compilation for my Pi3, after i updated the system to Raspbian Stretch. The first thing I've noticed is that Dosbox doesn't work as well as it did under wheezy. Performance is slower, I can't use opengl even though it is enabled and the only way i can get a full screen, where the picture reaches the corners of my screen, is by using overlay.
haemogoblin
Newbie
 
Posts: 10
Joined: 2013-1-29 @ 21:07
Location: United Kingdom

Re: why no dynamic compilation on arm in popular distros?

Postby keenmaster486 » 2018-5-09 @ 06:27

Is there anything new in this realm? What if the DOSBox in the arm6 apt repository was updated to have dynamic recompilation enabled? (hint, hint)
I flermmed the plootash just like you asked.
Very silly indeed: https://audaxeundum.wordpress.com
User avatar
keenmaster486
Oldbie
 
Posts: 1119
Joined: 2016-2-16 @ 02:04
Location: Atroxus


Return to DOSBox Development

Who is online

Users browsing this forum: Google Feedfetcher and 1 guest