gpt4 book ai didi

linux - gem5 系统调用仿真 arm C hello world 失败,出现 "fatal: syscall gettid (#224) unimplemented"

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:34:39 29 4
gpt4 key购买 nike

我在 gem5 中遇到以下错误。这只发生在 ARM 中。在 X86 中,我看到一些系统调用被忽略,但没有一个导致 fatal error 。

tomas@ubuntu:~/gem5$ ./build/ARM/gem5.opt configs/example/arm/starter_se.py ../tests_gem5/hello
gem5 Simulator System. http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.

gem5 compiled Jul 9 2018 17:09:01
gem5 started Jul 9 2018 18:07:37
gem5 executing on ubuntu, pid 5064
command line: ./build/ARM/gem5.opt configs/example/arm/starter_se.py ../tests_gem5/hello

info: 1. command and arguments: ['../tests_gem5/hello']
Global frequency set at 1000000000000 ticks per second
warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (1024 Mbytes)
warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (1024 Mbytes)
0: system.remote_gdb: listening for remote gdb on port 7000
info: Entering event queue @ 0. Starting simulation...
fatal: syscall openat (#322) unimplemented.
Memory Usage: 2246296 KBytes

我找到了 this在 gem5 的常见问题解答中回答。但是现在它显示这个错误:

warn: ignoring syscall openat(...)
FATAL: kernel too old
warn: ignoring syscall rt_sigprocmask(...)
(further warnings will be suppressed)
fatal: syscall gettid (#224) unimplemented.

我正在使用这个在 Ubuntu 18.04 中编译:

arm-linux-gnueabi-gcc hello.c -o hello -static -DUNIX

有没有人找到一种方法来编译一个简单的 hello world,目标是 ARM,它不使用 gem5 不支持的系统调用?有预编译的例子,所以一定有办法。

最佳答案

更新:x86、arm 和 aarch64 C hello world 正在 Ubuntu 18.04 预打包工具链上工作,请参阅:How to compile and run an executable in gem5 syscall emulation mode with se.py?

"FATAL: kernel too old"之前曾在以下位置询问过:How to solve "FATAL: kernel too old" when running gem5 in syscall emulation SE mode?

如该页面所述,该消息来自 glibc 健全性检查,ct-ng 是克服它的最明智的方法。

至于未实现的系统调用,我不知道为什么 x86 会忽略它们并且 arm 崩溃了,但是如果您给出 x86 系统调用被忽略的消息,应该很容易在源代码中找到它。

但是爆炸行为看起来确实是明智的:当程序试图运行一个未实现的系统调用时,你怎么能期望它正常工作呢?

大多数系统调用都未在两个架构中实现,如下所示:

所以,我只看到两个合理的解决方案:

  • 实现系统调用,这对他们中的大多数人来说都很容易,并向 gem5 发送一个补丁
    • 通过 grepping 看看其他 arch 是否实现了它,有时另一个 arch 已经实现了它,你只需要写下来
    • 您也可以尝试忽略系统调用,TODO:在 ARM 中有好的方法吗?但您必须非常确定这无关紧要。
  • 放弃系统调用仿真,只使用更健全的完整系统:When to use full system FS vs syscall emulation SE with userland programs in gem5?

关于linux - gem5 系统调用仿真 arm C hello world 失败,出现 "fatal: syscall gettid (#224) unimplemented",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51256193/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com