I think I have figured out that part of the Emulator application is an Interpreter (if we choose this route) , that the Emulator programmer writes that uses the native target binary as source code (basically) and this Emulators output creates a phony CPU that exists by the means of the storage of it's states. I'm interested to know if I have to translate machine code by hand to assembly or how that works?
It doesn't use it as source code as much as byte code. It doesn't have to compile or even translate it into local machine code -- all the programmer has to know is what bytes mean what instructions.
How about an imaginary processor with three registers and three instructions?
A real processor would be much more complicated of course. x86 and x86_64 for instance have instructions of different sizes, some as few as 1 byte and some more than 12.
Quote:
The part right now I can't grasp is where does the Emulation stop and when can the host use it?
I'm still not sure what you mean.
Quote:
If I Emulate the hardware it is still in the form that the host can not use.
emulation doesn't turn a foreign program into a local program. Usually you emulate more of the system and interact with the system itself.
How to get the data out depends on what's being emulated how. DOSbox for example supports files, you could write the data you wanted to file to make it available in the host OS. It can also pretend to have a fake modem or serial port, letting things outside the emulator connect to programs inside the emulator over TCP.
Quote:
Emulation seems like it is a painfully in-direct. Why not just translate it to begin with?
How to do that isn't always obvious. How do you make 16-bit real-mode base/offset style memory access work in 64-bit protected mode with all the same side-effects? How do you translate instructions your processor has no direct equivalent for -- some architectures have weird ones, like "skip next instruction if bit N is set in register W". You could do it in two instructions but then you'd have to worry about whether the flags register got altered by instruction 2 in ways that change how the program will branch later. How do you keep track of what your instruction pointer is supposed to be when the instructions aren't the same size they used to be? What about instructions like REP STOSB which are entire little self-contained loops?
And once you translate it, then what? The program's still going to expect to be talking to its native operating system and not yours. You'd need to write your own substitues. (Sort of what WINE does. WINE doesn't need to emulate anything, since it's running x86 programs on an x86 machine, but it does need to provide the Windows libraries that Windows programs expect.)
Not saying it's impossible, but it wouldn't be easy, would be difficult to debug, couldn't be ported anywhere, and could end up being as much overhead as just emulating it.
Last edited by Corona688; 06-23-2011 at 03:13 PM..
iam new to unix , i would like to practice unix commands at home, can anyone help me to know if there are any emulators that i can download to practice or any trial versions that can be installed to practice.
Regards
dep (1 Reply)
Hi,
Is there a command I can use to find out how many CPU's and what type are on my server? (I was told to use cat /proc/cpuinfo)
Also, how do I know what kind of bus speeds are on my server?
Thanks in advance:) (3 Replies)
well. the title says it all.
im runing top in batch mode like this
top -b -n1 > somefile
but the cpu usage info is not correct.
if i run top normally, the first second, i see the same wrong info, and then it corrects itself.
i found only one small mention of it on this forum. with this link... (7 Replies)
Hi,
may be this is an AIX noob question:
my current C++ application runs on Linux and is quite memory consuming. Therefore, the application writes a logfile after it has finished containing memory information, CPU information, information on the running other processes besides my application... (5 Replies)
Hi,
I am going to buy a software that is licenced per CORE.
I have a HPUX B1123 64 bit with 8 cpus.
How can i know how many cores are in my machine ?
Thanks (3 Replies)
Dear all,
Is there any generic command working on all Unix listing the CPU of a server?
I found different command line per OS but I am looking for a more generic one.
Thanks for your answer. (5 Replies)
Hello to everyone.
This is my first post. I want to make one perl agent which calculate following things from Linux Server. Actually I want to pull all this information from 2 linux client and wants to display on web interface.
First I want to calculate below details
1) CPU
2) MEMORY
3)... (6 Replies)
To get only the cpu info from the topas command terminal.
CPU User% Kern% Wait% Idle% Physc Entc
ALL 2.3 4.4 0.0 93.3 0.07 7.7
I tried some thing like this but did not work
topas << done
grep "ALL"
q
done
Can someone help me in this. (5 Replies)
Hello all
i did search the web and found allot of answers but im confused
what are the best ways to get this info via Linux default commands
1. current Cpu Usage in Percent
2. current Memory Usage In Bytes
3. current Memory Available In Bytes
Thanks! (2 Replies)