Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Advanced info on CPU Emulators Post 302530605 by Corona688 on Tuesday 14th of June 2011 12:01:46 PM
Old 06-14-2011
Quote:
Originally Posted by theKbStockpiler
Interpreted implies that the Emulator would just be substituting code for other code from a look-up table but then the program would actually be more or less ported at this point would it not?
It's hard to call something 'ported' when it can't run outside the emulator, no.

The exact approach may depend on the emulator in question. qemu, for instance, can use CPU virtualization features if you're emulating the same architecture you're on -- setting up a virtual environment in hardware. This lets programs run in the virtual environment mostly natively, just trapping a few higher-ring instructions and the like so software can take over and fill in the gaps. This was actually possible without hardware virtualization support, but it makes it much easier and more efficient -- I'm not too well read on the details but suspect it involves more direct/explicit ways for the client to talk to the host, for starters.

For emulators that run instructions that are completely alien to the native processor, the obvious way would be to make a data structure in memory that represents the registers of the native CPU, and use something like a big switch statement or look-up table to branch to the appropriate code for each instruction. If the emulated CPU has fewer registers than the native one I suppose you could stick everything in registers, use jump tables, self-modifying code, raw ASM and other dirty tricks to make it much faster but in the end it's the same idea.
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

any emulators

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)
Discussion started by: dep
1 Replies

2. UNIX for Dummies Questions & Answers

bus speed and CPU info

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)
Discussion started by: ihot
3 Replies

3. HP-UX

cpu info

is there a single command or location from which one can get information like cpu Mhz,cpu cache...etc in HP UX:) (1 Reply)
Discussion started by: vijayca
1 Replies

4. Gentoo

top in batch mode, cpu info is wrong

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)
Discussion started by: broli
7 Replies

5. AIX

How to access process and cpu info on AIX?

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)
Discussion started by: DarthVader77
5 Replies

6. HP-UX

CPU Info

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)
Discussion started by: yoavbe
3 Replies

7. Shell Programming and Scripting

Generic command for CPU info

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)
Discussion started by: sgoiffon
5 Replies

8. Shell Programming and Scripting

Perl agent which calculates CPU info and more

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)
Discussion started by: sania.mirza
6 Replies

9. AIX

To get only the cpu info from the topas command terminal

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)
Discussion started by: rpm120
5 Replies

10. UNIX for Dummies Questions & Answers

Best ways to get clear info about CPU and Memory

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)
Discussion started by: umen
2 Replies
Imager::regmach(3pm)					User Contributed Perl Documentation				      Imager::regmach(3pm)

NAME
Imager::regmach - documents the register virtual machine used by Imager::transform2(). SYNOPSIS
The register machine is a complete rewrite of the stack machine originally used by Imager::transform(), written for use by Imager::transform2(). DESCRIPTION
(This document might be a little incoherent.) The register machine is a fast implementation of a small instruction set designed for evaluating an arithmetic expression to produce a color for an image. The machine takes as input: instructions An array of instructions numeric registers An array of numeric registers. Some registers are initialized as literals. color registers An array of color registers. Currently these registers aren't initialized. input images An array of Imager i_img pointers. The "getpn" operators read pixels from these images. The instructions supplied each take up to 4 input numeric or color registers with a single output numeric or color register. The machine attempts to execute instructions as safely as possible, assuming that correct instructions have been provided, eg. the machine protects against divide by zero, but doesn't check register numbers for validity. The final instruction must be a "ret" instruction, which returns the result ;) Adding new instructions To add a new instruction: 1. Add a new opcode to the enumeration in regmach.h - make sure to add comment after the enum name giving the input registers ("rX" for numeric, "pX" for color) that the instruction takes. These must be in the order that the instruction expects to take the. Put a letter (r or p) after -> to indicate the result type. 2. Add a case to regmach.c that executes the instruction. 3. make The Makefile should rebuild the Regops.pm file, and your new instruction will be added as a function. If you want to add a single alternative instruction that might take different argument types (it must take the same number of parameters), create another instruction with that name followed by a p. The current expression parsers explicitly look for such instruction names. Future directions Conditional and non-conditional jumps to implement iteration. This will break the current optimizer in Imager::Expr (and the compilers for both expression compilers, for that matter.) Complex arithmetic (Addi suggested this one). This would most likely be a separate machine. Otherwise we'll have a very significant performance loss. WARNINGS
If you feed bad 'machine code' to the register machine, you have a good chance of a "SIGSEGV". perl v5.14.2 2011-06-06 Imager::regmach(3pm)
All times are GMT -4. The time now is 10:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy