X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Rod Pemberton" Newsgroups: comp.os.msdos.djgpp Subject: detecting DOSBox? Date: Sun, 11 May 2014 14:01:23 -0400 Organization: Aioe.org NNTP Server Lines: 16 Message-ID: NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse AT aioe DOT org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Bytes: 1414 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I'd like my program to exit gracefully instead of crashing under emulated environments, such as DOSBox, dosemu, Windows 98/SE console, etc. I'm having an especially difficult time detecting DOSBox. What are the known techniques for doing this? So far, I've looked at the results of 'mov cr0', 'smsw', and a variety of Int 0x2f calls, such as 0x1600, 0x160A, 0x4680, 0x4010. Of course, I don't have all possible environments where the code could be executed, e.g., I can't test OS/2, Win 3.11, Win NT, Win 95, etc. So, compiled information on the expected results of those calls or any other suggested calls or techniques would be useful. Rod Pemberton