关于Windows驱动程序模型 [英] About windows driver model

查看:153
本文介绍了关于Windows驱动程序模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该驱动程序模型描述了两种模式:用户模式和内核模式,内核模式是从用户模式特权的模式,文档描述了内核模式独立于用户模式,即两种模式彼此独立.

但是,当我们单击或访问软件的任何部分(例如文本框等)时,该过程必须与内核进行通信以接收输入或将输出发布到i/o设备,因此内核模式开始起作用... 那么为什么我们将这两种模式称为独立呢?

Ther driver model describes that there are 2 modes...user and kernel mode the kernel mode being mode privilidged from the user mode and documentattion describes the kernel mode independent form the user mode ie the two modes are independent of each other.

but when us make a click or access any part of software such as text box etc, the process has to communicate to kernel to receive input or post output to the i/o devices and thus kernel mode comes to play...Then why do we call the two modes independent???

推荐答案

否.谁告诉你他们是独立的?它们是隔离的,并且在硬件级别是隔离的,CPU具有四个访问环,但是Windows仅使用两个访问环.在用户模式下,没有任何东西可以直接调用内核.注意控件是反向的:用户通过硬件发送输入,这会导致硬件中断.所有的中断过程总是设置在内核模式下.而且实际上在用户模式下不可能设置一个:不可能的原因不是因为在OS级别进行了某些编程访问,而是因为访问是通过设置硬件来密封的.现在,中断过程代码最终在用户模式下触发适当的调用,特别是,它最终将高层消息(如鼠标按下)分派到应用程序事件循环(GetMessage/DispatchMessage).因此,在这种情况下,用户模式永远不会在内核模式下调用任何内容.事件的顺序正好相反.

主要思想解释如下:
http://en.wikipedia.org/wiki/Ring_%28computer_security%29 [ ^ ].

但是,当然,某些API调用最终会在需要时从用户模式委派给内核.请参阅:
http://en.wikipedia.org/wiki/Windows_Driver_Model [ http://en.wikipedia.org/wiki/Windows_NT#Driver_models [ http://www.multicians.org/protection.html [ http://www.osronline.com/article.cfm?id=94 [ ^ ].

另请参见:
http://en.wikipedia.org/wiki/Inversion_of_control [
No. Who told you they are independent? They are isolated, and isolated at the level of hardware, the CPU which has four rings of access, but Windows uses just two. And nothing in user mode can call a kernel directly. Pay attention that the control is inverted: the user sends the input through hardware, and it causes hardware interrupt. All interrupt procedures are always set up in kernel mode; and it''s physically impossible to set up one in the user mode: impossible not due to some programming access at the level of OS, but because the access is sealed by setting up the hardware. Now, the interrupt procedure code eventually triggers appropriate calls in user mode, in particular, it ultimately dispatches the high-level message (like mouse down) to the application event loop (GetMessage/DispatchMessage). So, in this very case the user mode never calls anything in kernel mode; the sequence of events is just the opposite.

The main ideas are explained here:
http://en.wikipedia.org/wiki/Ring_%28computer_security%29[^].

But of course, some of API calls are eventually delegated from user mode to the kernel, when it is required. Please see:
http://en.wikipedia.org/wiki/Windows_Driver_Model[^],
http://en.wikipedia.org/wiki/Windows_NT#Driver_models[^].

Here is some interesting articles on the topic:
http://www.multicians.org/protection.html[^],
http://www.osronline.com/article.cfm?id=94[^].

Please see also:
http://en.wikipedia.org/wiki/Inversion_of_control[^].

—SA


这篇关于关于Windows驱动程序模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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