开发者

To study SPARC executable structure with OpenSolaris on Intel

I want to study and compare executable file structure of elf, SPARC and PA-RISC.

To perform the studies I want to install OpenSolaris on an Intel machine (Core2Duo). But I got a basic doubt will it work at all ?

I know SPARC has its own assembly - grew in suspicion if it will work or is valid thought at all.

I was aiming to write some programs disassemble them and with some help开发者_如何学Python of tools study the file structures.

I don't have any clue how to perform all this for HP-UX (PA-RISC); dont know any free OS for PA-RISC.


You won't be able to run Sparc or PA-RISC executables on an intel processor. However, if all you want to do is to analyse the structure of these executables, all you need is suitable development tools.

I haven't checked, but I suspect OpenSolaris comes with development tools capable of analysing Solaris/sparc executables out of the box. But even other toolchains can do that. For example, GNU binutils (specifically the BFD library they use) support many architectures, including Sparc and PA-RISC. (If you use GNU binutils, make sure you get a full version, perhaps labeled as “for cross-compilation”, e.g. binutils-multiarch on Debian or Ubuntu)


SPARC:

I have never installed OpenSolaris on anything. You might consider trying NetBSD: it runs SPARC machines at least as well as Solaris did, and it uses ELF format executables. The source code is freely available for study, too.

You will need to understand the ELF file format. I don't recall any particular document standing out back in the days when I wanted to understand ELF, and it looks like Google can offer a large number of web sites that will explain ELF. My advice on ELF is to write a program to read the ELF headers, and then dump them out in a readable text format, even though many such programs already exist.

You will also need a SPARC disassembler that understands ELF. I wrote one a long time ago, it will probably work reasonably well today. http://www.stratigery.com/elf_dis.tar.Z

You can download PDFs about SPARC here: http://www.sparc.com/specificationsDocuments.html I recommend the SPARC V8 and V9 architecture manuals.

PA-RISC:

This is a very odd architecture, with very little in the way of documentation. I believe that PA-RISC was Apollo Computer's (R.I.P) RISC architecture, then HP bought Apollo in 1990 or 1991. The stack grows down and the heap grows up, where just about everything else has it the other way around. It also has a segment register, but one that works differently than x86 segmentation.

HP is really the only place to find anything about PA-RISC.


There are ports for PA-RISC architectures of Linux, NetBSD and OpenBSD.

You cannot run code compiled for Sparc or PA-RISC on an x86 system, unless you use a full-fledge emulator. Qemu can emulate a Sparc-based machine, with enough accuracy for running a Linux operating system on it (but it will not be fast: Qemu must interpret all Sparc opcodes one by one, and this has a heavy overhead, so a fast PC from 2011 may perhaps yield the performance of a Sparc workstation from 1996). There is an ongoing project for adding PA-RISC support to Qemu but it does not seem to have reach any non-trivial level of usability yet.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜