Kernel Mode vs UserMode

This is sort of a knowledge verification for me, but why does it seem that whenever something is ported to kernel mode, it always gets
MUCH faster and more stable…

I know that the stability is primarily due to the higher diligence, intelligence, and knowledge levels of the kernel-mode programmers,
but the speed boost?? I dont see how simply running the same assembly code instructions, we all know C compiles to assembly
dont we, with a different flag of sorts set in the CPU makes it run ‘faster’. Is the code just faster because it doesnt have to go through
all the layers of Win32 interface DLLs, all the rigorous parameter checking of the Zw*** and Nt*** functions, or is it because it is
bestowed upon with magical powers upon the porting to kernel mode??

Asa

Depends of the application a lot. F.e. network and storage stack
components moved to kernel
work much faster (I/O at raised interrupt level, thread context switch
eliminated, unbuffered I/O).
Just moving the code to kernel and making it run at PASSIVE_LEVEL in
system thread (like quite
a lot of people do) would hardly give any benefits – you’re correct in
this. What are you trying to
write?

Regards,
Anton A. Kolomyeytsev

RocketDivision.Com – Toolkits for Network and Storage Kernel Software
Developers

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Asa Yeamans
Sent: Wednesday, September 01, 2004 5:55 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Kernel Mode vs UserMode

This is sort of a knowledge verification for me, but why does it seem
that whenever something is ported to kernel mode, it always gets MUCH
faster and more stable…

I know that the stability is primarily due to the higher diligence,
intelligence, and knowledge levels of the kernel-mode programmers, but
the speed boost?? I dont see how simply running the same assembly code
instructions, we all know C compiles to assembly dont we, with a
different flag of sorts set in the CPU makes it run ‘faster’. Is the
code just faster because it doesnt have to go through all the layers of
Win32 interface DLLs, all the rigorous parameter checking of the Zw***
and Nt*** functions, or is it because it is
bestowed upon with magical powers upon the porting to kernel mode??

Asa


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’ To unsubscribe send a blank email to xxxxx@lists.osr.com

oh i was just curious, ive read about w2k3’s HTTP.SYS and the NT 4.0 migration of
the majority of winsrv.dll code to win32k.sys and was curious as to the origin of
the benefits of moving code to kernel mode from usermode.

asa

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Anton A.
Kolomyeytsev (CoolDev.Com)
Sent: Wednesday, September 01, 2004 1:41 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Kernel Mode vs UserMode

Depends of the application a lot. F.e. network and storage stack
components moved to kernel
work much faster (I/O at raised interrupt level, thread context switch
eliminated, unbuffered I/O).
Just moving the code to kernel and making it run at PASSIVE_LEVEL in
system thread (like quite
a lot of people do) would hardly give any benefits – you’re correct in
this. What are you trying to
write?

Regards,
Anton A. Kolomyeytsev

RocketDivision.Com – Toolkits for Network and Storage Kernel Software
Developers

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Asa Yeamans
Sent: Wednesday, September 01, 2004 5:55 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Kernel Mode vs UserMode

This is sort of a knowledge verification for me, but why does it seem
that whenever something is ported to kernel mode, it always gets MUCH
faster and more stable…

I know that the stability is primarily due to the higher diligence,
intelligence, and knowledge levels of the kernel-mode programmers, but
the speed boost?? I dont see how simply running the same assembly code
instructions, we all know C compiles to assembly dont we, with a
different flag of sorts set in the CPU makes it run ‘faster’. Is the
code just faster because it doesnt have to go through all the layers of
Win32 interface DLLs, all the rigorous parameter checking of the Zw***
and Nt*** functions, or is it because it is
bestowed upon with magical powers upon the porting to kernel mode??

Asa


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’ To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@rivin.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

This paper talks about it :
http://www.microsoft.com/technet/prodtechnol/ntwrkstn/evaluate/featfunc/kernelwp.mspx

Regards,
Satish K.S

On Wed, 1 Sep 2004 20:23:14 -0500, Asa Yeamans wrote:
> oh i was just curious, ive read about w2k3’s HTTP.SYS and the NT 4.0 migration of
> the majority of winsrv.dll code to win32k.sys and was curious as to the origin of
> the benefits of moving code to kernel mode from usermode.
>
> asa
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Anton A.
> Kolomyeytsev (CoolDev.Com)
> Sent: Wednesday, September 01, 2004 1:41 AM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Kernel Mode vs UserMode
>
> Depends of the application a lot. F.e. network and storage stack
> components moved to kernel
> work much faster (I/O at raised interrupt level, thread context switch
> eliminated, unbuffered I/O).
> Just moving the code to kernel and making it run at PASSIVE_LEVEL in
> system thread (like quite
> a lot of people do) would hardly give any benefits – you’re correct in
> this. What are you trying to
> write?
>
> Regards,
> Anton A. Kolomyeytsev
>
> RocketDivision.Com – Toolkits for Network and Storage Kernel Software
> Developers
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] On Behalf Of Asa Yeamans
> Sent: Wednesday, September 01, 2004 5:55 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Kernel Mode vs UserMode
>
> This is sort of a knowledge verification for me, but why does it seem
> that whenever something is ported to kernel mode, it always gets MUCH
> faster and more stable…
>
> I know that the stability is primarily due to the higher diligence,
> intelligence, and knowledge levels of the kernel-mode programmers, but
> the speed boost?? I dont see how simply running the same assembly code
> instructions, we all know C compiles to assembly dont we, with a
> different flag of sorts set in the CPU makes it run ‘faster’. Is the
> code just faster because it doesnt have to go through all the layers of
> Win32 interface DLLs, all the rigorous parameter checking of the Zw
> and Nt
functions, or is it because it is
> bestowed upon with magical powers upon the porting to kernel mode??
>
> Asa
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument:
> ‘’ To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@rivin.net
>
>
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>