Amiga.org
Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: fishy_fiz on March 03, 2011, 04:29:09 AM
-
The topic covers it I guess. Just wondering the best way to detect whether or not something is running on an emulator rather than real hardware ? (in code I mean, obviously eyes would suffice otherwise :))
-
Erm... that's kinda simple it will have the names Apple, Microsoft, Dell etc... somewhere on the machine... :)
-
Heh, even putting the aditional comment in brackets didnt stop the almost inevitable responses like this :)
-
There are certain (never used) special cases of 68k opcodes which are not working right in UAE.
-
Heh, even putting the aditional comment in brackets didnt stop the almost inevitable responses like this :)
Well it is a pretty daft question to be honest, a blind man & his dog would know if it was an emulator being used... :)
Of course you could try plugging in an accelerator card in the expansion port... what's that, no expansion port to plug me Amiga accelerator card into... must be a machine running an emulator then... :D
-
The topic covers it I guess. Just wondering the best way to detect whether or not something is running on an emulator rather than real hardware ? (in code I mean, obviously eyes would suffice otherwise :))
You can`t, unless you remember have you started UAE or not :-)
Even FPGAs are also kind of emulated hardware, just in different way.
Well, why would you care? Performance would be higher if its 68k JIT emulated programe under OS4 or MOS, but then again now with JIT enabled UAE this might change to be not that significant difference.
-
How about checking for the presence of uaescsi.device?
--
moto
-
The topic covers it I guess. Just wondering the best way to detect whether or not something is running on an emulator rather than real hardware ? (in code I mean, obviously eyes would suffice otherwise :))
If you are referring to Sysinfo it will always show 7.09 Mhz, where as a true Amiga would show only it's true Mhz or in case of a 060 a '4' and nothing else.
-
The topic covers it I guess. Just wondering the best way to detect whether or not something is running on an emulator rather than real hardware ? (in code I mean, obviously eyes would suffice otherwise :))
There isn't a reliable way to detect you are running in an emulator. You might be able to come up with a fingerprint analysis of incorrect behaviour, but that relies on you updating your code if an emulator manages to fix the behaviour.
It would also require you to do alot of testing on real hardware, as some of your tests might trigger a false positive.
I guess it depends on what you want to do & why.
-
The topic covers it I guess. Just wondering the best way to detect whether or not something is running on an emulator rather than real hardware ? (in code I mean, obviously eyes would suffice otherwise :))
I remember using UAE-control, as an added program in UAE, which allows it to trigger a reset, change floppies (adf files), en/disable audio and joystick emulation. Perhaps figuring out how UAE-Control did that might help, via Enforcer or some kind of snooping tool? If its a physicall static memory address its sending info to (path of a windows/linux/whatever hosted ADF file), you might be able to "patch" that area of memory and see if it gets blocked or something. Or try to eject the disk, and monitor for errors when there's no electronic eject mechanism (Unless a physical Amiga floppy drive exists that did that, but I doubt it considering how annoying it was for Macs)
EDIT: Just tried it, looks like it uses line 1111 :D
(http://i.imgur.com/oHwE5s.jpg) (http://i.imgur.com/oHwE5.jpg)
-
Just wondering the best way to detect whether or not something is running on an emulator rather than real hardware ?
The presence of one of WinUAE's expansions is surely a reliable indication that you are running on the emulator.
if (FindConfigDev (NULL,2011,-1) != NULL)
/* running on emulation */
However, the absence of UAE expansions does not necessarily mean that you are not running on emulation.
If its a physicall static memory address its sending info to
It *jumps* to a physical static memory address. That's the reason why you get unpredictable crashes, because you jump to unallocated memory.
Reading the memory address will give an enforcer hit, either, so it's not a reliable way to check for emulation.
-
There are certain (never used) special cases of 68k opcodes which are not working right in UAE.
Last I checked
move.l a7,-(a7)...works like on 68000 regardless on the CPU selection. So if you appeear to have a 68010+ CPU and the opcode stores the a7 value like on 68000 you can be sure that you're running under UAE.
I was reading the 68k manuals and noticed that 68000 and other CPUs varied on whether the original or predecremented a7 was stored in this case. I wasn't that surprised to learn that UAE always works like 68000 here... ;)
-
Thanks people. Should be enough to do what I was wanting now.
-
Coding an emufuxxor? How quaint.
Why not just ask Toni directly, I'm sure he can give you some info as to what virtual devices / registers to check for.
-
Well it is a pretty daft question to be honest, a blind man & his dog would know if it was an emulator being used... :)
Of course you could try plugging in an accelerator card in the expansion port... what's that, no expansion port to plug me Amiga accelerator card into... must be a machine running an emulator then... :D
I think you completely missed the point
-
Coding an emufuxxor? How quaint.
Why not just ask Toni directly, I'm sure he can give you some info as to what virtual devices / registers to check for.
Im not sure what you mean by emufuxxor, but what Im doing isnt exclusively related related to uae. OS4.x and MOS 68k emulation cores are also relevant (but easier to detect).
-
I think you completely missed the point
Looks like it... it was early in the morning and I hadn't been to bed yet so the old brain cell was a wee bit addled at the time... :)
Still I'm curious to know why fishy_fiz needs to be able to know this, wonder what secret project he's working on... :)
-
Hehe, nothing particuarly secret, I just want to be able to report the hardware that's being run on semi accurately :) ......... or do I ? :queue evil laugh:
-
Hehe, nothing particuarly secret, I just want to be able to report the hardware that's being run on semi accurately :) ......... or do I ? :queue evil laugh:
You could do worse than to read the source code of Piru's WhichAmiga tool.
-
It's not too difficult to report physical hardware, just gets a bit trickier to report a host systems hardware when there's emulation involed.
-
:idea:Wow I've just had a brilliant idea...:idea:
You could simply have a requester at the start of you prog asking the user to input what kind of system or emulator they're using... :)
(PS:you don't have to thank me for that one, it's a freebie... ;))
-
Erm... that's kinda simple it will have the names Apple, Microsoft, Dell etc... somewhere on the machine... :)
What part of "in code I mean, obviously eyes would suffice otherwise " didn't you understood?
-
What part of "in code I mean, obviously eyes would suffice otherwise " didn't you understood?
The part that I didn't bother to read... :)
-
:(PS:you don't have to thank me for that one, it's a freebie... ;))
Well that eases my conscience a little as I had no plans to thank you ;)
-
Well that eases my conscience a little as I had no plans to thank you ;)
Hmph... in that case I'll keep such brilliant ideas to meself in future... :(
-
Just to clarify, that was intended as tongue in cheek. Sometimes the lack of tone and/or infliction on forums can make things seem different than intended.
Really though it wouldnt work, the whole point to the excercise for me is to have the computer tell a person what system theyre running the software on. Time (and me releasing it) will make things a bit clearer.
-
Just to clarify, that was intended as tongue in cheek. Sometimes the lack of tone and/or infliction on forums can make things seem different than intended.
Really though it wouldnt work, the whole point to the excercise for me is to have the computer tell a person what system theyre running the software on. Time (and me releasing it) will make things a bit clearer.
I'd gathered that, as I've kinda got used to your sense of humour now... ;)
Still it's got me very curious as to what you're writing, guess I'll just have to wait and see... :)
-
Sometimes the lack of tone and/or infliction on forums can make things seem different than intended.
Tee-hee. :)
-
I think it is fair to say there is no single test to determine if your code is running under emulation. You can look for tell-tale resources to determine if your code is running under OS4, MorphOS and UAE, but even if you don't find any of those, there's no guarantee you aren't in an emulation of some description. After all, the "perfect" emulator should be totally indistinguishable from the real thing as far as any userland code is concerned.
-
Version of exec.library should give away MOS and OS4, uaertg, uaehf and uaescsi devices are obvious ones to check for uae.
As for Fellow, Piru's earlier suggestion is probably best.
Are there any other emulators? (Amithlon, OSXL?)
-
@Karlos
I know it wasnt intended as such, but that sounds like a challenge to me :)
Although just a small part of what Im actually doing it should be an interesting programming excercise :)