内核如何理解shell脚本? [英] how kernels understand the shell script ?

查看:113
本文介绍了内核如何理解shell脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

内核工作及其与shell脚本的关系尚不清楚。请通过内核程序和shell程序解释。

Kernels working and their relationships with shell-script are not clear. please explain by a kernel program and shell program.

推荐答案

shell脚本是在shell语言解释器的帮助下执行的,它只是常规的用户模式在外部保护环中工作的应用程序。因此,问题在于理解应用程序如何工作以及内核模式代码如何与这些应用程序交互。



这个问题有点太大了并且在一个简单的答案中解释复杂。由于环的保护和隔离,在某些类型的CPU中)是由硬件介导的,所以涉及特定的CPU架构,并且这种架构非常复杂,需要整本书来解释它们,包括隔离模式,不同的内存模型,描述符等等。 Linux体系结构确实使用了大多数这些功能来保持操作系统内核模式软件的稳定性。你可以从这里开始学习:

http://en.wikipedia.org/wiki/ Protection_ring [ ^ ],

http://en.wikipedia.org/wiki/Protected_mode [ ^ ],

http://en.wikipedia.org/wiki/Complex_instruction_set_computer [ ^ ]。



-SA
The shell script is executed with the help of a shell language interpreter, which is nothing but a regular user-mode application working in the outer protection ring. Therefor, the question is reduced to understanding of how application programs work and how the kernel-mode code interact with those application programs.

And this question is a bit too big and complex to be explained in a single quick answer. As the protection and isolation of rings is, in some class of CPUs) is hardware-mediated, specific CPU architectures are involved, and the such architectures are complex enough to require a whole book explaining them, including isolation of modes, different memory models, descriptors and a lot more. Linux architecture really use most of these features to keep the OS kernel-mode software stable. You can start learning, say, from here:
http://en.wikipedia.org/wiki/Protection_ring[^],
http://en.wikipedia.org/wiki/Protected_mode[^],
http://en.wikipedia.org/wiki/Complex_instruction_set_computer[^].

—SA


这篇关于内核如何理解shell脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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