Device driver: Difference between revisions - Wikipedia
Article Images
Content deleted Content added
m |
|||
Line 36: ==Privilege levels== Depending on the operating system, device drivers may be permitted to run at various different [[Privilege_(computing)|privilege levels]]. The choice of which level of privilege the drivers are in is largely decided by the type of [[Kernel (operating system)|kernel]] an operating system uses. An operating system which uses a [[monolithic kernel]], such as the [[Linux kernel]], will typically run device drivers with the same privilege as all other kernel objects. By contrast, a system designed around [[microkernel]], such as [[Minix]], will place drivers as processes independent from the kernel but that use it for essential [[Input/output|input-output]] functionalities and to pass messages between user programs and each other.<ref>{{cite book |last1=Tanenbaum |first1=Andrew |last2=Woodhull |first2=Albert |title=Operating Systems, Design and Implementation |date=2006 |publisher=Pearson Pretence Hall |location=Upper Saddle River, NJ |isbn=0-13-142938-8 |page=256 |edition=3rd.}}</ref> On [[Windows NT]], a system with a [[hybrid kernel]], it is common for device drivers to run in either [[CPU modes|kernel-mode]] or [[user space|user-mode]].<ref>{{cite book |last1=Yosifovich |first1=Pavel |last2=Ionescu |first2=Alex |last3=Russinovich |first3=Mark |last4=Solomon |first4=David |title=Windows Internals, Part 1 |date=2017 |publisher=Microsoft Press |location=Redmond, Washington |isbn=978-0-7356-8418-8 |edition=Seventh}}</ref> The most common mechanism for segregating memory into various privilege levels is via [[Protection ring|protection rings]]. On many systems, such as those with [[x86]] and [[ARM_(processor)|ARM]] processors, switching between rings imposes a performance penalty, a factor that operating system developers and [[Embedded software|embedded software engineers]] consider when creating drivers for devices which are preferred to be run with low latency, such as [[Network interface card|network interface cards]]. The primary benefit of running a driver in user mode is improved stability, since a poorly written user-mode device driver cannot crash the system by overwriting kernel memory.<ref>{{cite web |