Subject: Floating point calculation in the kernel
To: None <tech-kern@netbsd.org>
From: Peter Bex <Peter.Bex@student.kun.nl>
List: tech-kern
Date: 02/24/2005 11:56:41
--6c2NcOVqGQ03X4Wi
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello,

I'm implementing a neural network in the kernel, which needs floating
point precision.  I currently have a function that gets called everytime
updatepri gets called, which calculates a new float value.

When I boot up, it works for a few cycles until a certain moment, then it
crashes in my calculation function at the position where the float value
is assigned to a variable.  The crash backtrace shows the ultimate
uvm_fault is raised in npxdna_xmm, so I figured you must do something
special to be able to use floats safely.

I can't find any examples of float usage in the kernel, so I was
wondering if someone from this list could answer my newbie question:
How do I use floats safely/correctly in the kernel?

(aside from the obvious advice that it's not a good thing to do in
 the kernel, implementing neural networks with non-float values is
 very difficult, or at least inconvenient)

Regards,
Peter
--=20
http://www.student.kun.nl/peter.bex
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
							-- Donald Knuth

--6c2NcOVqGQ03X4Wi
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (NetBSD)

iD8DBQFCHbLoLg33BXzVMqsRAqnzAJ4txAjGF/ngcq6YltgMHxoo76YM+QCeIxIW
0vqvABSCAvK+7zkk5a6mbMU=
=YCJU
-----END PGP SIGNATURE-----

--6c2NcOVqGQ03X4Wi--