simple question
-
hi,can anyone please tell me how the switching from user mode to kernel mode in windows happens? i mean what ensures that a user mode application does not make a cpu-mode switch and then jump into the kernel or access hw directly?a short description of how and where the switching procedure happens would help a lot. thanks
-
hi,can anyone please tell me how the switching from user mode to kernel mode in windows happens? i mean what ensures that a user mode application does not make a cpu-mode switch and then jump into the kernel or access hw directly?a short description of how and where the switching procedure happens would help a lot. thanks
Thread priority and time slicing take care of it. When an app calls CreateFile(), the IO manager calls into the driver that owns this symbolic link, hitting its dispatch handler with an IRP_MJ_CREATE. Same for WriteFIle() IRP_MJ_WRITE etc. And, if the app has opened the file for sync IO, that calling thread in the app will be blocked untill the driver completes that IRP (IO Request Packet). For data coming in, the driver will get an interupt, and this will absoloutely throw anything at a lower priority off the CPU and the system will call the drivers Interrupt handling routine. You should look at stuff online about the NT scheduler, kernel, interupts, and so on (XP is still windows NT by the way)
Truth is the subjection of reality to an individuals perception
-
hi,can anyone please tell me how the switching from user mode to kernel mode in windows happens? i mean what ensures that a user mode application does not make a cpu-mode switch and then jump into the kernel or access hw directly?a short description of how and where the switching procedure happens would help a lot. thanks
-
Ah, and security. Memory in the virtual address space an app sits in is secured. So the app can only get to the bottom 2 gig on a 32 bit PC. The kernel has the top 2 gig.
Truth is the subjection of reality to an individuals perception
I can only assume that you want to try and switch to Kernal Mode in the midst of your User Program. This is something that generally should not be needed in any user program. Windows puts up several layers of defence to stop you from doing so!, and for good reasons! (Remember Dos??)Read your Windows Documentation, find a way around whatever you want to achieve! In the long run, it is the better way, it is likely to continue on running with the next version of windows. If your program relies on anything in the kernal, it probably won't survive the next windows upgrade! (Don't be Stupid, I've Been there);)
LateNightsInNewry
-
hi,can anyone please tell me how the switching from user mode to kernel mode in windows happens? i mean what ensures that a user mode application does not make a cpu-mode switch and then jump into the kernel or access hw directly?a short description of how and where the switching procedure happens would help a lot. thanks
The Switching between User and Kernal mode, happens in the background, and is an issue that User Mode programmers(as opposed to System Mose Programmers, which are mostly those working for Microsoft, writing the Next version of Windows), should have NO Concern about! There are ways of putting the system in Kernal Mode, but, I'm Not going to tell you, because you sound like someone who has not a notion about how windows works. believe me, I am saving yourself, and the friends to whom you propose to pass your software on, from a lot of hassle which would ensue if you went that way! Go the Windows Way, and use the WIN32 Api. Excepting special programs (e.g. Specialist Debuggers) Kernal Mode switching IS Not Needed!!!
LateNightsInNewry