gem5 se模式如何执行具有操作系统依赖性的程序? [英] How can gem5 se mode execute a program with operating system dependencies?

查看:182
本文介绍了gem5 se模式如何执行具有操作系统依赖性的程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Gem5 se模式是非os模式,但是我能够在其上执行具有与os依赖关系的命令的行锤代码.但是,如果se模式下没有os,那么它们如何在se模式下执行. /p>

Gem5 se mode is non-os mode, but i am able to execute row-hammer code on it which has commands with os dependencies.But if there is no os in se mode then how are they executed in se mode.

推荐答案

大多数用户态允许的指令只是做通常的事情,即稍微改变CPU的状态:触摸寄存器+缓存+内存.

Most userland allowed instructions just do the usual thing, which is to change the state of the the CPU slightly: touch registers + cache + memory.

然后,当到达系统调用指令时,系统调用将转发到实际执行操作的主机.

Then when a syscall instruction is reached, the syscall is forwarded to the host which actually takes action.

但是,这也需要操作系统进行一些额外的记账,这就是为什么每个单独的syscall都必须单独实现的原因.

However, this also requires some extra bookkeeping by the OS, which is why every single syscall must be implemented separately.

如果我想学习这个:-)我将看一下像brk这样的简单syscall的实现:

If I wanted to learn this :-) I would look at the implementation of a simple syscall like brk:

  • https://github.com/gem5/gem5/blob/5d442571eff5116551609ee7a3b63a3b9d27ff45/src/arch/x86/linux/process.cc#L223
  • https://github.com/gem5/gem5/blob/5d442571eff5116551609ee7a3b63a3b9d27ff45/src/sim/syscall_emul.cc#L212

我还将研究QEMU用户模式,我认为那里将是一个类似的概念,但是可能会有更多的可用材料.

I would also look into QEMU user mode, I think it will be a similar concept there, but with potentially more material available.

也许有一个更好的了解的人可以更详细地解释,并进一步注释代码的特定部分.

Maybe someone with a better understanding can explain further in more detail, and annotate specific parts of the code further.

这篇关于gem5 se模式如何执行具有操作系统依赖性的程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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