How to solve “FATAL: kernel too old” when running gem5 in syscall emulation SE mode?

爷,独闯天下 提交于 2019-11-28 01:41:37

update gem5 May 2019

After the merging of the patch https://gem5-review.googlesource.com/c/public/gem5/+/17849 it is now possible to "fix" the problem simply with:

gem5.opt se.py --param 'system.cpu[0].workload[:].release = "4.18.0"'

You should then set a kernel version that matches your toolchain or newer.

I don't know how to find the minimal value easily for Ubuntu prebuild cross toolchains, but you could just try setting the newest kernel release, or maybe 99.99.99.

A version being too new might result in glibc using optional new kernel features not yet implemented in gem5, but this is not common I believe.

Ubuntu 18.04 with gem5 Oct 2018

After a few recent gem5 updates, a C hello world for all of x86, arm, aarch64 works with the pre-packaged Ubuntu toolchains. This is described in detail at: How to compile and run an executable in gem5 syscall emulation mode with se.py?

crosstool-ng x86_64-unknown-linux-gnu

Worked with gem5 49f96e7b77925837aa5bc84d4c3453ab5f07408e, ct-ng ab3c204aee88f08481f1f63825d0e94b082ef84e. Generates executables for old Linux kernel 3.2 according to file for some reason.

uclibc

This is likely a bad idea, but if we use crosstool-ng with uclibc instead of glibc:

./ct-ng aarch64-unknown-linux-uclibc

then that implementation does not have a kernel check, and the hello world works for all archs.

Also for some reason mrs was not used in that case because glibc tends to use more features on it's pre-main functions. That problem was however solved on a later commit as mentioned at: How to compile and run an executable in gem5 syscall emulation mode with se.py?

Of course, other unimplemented syscalls on more complex programs are bound to fail.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!