News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Emulator benchmarks???

Started by daydreamer, May 01, 2021, 05:55:00 PM

Previous topic - Next topic

daydreamer

Anyone timed emulators?
So 3.5 ghz cpu is capable of emulate x MHz computer?
If I put setting to max, 1 emulated clock cycle takes y clock cycles to do on real cpu?
Ofcourse it's more complicated because emulating multiple hardware,cpu,graphics card,sound card
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

BogdanOntanu

Quote from: daydreamer on May 01, 2021, 05:55:00 PM
Anyone timed emulators?
So 3.5 ghz cpu is capable of emulate x MHz computer?
If I put setting to max, 1 emulated clock cycle takes y clock cycles to do on real cpu?
Ofcourse it's more complicated because emulating multiple hardware,cpu,graphics card,sound card

I wrote a few ;)

It depends on a few key issues.

1) What exactly do you want to emulate?
================================
1a) Emulate a few ASM instructions and loops procedures? (many AV will do this in order to decrypt or de-obfuscate malware code)
1b) Emulate a full application but not the full hardware or full OS (again AV usage for rogue applications)
1c) emulate the full hardware / CPU and be able to run fully Windows 10 or Linux on it? (like VirtualBox, VMWare, QEMU)

2) How you plan to implement it?
=============================

2a) A simple C code with "IF opcode == XOR and arg1 == EAX THEN fn_xor(ctx.regs.eax, arg2)"

This will be slow in 50-150Mhz range and a LOT of work for all instructions but normally "easy" to make and will emulate Intel on ARM or MIPS for example. (Bochs style)

2b) Optimize by re-compile of the original ASM code to other similar code BUT avoid emulate as above the privileged instructions.

Much faster, 500-1800Mhz since most code will be run natively but requires re-compilation and code analyze for multiple CPUs
(early QEMU style)

2c) Use new VMX virtualization extensions and ring-0 mode for each CPU and allow code to run "almost natively" and call your callbacks / return to ring_0 virtualizer when privileged code has to be executed.

This is super fast, depends on hardware support, speed as big as 4Ghz or normal CPU run or even faster sometimes.
(the new Virtual Box, WMVare or QEMU style)

All can have bugs (but mostly options 2b and 2c) and expose the host system to an attacker :D

Ambition is a lame excuse for the ones not brave enough to be lazy, www.oby.ro

daydreamer

But 2a with jumptable

Some emulators seem to be about emulate right timings on old hardware for old retrogames to work correctly, but might break that if it instead should emulate a P4 instead of 486?

But if i run on low setting on dos emulator, it's more of a challenge  than run on new 4.5 ghz native cpu
One thing I noticed is when running emulator is best use of special energy setting which runs like turbo is turned off,more kinda fixed cpu frequency
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

daydreamer

I was thinking,maybe try to use old unused computer for DOS?or linux with ability to use ports
with 2ghz and right OS,it would be possible to do the old printer port controlling things,but with 2ghz it would have the grunt for image recognize software,from webcam?
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding