Context switching and kernel / user mode boundaries

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
mrtroy
Posts: 1
Joined: Thu May 04, 2006 11:00 pm

Context switching and kernel / user mode boundaries

Post 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.
mrkaktus
Member
Member
Posts: 102
Joined: Thu Jan 06, 2005 12:00 am
Location: Poland - Gdansk
Contact:

Re: Context switching and kernel / user mode boundaries

Post 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).
Da_Maestro
Member
Member
Posts: 144
Joined: Tue Oct 26, 2004 11:00 pm
Location: Australia

Re: Context switching and kernel / user mode boundaries

Post 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.
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
Post Reply