cputointel

Here you can discuss ReactOS related topics.

Moderator: Moderator Team

digiboy
Posts: 32
Joined: Wed Aug 16, 2006 1:47 am

cputointel

Post by digiboy »

Does anyone know what the cputointel rosapp is for?
Looks like a disassembler to me for other CPUs other than intel.
How is something like that relevant to ROS?

Thanks.
ThePhysicist
Developer
Posts: 509
Joined: Mon Apr 25, 2005 12:46 pm

Post by ThePhysicist »

It is a binary opcode converter betwen different cpus. It may help to get Intel Apps work on PPC or any other arch in the future.
digiboy
Posts: 32
Joined: Wed Aug 16, 2006 1:47 am

Post by digiboy »

Wow!
That seems a little far fetched.
Why not just bump up to Java and avoid any headaches.
Different CPUs work entirely different.
Instruction sets (386,SSE,MMX,etc), big/little endian, etc.

Are you sure/sane?
Z98
Release Engineer
Posts: 3379
Joined: Tue May 02, 2006 8:16 pm
Contact:

Post by Z98 »

Using another language solves nothing. After all, higher order languages are compiled down to machine code. The Java Runtime Environment is nothing more than a program, I believe written in C++, that's been compiled to machine code. All the JRE does is take care of some of the heavy lifting. Which is why Java isn't used for operating systems, except for experimental ones. Even with the GCC's Java machine code compiler, they would still have to recompile a program if they wanted to run it on a different platform.
digiboy
Posts: 32
Joined: Wed Aug 16, 2006 1:47 am

Post by digiboy »

Z98 wrote:Using another language solves nothing. After all, higher order languages are compiled down to machine code. The Java Runtime Environment is nothing more than a program, I believe written in C++, that's been compiled to machine code. All the JRE does is take care of some of the heavy lifting. Which is why Java isn't used for operating systems, except for experimental ones. Even with the GCC's Java machine code compiler, they would still have to recompile a program if they wanted to run it on a different platform.
The whole "idea" behind Java is cross-platform support (and security). The JRE is compiled for each supported platform, but the generated *.class files should run on _any_ system and are not platform specific. GCC only generates native apps if desired (using --main=<class> option instead of -C), but using the -C should run on any other system.

The point I was trying to make is that trying to get Intel apps to run on other CPUs would be a large project (this could be a monolithic project on its own). It's like trying to make x386 apps multi-platform compatible. Java has already done this, although the Java API is still only good for cheap games, etc. C++ is still much more powerful.

I'm still not sure if this is the intent of cputointel. Could any developer please comment?

Thanks.
Z98
Release Engineer
Posts: 3379
Joined: Tue May 02, 2006 8:16 pm
Contact:

Post by Z98 »

If you don't have the source code, all you have to work with is the binary. And if there isn't a version compiled for your platform, you have a few choices. The first is to run some kind of emulation. That almost always results in some kind of performance/resource usage hit. The other is to try to translate the binary machine code to their counterparts of your platform. That can be incredibly tricky to do, but theoretically should remove any performance problems depending on how optimized it is. If I'm reading ThePhysicist's description correctly, cputointel does the latter.
GreatLord
Developer
Posts: 926
Joined: Tue Nov 30, 2004 10:26 am
Location: Sweden

Post by GreatLord »

CpuToIntel is a exprement to convert a exe file for PPC, ARM, M68k to I386. it is does not work yet, and it is allot todo. I start doing PPC to intel
later if it works I will add intel to PPC. It is a exprement see if it good idea or not.
Karl
Posts: 19
Joined: Sun Jan 07, 2007 7:04 am

Post by Karl »

CpuToIntel is a exprement to convert a exe file for PPC, ARM, M68k to I386. it is does not work yet, and it is allot todo. I start doing PPC to intel
later if it works I will add intel to PPC. It is a exprement see if it good idea or not.
That is a bit bizarre. What windows apps are there for PPC?
Dr. Fred
Developer
Posts: 607
Joined: Wed Dec 22, 2004 10:09 pm
Location: Amsterdam

Post by Dr. Fred »

Karl wrote:
CpuToIntel is a exprement to convert a exe file for PPC, ARM, M68k to I386. it is does not work yet, and it is allot todo. I start doing PPC to intel
later if it works I will add intel to PPC. It is a exprement see if it good idea or not.
That is a bit bizarre. What windows apps are there for PPC?
There used to be a PPC version of windows.
Where do you want ReactOS to go today ?
Karl
Posts: 19
Joined: Sun Jan 07, 2007 7:04 am

Post by Karl »

There used to be a PPC version of windows.
Yes, but what great apps got released for it?
frik85
Developer
Posts: 829
Joined: Fri Nov 26, 2004 7:48 pm
Location: Austria, Europe
Contact:

Post by frik85 »

Art is working on a ppc port of ReactOS. Magnus tool may help to "translate" binary x86/x64 apps and drivers to ppc platform binaries.

This way it will be possible to use your favorite browser-client plugin (e.g. acrobat, flash, etc.) on ppc or imagine running a closed source app like MS Office on a power4-6 cpu.

Apple's Rosetta (http://www.apple.com/rosetta/) is based on Qemu, afaik. Qemu ("User mode emulation" feature) might be useful for ReactOS ppc-ed. too, although it slows down the apps running through it about 15-25%. Binary files translated to ppc platform would run full-speed, that's the big advantage.
ThePhysicist
Developer
Posts: 509
Joined: Mon Apr 25, 2005 12:46 pm

Post by ThePhysicist »

frik85 wrote:Binary files translated to ppc platform would run full-speed, that's the big advantage.
In fact they would not run at the same speed as the original. There isn't always a corresponding instruction or register on the target cpu, so you need to translate it into mem acess / more than one instruction, wich would make it much slower than if it was originally compiled for the target cpu.
It's a question of optimization tricks.
If GreatLord achieves to translate most instructions into only one instructon on the target cpu or even translate a series of instruction into fewer instructions on the target cpu it would be pretty fast.
Let's see...
GreatLord
Developer
Posts: 926
Joined: Tue Nov 30, 2004 10:26 am
Location: Sweden

Post by GreatLord »

It is true u will always loss speed between translations of diffent cpu
as ThePhysicist say, but it is extream small loss or almost zero loss in speed when u translate a program dymatic, my tool basically disambler a program then produce an asm file for the target cpu. the target cpu can be for example

ppc to intel (works partly in my local copy)
ppc to ppc (works partly in svn)

But the big questions at end is this:
1. Shall I write an assmbler for my tools for all cpu it support?
If I do, it will desgin only work with my tools and dialget simluare to nasm

2. Found allot compiler for each cpu and compile the asm file with it

This question will I answer later, for now I using nasm manual to produce a coff file.

ThePhysicist I forgot set u to devloper in the forum I will do it now.
Karl
Posts: 19
Joined: Sun Jan 07, 2007 7:04 am

Post by Karl »

meh, if he wants to work on it, let him. It's not like it affects 90% of us.
GreatLord
Developer
Posts: 926
Joined: Tue Nov 30, 2004 10:26 am
Location: Sweden

Post by GreatLord »

here is the frist public version can convert a ppc apps
but it only support two opcode

here is the output juge u self.

/* the c code */
int main() { return 0; }


/* orignal version been disambler */
; OS type : IMAGE_SUBSYSTEM_WINDOWS_GUI
; CPU found POWERPC
Line_0x00000000:
li %r3,0
Line_0x00000004:
blr

/* Convert version */
; OS type : IMAGE_SUBSYSTEM_WINDOWS_GUI
GLOBAL _main
SECTION .text
; CPU found POWERPC

; Setup frame pointer
_main:
push ebp
mov ebp,esp
sub esp, 248 ; Alloc 248 bytes for reg

mov dword [ebp - 224], 0
mov eax,[ebp - 224]
mov esp, ebp
pop ebp
ret
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 47 guests