我在gem5中有以下错误。这只发生在手臂上。在x86中,我看到一些系统调用被忽略,但没有一个会导致致命错误。

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的faq中找到了答案。但现在它显示了这个错误:
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不支持的syscalls?有预编译的例子,所以一定有办法。

最佳答案

更新: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 syscall ignored消息,那么在源代码中很容易将其恢复。
但是炸毁行为看起来确实很明智:当程序试图运行未实现的系统调用时,您如何期望它正常工作?
大多数系统调用在两个arch中都没有实现,可以在以下位置看到:
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
所以,我只看到两个合理的解决方案:
实现syscall,这对大多数人来说很简单,并向gem5发送一个补丁
看看其他的arch是否通过grepping实现了它,有时另一个arch已经实现了它,您只需要编写一些东西
你也可以试着忽略系统调用,todo:arm中有好的方法吗?但你必须确定这不重要。
放弃系统调用模拟,使用更健全的完整系统:When to use full system FS vs syscall emulation SE with userland programs in gem5?

关于linux - gem5 ARM中缺少系统调用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/51256193/

10-11 08:06