VOGONS


First post, by Estron

User metadata
Rank Newbie
Rank
Newbie

Hello,

I'm a Assembler programmer writing some small DOS software (just for fun). I would like to know if there's any way to detect if I'm running in DOSBox. Recently I viewed the 0.72 source (I'm able to read and understand most C code) but didn't find anything like this yet.

Best would be if the DOS program could get to know if it runs in DOSBox OS (that's by default running in the Box), in some other OS that's inside DOSBox (using the DOSBox "boot" command) or not in DOSBox at all. The running DOSBox version might be interesting as well.

Thanks,
Estron

Reply 1 of 9, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Type in "ver" for programs run in DosBox.

I think it's also in the video bios if you want to use an HD image.

How To Ask Questions The Smart Way
Make your games work offline

Reply 4 of 9, by Estron

User metadata
Rank Newbie
Rank
Newbie
DosFreak wrote:

Type in "ver" for programs run in DosBox.

What about someone running another COMMAND.COM inside DOSBox? It would return it's version on "ver", not the DOSBox version.

Qbix wrote:

get vesa mode information
it contains some words about dosbox

Indeed this helps, thanks. Using Interrupt 10.4F00, one can get DOSBox strings (even the version) as VBE2 vendor/model string.

wd wrote:

Though scanning the vga rom area for a dosbox string might be best,
as vesa might not be present (cga/vgaonly etc.)

Looking into the C000h segment I didn't find a string I could search. Do you know one?

OTOH I played with the dosbox.conf (setting different "machine=" values) file and the VESA method always worked. So the problem only occurs with DOSBox versions compiled without VESA? Then it wouldn't be too bad, as it seems to me they're non-standard.

Reply 6 of 9, by Estron

User metadata
Rank Newbie
Rank
Newbie

Which data is that? More important: Is it constant for most DOSBox versions? (Yeah, I could grab a few and test it myself, but if someone else already knows it...) And how many byte is this structure?

Reply 7 of 9, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Just look at it, if possible with the debugger (data AND code). It's a list
of int xx (where x is from 0 to 0xff) followed by the return callbacks.
This data is very unlikely to change and should always be accessible.