[haiku] Re: nv_driver in kernel mode, but media kit not?

  • From: Gerald Zajac <zajacg@xxxxxxxxxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Sun, 25 Jul 2010 11:20:55 -0400

Ingo Weinhold wrote:
On 2010-07-25 at 14:19:09 [+0200], Miroslav Stimac <Miroslav.Stimac@xxxxxx> wrote:
I found an interesting diagram:
http://ezri.nextraweb.com/files/haiku/svg/kernel-diagram-new.png

According to this diagram, the nv_driver (is this the NVidia graphic driver?) runs in kernel mode.

Is this really so?

Yes. "Run" is not quite the right word, though. Graphics cards drivers (and a lot of others) don't actively run. They normally just provide a set of functions that are called by the kernel and (indirectly) by the userland.

Of course, this may have advantages in performance because no context switch between user mode and kernel mode is necessary.

Most drivers play directly with hardware, which requires a higher privilege level. There would be ways around that (like only having a stub in the kernel and the rest in userland), but that makes things more complicated and doesn't help performance.

Most drivers consist of a single module which runs in kernel mode; whereas, video drivers consist of two modules. One module is the driver which runs in kernel mode; whereas, the other module is the accelerant which runs in user mode and does most of the work of interacting with the video hardware.

-- Gerald

Other related posts: