使用 Intel 上的 OpenSolaris 研究 SPARC 可执行结构

发布于 2024-11-09 08:16:02 字数 271 浏览 0 评论 0原文

我想研究和比较elf、SPARC和PA-RISC的可执行文件结构。

为了进行研究,我想在 Intel 机器 (Core2Duo) 上安装 OpenSolaris。 但我有一个基本的疑问:它到底能起作用吗?

我知道 SPARC 有自己的程序集 - 越来越怀疑它是否有效或是否有效。

我的目标是编写一些程序反汇编它们,并在一些工具的帮助下研究文件结构。

我不知道如何在 HP-UX (PA-RISC) 上执行所有这些操作;不知道有任何免费的 PA-RISC 操作系统。

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 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

黑白记忆 2024-11-16 08:16:02

您将无法在英特尔处理器上运行 Sparc 或 PA-RISC 可执行文件。但是,如果您只想分析这些可执行文件的结构,那么您所需要的只是合适的开发工具。

我没有检查过,但我怀疑 OpenSolaris 附带了能够分析开箱即用的 Solaris/sparc 可执行文件的开发工具。但即使其他工具链也可以做到这一点。例如,GNU binutils(特别是 BFD 库 他们使用)支持许多架构,包括 Sparc 和 PA-RISC。 (如果您使用 GNU binutils,请确保您获得完整版本,可能标记为“用于交叉编译”,例如 DebianUbuntu)

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)

自此以后,行同陌路 2024-11-16 08:16:02

SPARC:

我从未在任何东西上安装过 OpenSolaris。您可以考虑尝试 NetBSD:它运行 SPARC 机器至少与 Solaris 一样好,并且它使用 ELF 格式的可执行文件。源代码也可以免费供学习。

您需要了解 ELF 文件格式。我不记得在我想了解 ELF 的时候有什么特别的文档,看起来 Google 可以提供大量的网站来解释 ELF。我对 ELF 的建议是编写一个程序来读取 ELF 标头,然后以可读的文本格式将它们转储出来,即使许多这样的程序已经存在。

您还需要一个能够理解 ELF 的 SPARC 反汇编程序。我很久以前就写过一个,今天可能还不错。 http://www.stratigery.com/elf_dis.tar.Z

您可以下载 PDF有关 SPARC 的信息,请访问:http://www.sparc.com/specificationsDocuments.html 我推荐 SPARC V8 和 V9 架构手册。

PA-RISC:

这是一个非常奇怪的架构,文档很少。我相信 PA-RISC 是 Apollo Computer 的 (RIP) RISC 架构,然后 HP 在 1990 年或 1991 年收购了 Apollo。堆栈向下增长,堆向上增长,几乎所有其他东西都是相反的。它还有一个段寄存器,但其工作方式与 x86 分段不同。

HP 确实是唯一可以找到有关 PA-RISC 的信息的地方。

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.

说好的呢 2024-11-16 08:16:02

有针对 LinuxLinux 的 PA-RISC 架构的端口。 openpa.net/netbsd_hp-700.html" rel="nofollow">NetBSD 和 OpenBSD。

除非使用功能齐全的模拟器,否则无法在 x86 系统上运行为 Sparc 或 PA-RISC 编译的代码。 Qemu 可以模拟基于 Sparc 的机器,具有足够的精度在其上运行 Linux 操作系统(但它不会很快:Qemu 必须一一解释所有 Sparc 操作码,这会产生很大的开销,因此 2011 年的快速 PC 可能会产生 1996 年 Sparc 工作站的性能。有一个正在进行的项目,用于向 Qemu 添加 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文