在没有 Sparc 硬件的情况下运行 Sparc 二进制文件

发布于 2024-07-06 17:01:02 字数 129 浏览 9 评论 0原文

在过去的几个月里,我一直很好奇尝试为 SPARC 处理器(V8 或 V9)进行一些组装。 我的问题是,我无法访问 SPARC 机器,有没有办法可以在我的 x86 机器上运行 SPARC 二进制文件? 我看过 QEMU 但不太确定如何设置它。

I've been curious in the past few months in trying my hand at doing some assembly for the SPARC processor (either V8 or V9). My question is this, I have no access to a SPARC machine, is there a way I can run SPARC binaries on my x86 machine? I've looked at QEMU but I am not too sure how to set it up.

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

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

发布评论

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

评论(10

眼泪也成诗 2024-07-13 17:01:02

SimICS 模拟 Sparc 平台。 学术和个人许可证都是免费的。

编辑:我在最初的回复中没有公正地对待 SimICS,它对于基于 Sparc 的开发来说是一个非常有用的工具。 您可以检测、分析和探索用户空间和内核空间中的行为或代码。 我第一次意识到它是在大约 10 年前,当时瑞典计算机科学研究所 (SICS) 发布了它。 他们后来将其作为商业产品推出。

SimICS emulates a Sparc platform. Academic and personal licenses are free.

Edit: I didn't do SimICS justice in my initial response, it is a very useful tool for Sparc-based development. You can instrument, profile, and explore the behavior or code in both user space and kernel space. I first became aware of it about 10 years ago, when it was released by the Swedish Institute of Computer Science (SICS). They later spun it out as a commercial product.

|煩躁 2024-07-13 17:01:02

好的,这里是:

  • qemu 正在模拟用户代码,而不是系统
  • tkisem 正在以图形方式显示 cpu 内部结构
  • 另外,还有一个名为“ISEM”(Instructional Sparc Emulator)的东西,

也许谷歌搜索会帮助您获得详细信息。
我的意见 - qemu 足以满足这一点。

Ok, here it is:

  • qemu is emulating user code, not system
  • tkisem is graphically displaying cpu internals
  • Also, there is a thing called "ISEM" (Instructional Sparc Emulator)

Maybe googling will help you with detailed information.
My opinion - qemu is good enough for that.

茶色山野 2024-07-13 17:01:02

顺便说一句,您可以关闭旧的二手 Sun 工作站 Ebay 大约 3/4 的 buggerall。

As an aside, you can get older secondhand Sun workstations off Ebay for about 3/4 of buggerall.

中性美 2024-07-13 17:01:02

这模拟了 SparcStation 2 (sun4c 32 位 SPARCv7) 和 Ultra-1 (sun4u 64 位 SPARCv9),据我了解,可信度相当高,因为它甚至使用来自帧缓冲区的库存转储 ROM。

http://people.csail.mit.edu/fredette/tme/

至于Sparc的v7 v8和v9的区别 v7和v8是32位 v9是64位。 请注意,QEMU 并不是那么忠实于仿真,它会动态重新编译,因此它可能会快一点(实际上相当慢),但代价是兼容性可能较差。 v7-v8 的 QEMU 可以引导 Linux 和大多数 BSD,以及实验性的 Solaris。 SPARCv9 的 QEMU 处于实验阶段。

我已经在 Linux 上构建了 TME,但是如果您只安装 NetBSD 并在那里构建它,那么它可能会更好,这样您就可以使用它所具有的网络支持,并且较旧的编译器不会对代码有太多抱怨。

我在这里有一个稍微修补过的版本 https://github.com/cb88/tme 我将不胜感激帮助解决大部分补丁来自 NetBSD pkgsrc,但我想我清理了一些其他东西。

This emulates a SparcStation 2 (sun4c 32bit SPARCv7) and also an Ultra-1 (sun4u 64bit SPARCv9) from what I understand the fedelity is pretty high as it uses stock dumped roms even from the framebuffer.

http://people.csail.mit.edu/fredette/tme/

As for the difference between v7 v8 and v9 of Sparc v7 and v8 are 32bit v9 is 64bit. Note that QEMU isn't all that faithful of an emulation and it does dynamically recompile so it might be a bit faster (in practice it is pretty slow) but at the price of possibly less compatibility. QEMU for v7-v8 can boot Linux and most BSD's and experimentally Solaris. QEMU for SPARCv9 is experimental.

I have built TME on Linux but it will probably go better if you just install NetBSD and build it on there that way you can use the networking support it has and the older compilers won't complain some much on the code.

I have a somewhat patched version of it here https://github.com/cb88/tme I would appreciate help working on it most of the patches are from NetBSD pkgsrc but I think I cleaned up a few other things.

べ映画 2024-07-13 17:01:02

除了完整的系统模拟之外,QEMU 还可以在用户空间级别模拟 SPARC,这样您就可以在 SPARC 汇编中编写程序并使用标准 Linux 系统调用,它将调用标准 x86 内核版本...效果很好!!

如果您不确定是否要专门学习 SPARC 汇编,您可以查看 MIPS。 大多数无线路由器都基于 MIPS 处理器,并且可以运行 Linux。 它与 SPARC 类似,具有相似的历史,并且与 SPARC 一起,它是两种原始 RISC 架构之一……在我看来,MIPS 实际上比 MIPS 更干净、优雅。 SPARC,但它们都很棒。

In addition to complete system emulation, QEMU can also emulate SPARC at the user-space level, so that you can write a program in SPARC assembly and use standard Linux system calls and it will call the standard x86 kernel versions... works pretty well!!

If you aren't sure you want to learn SPARC assembly specifically, you might look into MIPS instead. Most wireless routers are based on MIPS processors and can run Linux. It is similar to SPARC, of a similar vintage, and along with SPARC it's one of the two original RISC architectures... in my opinion MIPS is actually a little bit more of a clean and elegant architecture than SPARC, but they're both great.

天邊彩虹 2024-07-13 17:01:02

看起来 QEMU 做了足够的模拟,可以让您在以下位置安装 SPARC Linux: http://www.bellard .org/qemu/status.html

在这种情况下,只需获取 SPARC 发行版(例如 Debian),一切就绪!

Looks like QEMU does enough emulation for you to install a SPARC Linux on: http://www.bellard.org/qemu/status.html

In which case, just grab a SPARC distribution (e.g., Debian), and you're all set!

孤独陪着我 2024-07-13 17:01:02

polarhome 提供对 Solaris 系统(似乎是 Sun Sparc 系统,而不是 x86)的 shell 访问。 费用为 10 个当地货币单位(美元、欧元等)或 2 美元,以较高者为准。

polarhome offers shell access to a Solaris system (which appears to be a Sun Sparc system, not x86). It costs 10 local currency units (dollars, euros, etc) or $2 US, whichever is greater.

橙幽之幻 2024-07-13 17:01:02

Aeroflex Gaisler 为其 LEON2、LEON3 和 LEON4 处理器提供了商业模拟器,这些处理器实际上是 SPARC。 LEON3 还有一个有限的评估版本。

请参阅http://www.gaisler.com/index.php/downloads/simulators

他们为 Windows (MinGW) 和 Linux 提供免费的 GCC 交叉编译器:

http://www .gaisler.com/index.php/downloads/compilers

Aeroflex Gaisler has comercial simulators for their LEON2, LEON3 and LEON4 processors which are actually SPARC. There is also a limited evaluation version for LEON3.

See http://www.gaisler.com/index.php/downloads/simulators

They provide free GCC cross-compilers for Windows (MinGW) and Linux:

http://www.gaisler.com/index.php/downloads/compilers

秋风の叶未落 2024-07-13 17:01:02

请注意,如果您打算运行 2.5.1/5.5 之后的 Solaris,那么 qemu-sparc 将无法帮助您。 NetBSD 和 Linux 应该运行得很好。

这是因为 qemu-sparc 仅支持非常旧的 SPARC 处理器。 当 Solaris 安装程序意识到体系结构太旧时,它会导致 Solaris 安装程序抛出错误,或者如果您尝试安装 Solaris 8-11,则会在安装程序开始之前出现故障/崩溃。

之前提到过一些成本细节:如果您想走这条路,可以从 EBay 购买能够运行 Solaris 11 的功能齐全的 64 核 SPARC 2U,价格约为 400 美元。 T5220 可以运行 Solaris 11。

我没有使用这里提到的其他模拟器的经验,但也听说过 Simics 的好消息,尽管它很贵。

Just a note that If you're intend to run Solaris later than 2.5.1/5.5 then qemu-sparc won't help you. NetBSD and Linux should run fine though.

This is because qemu-sparc supports only very old SPARC processors. It will either cause the Solaris installer to throw an error when it realizes the architecture is too old, or fault/crash before it gets started if you try to install Solaris 8-11.

Mentioned previously but some cost details: A fully functional 64 core SPARC 2U capable of running Solaris 11 can be acquired from EBay for about $400USD if you want to go that route. A T5220 will do Solaris 11.

I don't have experience with the other emulators mentioned here but have also heard good things about Simics, though it's expensive.

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