Help! Floating Point Calculation inside Kernel Mode.

Help! Floating Point Calculation inside Kernel Mode.

Post by YXplMmNvb2 » Fri, 05 May 2006 12:57:02


Hello there,

I know it is not good and dangerous to use floating point arithmetics inside
kernel mode. Under tight schedule, I have no choice to port my algorithm
(that written mainly in floating point arithmetics on several functions) into
kernel mode without much modification of the code. I found that the result
came out from kernel mode is not same as the result came out from the user
mode. I have used these nested functions, KeSaveFloatingPointState and
KeRestoreFloatingPointState, but with no help at all. To use these functions,
am I supposing to nest anywhere that is using floating point arithmetics?
Says you have a function A that will call function B and C, functions B and
C all have floating point arithmetics. For this case, am I just put functions
B and C between KeSaveFloatingPointState and KeRestoreFloatingPointState or I
have to do same thing for function B and C too?

Is there any way that I can use floating point arithmetics safely for device
driver?

Many thanks in advanced.
 
 
 

Help! Floating Point Calculation inside Kernel Mode.

Post by Maxim S. S » Sat, 06 May 2006 02:27:11

> Says you have a function A that will call function B and C, functions B and

Correct.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
XXXX@XXXXX.COM
http://www.yqcomputer.com/

 
 
 

Help! Floating Point Calculation inside Kernel Mode.

Post by YXplMmNvb2 » Sat, 06 May 2006 10:06:01

Thank for reply.

I just nested the function which will call "functions" with floating piont
arithmetics. Too bad, it gave very strange/unexpected results! Any clue?

Is this possible to move this process running at user mode as service to
serve the device driver? And how am I going to do acheive that?

Thanks again!