Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Windows Driver
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 24-Oct-12 7:17am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
v5
Comments
Marcus Kramer at 24-Oct-12 14:27pm
   
+5. Thorough.
Sergey Alexandrovich Kryukov at 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)

  Print Answers RSS
0 OriginalGriff 277
1 Maciej Los 220
2 DamithSL 190
3 Raul Iloc 185
4 Richard MacCutchan 175
0 OriginalGriff 5,130
1 DamithSL 4,197
2 Maciej Los 3,670
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,821


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 24 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100