As more operating systems adopt stricter security policies, there is
a trend to stamp out programs using memory mapped as writable+executable.
This is a problem for DOSBox's dynamic recompiler, as it currently just
allocates a large chunk of cache and marks it read+write+executable.
For now it works but probably not for much longer - SELinux is starting
to see widespread use, macOS is pushing their hardened runtime, and
other platforms just flat-out don't support it (no mprotect or similar
mechanism) requiring other methods.
This fix approach uses the same strategy for both windows and other
platforms (separate mappings for writing vs. execution). It merges
cache.h from both dynamic cores since they were already 95% identical.
I had to touch a fair bit of code for platforms that I can't actually
test (mips and arm), hopefully didn't break them but can't guarantee
anything.
Ported to dosbox-staging by Patryk Obara <email address hidden>
Changes compared to the original diff:
- Discard changes to VS-specific config.h, as dosbox-staging uses C++11
fixed-size types, so it's unnecessary.
- Resolve conflict in configure.ac
- Move src/cpu/core_dynrec/cache.h to src/cpu/cache.h before applying
diff to preserve blame information
- Convert original diff to Unix line endings to preserve blame
information
Users who test dosbox-staging via various GUI frontends might have a
problem distinguishing if the instance they have configured is really
dosbox-staging or some other version of DOSBox. Different splash screen
is a simple remedy for it.
Two graphical files are included: one in vector format to allow for
further refinements and one converted to necessary size in png format,
that is used as direct source of logo embedded in the source code. Use
GIMP to convert the png logo to a C file.
Notes about new design:
Orange background was replaced by black to make switch to black
background of empty terminal a little less jarring.
The box side is covered with the rainbow-like pattern to resemble logos
of various computer platforms popular in the 80s. AFAIK IBM or
PC-clones never had such colourful logos, but the point is to resemble
a retro-computing platform while being aesthetically pleasing.
Some computing platforms, that used rainbow patterns are Sinclair,
Commodore, Amiga, Dragon 32, and Apple. The pattern used for
dosbox-staging splash is deliberately different from all of these.
This commit adds `wget` as a fall-back if `curl` fails.
Additionally, it lets the user override the curl and wget
arguments by passing `CURL_FLAGS="args"` and
`WGET_FLAGS="args"` to make.
If both curl and wget fail, it suggesting the user manually
fetch the files or try other curl or wget arguments.
The commit-check step run a bash script however its `shell:`
directive was unset, meaning that under Windows the script
would be executed by PowerShell. This commit fixes this by
explicitly setting `shell: bash`.
It's impossible to change the line length in .mdlrc file, it requires
writing a project-specific style ruby file. It seems like MD013 is
buggy, as we have tables with longer line lengths already, and the
warning shows up at column 85 and not 80, as documented in official
markdownlint.
The commit switches from installing gcc or clang under Windows to
simply always installing clang (which also installs gcc as a dependency).
This ensures that cache's produced from a gcc-specific builds will
be compatible with clang builds.