cputointel
Moderator: Moderator Team
cputointel
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.
Looks like a disassembler to me for other CPUs other than intel.
How is something like that relevant to ROS?
Thanks.
-
- Developer
- Posts: 509
- Joined: Mon Apr 25, 2005 12:46 pm
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.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 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.
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.
There used to be a PPC version of windows.Karl wrote:That is a bit bizarre. What windows apps are there for PPC?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.
Where do you want ReactOS to go today ?
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.
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.
-
- Developer
- Posts: 509
- Joined: Mon Apr 25, 2005 12:46 pm
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.frik85 wrote:Binary files translated to ppc platform would run full-speed, that's the big advantage.
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...
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.
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.
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
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
Who is online
Users browsing this forum: Majestic-12 [Bot] and 75 guests