Page 1 of 1

Context switching and kernel / user mode boundaries

Posted: Wed May 10, 2006 11:00 pm
by mrtroy
Hi all,

I'm trying to understand the way windows currently operates.. From what knowledge I have gathered the monotholic nature of windows xp means that the device drivers run in kernel space. So I'm just trying to get my head around how the system does a graphics operation like gl_begin().

when I call that in my user space program does a context switch occur when the method in opengl32.dll is invoked? Is there a context switch happening for every GL command?

I'm just trying to understand the architecture so I can properly design the video component of my os.

Re: Context switching and kernel / user mode boundaries

Posted: Thu May 11, 2006 11:00 pm
by mrkaktus
I think yes, there is context swith. This is why M$ want to write brand new graphic drivers for Windows Vista which will operate in User Level (DPL/CPL=3).

Re: Context switching and kernel / user mode boundaries

Posted: Sun May 14, 2006 11:00 pm
by Da_Maestro
No there is no context switch. The windows OpenGL libraries use a call-gate to switch to kernel mode in the context of the current task.

Having said that there is performance overhead with a switch from user to kernel mode, but it is negligible compared to the gains you get by running the code in kernel mode.
I think yes, there is context swith. This is why M$ want to write brand new graphic drivers for Windows Vista which will operate in User Level (DPL/CPL=3).
This is a rumor. The original Windows NT has a graphics engine which runs in user mode. They scrapped it and moved graphics into kernel mode because it was too slow.