Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Ther driver model describes that there are 2 modes...user and kernel mode the kernel mode being mode privilidged from the user mode and documentattion describes the kernel mode independent form the user mode ie the two modes are independent of each other.

but when us make a click or access any part of software such as text box etc, the process has to communicate to kernel to receive input or post output to the i/o devices and thus kernel mode comes to play...Then why do we call the two modes independent???
Posted

1 solution

No. Who told you they are independent? They are isolated, and isolated at the level of hardware, the CPU which has four rings of access, but Windows uses just two. And nothing in user mode can call a kernel directly. Pay attention that the control is inverted: the user sends the input through hardware, and it causes hardware interrupt. All interrupt procedures are always set up in kernel mode; and it's physically impossible to set up one in the user mode: impossible not due to some programming access at the level of OS, but because the access is sealed by setting up the hardware. Now, the interrupt procedure code eventually triggers appropriate calls in user mode, in particular, it ultimately dispatches the high-level message (like mouse down) to the application event loop (GetMessage/DispatchMessage). So, in this very case the user mode never calls anything in kernel mode; the sequence of events is just the opposite.

The main ideas are explained here:
http://en.wikipedia.org/wiki/Ring_%28computer_security%29[^].

But of course, some of API calls are eventually delegated from user mode to the kernel, when it is required. Please see:
http://en.wikipedia.org/wiki/Windows_Driver_Model[^],
http://en.wikipedia.org/wiki/Windows_NT#Driver_models[^].

Here is some interesting articles on the topic:
http://www.multicians.org/protection.html[^],
http://www.osronline.com/article.cfm?id=94[^].

Please see also:
http://en.wikipedia.org/wiki/Inversion_of_control[^].

—SA
 
Share this answer
 
v5
Comments
fjdiewornncalwe 24-Oct-12 14:27pm    
+5. Thorough.
Sergey Alexandrovich Kryukov 24-Oct-12 14:54pm    
Thank you, Marcus. I wish I had a link to the manual on x86 architecture (x86-64 and Itanium are basically the same, with more registers/commands) I used, but it should be easy to find. Reading on just topic overview would make things pretty clear.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900