gem5 syscall仿真臂C hello world因“致命:未实现syscall gettid(#224)”而失败。 [英] gem5 syscall emulation arm C hello world fails with "fatal: syscall gettid (#224) unimplemented"

查看:121
本文介绍了gem5 syscall仿真臂C hello world因“致命:未实现syscall gettid(#224)”而失败。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在gem5中出现以下错误。这仅在ARM中发生。使用X86时,我看到一些系统调用被忽略了,但没有一个致命错误。

I am having the following error in gem5. This happens in ARM only. With X86 I see some syscalls being ignored but none causing a 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

我发现答案在gem5的常见问题解答中。但是现在它显示了此错误:

I found this answer in gem5's FAQ. But now it shows this error:

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中使用以下命令进行编译:

I am compiling in Ubuntu 18.04 using this:

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

是否有人找到一种针对ARM的简单hello世界的编译方法,该世界不使用gem5不支持的syscall?有预编译的示例,因此必须有一种方法。

Has anyone found a way to compile a simple hello world, targeting ARM, that doesn't use syscalls not supported by gem5? There are pre-compiled examples so there must be a way.

推荐答案

更新:x86,arm和aarch64 C语言世界正在运行在Ubuntu 18.04预打包的工具链上,请参阅:如何使用se.py在gem5 syscall仿真模式下编译和运行可执行文件?

update: x86, arm and aarch64 C hello world is working on Ubuntu 18.04 pre-packaged toolchain, see: How to compile and run an executable in gem5 syscall emulation mode with se.py?

FATAL :内核太旧了,以前曾在以下位置被问过:如何解决致命错误:内核太旧

"FATAL: kernel too old" has been previously asked at: How to solve "FATAL: kernel too old" when running gem5 in syscall emulation SE mode?

如该页所述,该消息来自glibc完整性检查,而 ct-ng 是克服该问题的最明智的方法。

As explained in that page, that message comes from a glibc sanity check, and ct-ng is the sanest approach to overcome it.

至于未实现的系统调用,我不知道为什么x86会忽略它们并设防炸毁,但如果您给出x86 syscall忽略的消息,则应该很容易地在源代码中进行重复显示。

As for the unimplemented syscalls, I don't know why x86 ignores them and arm blows up, but it should be easy to grep that up in the source if you give the x86 syscall ignored message.

但是炸毁行为确实很明智:如何您是否希望程序在尝试运行未实现的系统调用时能够正常运行?

But the blow up behavior does seem sensible: how can you expect your program to work properly when it tries to run an unimplemented syscall?

两个弓中的大多数系统调用都未实现,如以下所示:

Most syscalls are unimplemented in both archs as can be seen at:

  • https://github.com/gem5/gem5/blob/5de8ca95506a5f15bfbfdd2ca9babd282a882d1f/src/arch/arm/linux/process.cc#L123
  • https://github.com/gem5/gem5/blob/5de8ca95506a5f15bfbfdd2ca9babd282a882d1f/src/arch/x86/linux/process.cc#L222

因此,我只看到两个明智的解决方案:

So, I only see two sensible solutions:


  • 实施系统调用,这对于大多数人来说都很容易,并向gem5发送补丁


    • 拱门通过grepping来实现它,有时另一个拱门已经实现了它,而您只需要编写东西

    • 您还可以尝试忽略syscall,TODO:ARM中是否有一个好的方法?但是您必须非常确定这不会有问题。

    这篇关于gem5 syscall仿真臂C hello world因“致命:未实现syscall gettid(#224)”而失败。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆