Detecting DOSBox from within the Box
6 points by calvin
6 points by calvin
This is a fun article! I already knew DOSBox had special-cased some stuff (the simulated OS doesn't take up conventional memory), but I never would have guessed that they invented their own x86 instructions!
There's another DOS emulator for linux, aptly named DOSEMU, which has... a surprising amount of callback APIs.
I remember DOSEMU! If I recall correctly, it's more of a compatibility layer than an emulator. Think Wine, but for running DOS programs: x86 machine code runs directly on the processor, with compatibility shims whenever Linux needed to pretend to be DOS.
It was very convenient for gaming without booting into DOS, especially on my hardware at the time. I could get 386-ish speeds from gaming in DOSBox… or I could get Pentium II speeds by running on bare metal—quite the difference.
I remember DOSEMU! If I recall correctly, it's more of a compatibility layer than an emulator. Think Wine, but for running DOS programs: x86 machine code runs directly on the processor, with compatibility shims whenever Linux needed to pretend to be DOS.
Yeah, basically. dosemu used the same hardware Windows 95 (and similar) used to run DOS programs - it puts the processor into virtual 16 bit mode, hardware virtualization available since like the 386, which then forwards certain operations to the host OS to implement. This hardware support was dropped in 64 bit mode, so it'd only work if you were running a 32 bit OS. I hear dosemu will run an emulator nowadays but tbh I haven't used it since I switched to the 64 bit os...