Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.msdos.programmer > #1379
| From | "Rod Pemberton" <dont_use_email@xnothavet.cqm> |
|---|---|
| Newsgroups | alt.os.development, comp.os.msdos.programmer, alt.lang.asm |
| Subject | Re: detecting emulation or console windows |
| Date | 2014-06-02 00:53 -0400 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <op.xgs86we26zenlw@localhost> (permalink) |
| References | <op.xgqwuvss6zenlw@localhost> <lmdqcl$1oj$1@rumours.uwaterloo.ca> <op.xgq3g0ya6zenlw@localhost> <lmfptf$kuh$1@rumours.uwaterloo.ca> |
Cross-posted to 3 groups.
On Sun, 01 Jun 2014 14:03:27 -0400, Ross Ridge <rridge@csclub.uwaterloo.ca> wrote: > Rod Pemberton <dont_use_email@xnothavet.cqm> wrote: >> IMO, CR0.PE should be emulated as _set_ for dosemu since dosemu provides >> it's own 32-bit PM DPMI host. I.e., dosemu should report as PM, meaning >> v86 instead of RM. However, it doesn't until something uses DPMI. > > No, under bare-metal MS-DOS a DPMI host wouldn't normally switch into > protected mode until it was first used. The processor wouldn't be > running in Virtual 8086 mode (CR0.PE set) unless something else like a > EMS emulator (eg. EMM386) put in that mode. > As noted in my other post, I made a mistake. dosemu *does* set CR0.PE correctly. This is because DPMI services are installed. I.e., the DPMI host uses PM to provide DPMI calls, so CR0.PE should be set when DPMI is present. AISI, this is no different that installing a DPMI host permanently, as allowed by some hosts. Once installed permanently, the CR0.PE should be set. >> The problem isn't the code. It's a standard 32-bit PM DPMI (GCC >> via DJGPP) application with a 16-bit RM startup. The problem is >> that the code basically runs everywhere, including under environments >> where it shouldn't be executed, such as under OSes like Windows >> 98/SE/NT/2K/XP, and emulation such as DOSBox and dosemu. So, I'd >> like to detect and reject these environments. The other option >> is to just let the user try and fail. > > Sorry, but I don't understand what the problem is. I'd prefer my application to exit cleanly, not execute for environments where it crashes, not execute for environments where it's not likely to work correctly, not execute for environments which are restricted in functionality, not execute for environments where the environment is something other than booted directly into DOS in RM, i.e., emulation, VM's, certain incompatible DPMI hosts. > Why exactly shouldn't > this code run under DOSBox or any other emulator that is designed > to emulate an entire PC, including real-mode and all hardware? It's similar to an OS, but running on top of DOS. It's hardware access and machine control issues don't currently work under emulation, and those yet to be implemented are unlikely to work under VM's and/or emulation, and already it won't work with some DPMI hosts. > If it > crashes on DOSBox, but works fine on bare-metal MS-DOS then > something is either wrong with DOSBox or your application. If it works fine on bare metal, can you seriously argue it's something wrong with my application? ... Yes, emulators do catch some errors that aren't caught on bare metal. But, generally, if the emulator or VM won't run it, it's a problem with the emulator or VM, not the other way around. > As far your application > is concerned it should startup in 16-bit real-mode and then switch in > 32-bit protected mode via a DPMI host regardless of whether it's running > natively on an Intel CPU, software emulation using DOSBox or hardware > emulation running under Virtual PC, VirutalBox or some other VM. True, but DOS doesn't impose any restrictions upon the executing program in terms of hardware access, or processor modes, or memory access, etc. Windows, Linux, and emulators do. They prohibit and restrict things, or fail to implement things. > Which brings up the fact that you haven't mentioned need to block > your code running under any of the VMs. I do. I block certain DPMI hosts which, when I tested them, didn't have sufficient functionality. I'm thinking about doing a run-time test for that functionality, now, instead of having to each host individually, which is many, and could, in theory, be many more ... I already know I don't have access to some of the environments which support DPMI, e.g., OS/2, older Windows, but found some info which helps me. > If you need to block it running on > software emulatorl like DOSBox you should also need to block it running > under hardware emulation. If on the other hand your code works fine > under VMs but not DOSBox then this points back to this either being a > problem with your code or DOSBox. ... > I think maybe going about this the wrong way. Perhaps the best way to > resolve your problem isn't to crudely detect incompatible environments, > but to detect whether the hardware or other specific minimal set of > conditions necessary for your program to run correctly are present. > You might also be able to make your application more robust so that it > doesn't crash when the enviroment isn't exactly what you need. Fair enough. The other option is to not worry about it. If it does work under VM or emulation, great. Windows 3.1, 98/SE can and do work under emulation. If it doesn't work, it doesn't work. But, that's "not nice" from the potential user's perspective. If something serious and unexpected happens under VM or emulation, e.g., wiped out data on disk etc, that would tarnish user's opinions. So, if I have a choice, I'd rather block bad situations or potentially bad situations. Rod Pemberton
Back to comp.os.msdos.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-05-31 18:31 -0400
Re: detecting emulation or console windows Ross Ridge <rridge@csclub.uwaterloo.ca> - 2014-05-31 19:59 -0400
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-05-31 20:54 -0400
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-05-31 21:43 -0400
Re: detecting emulation or console windows "James Harris" <james.harris.1@gmail.com> - 2014-06-01 22:48 +0100
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-02 00:46 -0400
Re: detecting emulation or console windows "James Harris" <james.harris.1@gmail.com> - 2014-06-02 06:15 +0100
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-02 03:21 -0400
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-02 03:32 -0400
Re: detecting emulation or console windows "James Harris" <james.harris.1@gmail.com> - 2014-06-02 09:51 +0100
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-02 09:27 -0400
Re: detecting emulation or console windows "James Harris" <james.harris.1@gmail.com> - 2014-06-02 17:05 +0100
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-02 19:25 -0400
Re: detecting emulation or console windows "James Harris" <james.harris.1@gmail.com> - 2014-06-04 07:55 +0100
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-04 03:20 -0400
Re: detecting emulation or console windows Ross Ridge <rridge@csclub.uwaterloo.ca> - 2014-06-01 14:03 -0400
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-02 00:53 -0400
Re: detecting emulation or console windows Ross Ridge <rridge@csclub.uwaterloo.ca> - 2014-06-02 15:55 -0400
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-02 19:27 -0400
Re: detecting emulation or console windows Ross Ridge <rridge@csclub.uwaterloo.ca> - 2014-06-03 17:00 -0400
Re: detecting emulation or console windows Sjouke Burry <burrynulnulfour@ppllaanneett.nnll> - 2014-06-01 06:25 +0200
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-01 02:50 -0400
Re: detecting emulation or console windows "James Harris" <james.harris.1@gmail.com> - 2014-06-01 07:53 +0100
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-01 04:53 -0400
Re: detecting emulation or console windows "James Harris" <james.harris.1@gmail.com> - 2014-06-01 20:57 +0100
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-02 00:48 -0400
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-02 03:20 -0400
Re: detecting emulation or console windows JJ <duh@nah.meh> - 2014-06-02 03:43 +0700
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-02 00:34 -0400
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-03 07:06 -0400
Re: detecting emulation or console windows JJ <duh@nah.meh> - 2014-06-03 20:25 +0700
Re: detecting emulation or console windows "wolfgang kern" <nowhere@never.at> - 2014-06-03 20:52 +0200
Re: detecting emulation or console windows "James Harris" <james.harris.1@gmail.com> - 2014-06-03 22:59 +0100
Re: detecting emulation or console windows CN <qmbmnp3799@pacbell.net> - 2014-06-03 18:39 -0700
Re: detecting emulation or console windows "James Harris" <james.harris.1@gmail.com> - 2014-06-04 07:06 +0100
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-04 03:07 -0400
Re: detecting emulation or console windows "James Harris" <james.harris.1@gmail.com> - 2014-06-04 09:16 +0100
Re: detecting emulation or console windows "James Harris" <james.harris.1@gmail.com> - 2014-06-03 23:00 +0100
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-06-10 17:37 -0400
Re: detecting emulation or console windows Wildman <best_lay@yahoo.com> - 2014-06-11 00:37 +0000
Re: detecting emulation or console windows "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-07-27 12:11 -0400
csiph-web