From owner-cvs-sys Sun Oct 27 00:29:29 1996 Return-Path: owner-cvs-sys Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id AAA12755 for cvs-sys-outgoing; Sun, 27 Oct 1996 00:29:29 -0700 (PDT) Received: from grumble.grondar.za (root@grumble.grondar.za [196.7.18.130]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id AAA12746; Sun, 27 Oct 1996 00:29:19 -0700 (PDT) Received: from grumble.grondar.za (mark@localhost.grondar.za [127.0.0.1]) by grumble.grondar.za (8.8.2/8.7.3) with ESMTP id JAA14467; Sun, 27 Oct 1996 09:28:24 +0200 (SAT) Message-Id: <199610270728.JAA14467@grumble.grondar.za> To: Bruce Evans cc: mark@grondar.za, sos@freefall.freebsd.org, cvs-all@freefall.freebsd.org, CVS-committers@freefall.freebsd.org, cvs-sys@freefall.freebsd.org Subject: Re: cvs commit: src/sys/i386/isa syscons.c Date: Sun, 27 Oct 1996 09:28:24 +0200 From: Mark Murray Sender: owner-cvs-sys@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Bruce Evans wrote: > >If this was fixed, could this be added back to syscons? > > No. Console i/o routines should have as few side effects as possible, > because they might be being used to debug things that would be corrupted > by the side effects. Fair enough. However - keyboards are a great swource of randomness. It is easy enough to hook the keyboard interrupt (irq1), but to hook the keystroke as well would be nice. Any ideas there? Also the new code (from the latest Linux kernel) has mouse randomness as well. My original idea was to hook the mouse driver in syscons as well. Any ideas there? > There seems to be a more serious problem with reentrancy in > add_timer_randomness(). It is called from interrupt handlers at the > ipls of the handlers, so it may be reentered. It doesn't seem to be > designed for this. I guess it works in Linux because it is always > called with interrupts disabled. It should use splhigh() in FreeBSD. > (Don't forget the design goal that interrupts should not be masked for > too long. 20 usec is too long.) Since it is normally (*) called from > the keyboard interrupt handler at ipl >= tty_imask, it is now only safe > to gather entropy for interrupts generated by tty-class devices. Oh, boy - now I show my kernel ignorance. Do you have any example code to show this? Also - I am massaging a later version for inclusion. I remember (and can now see with the PC98) that the current placement is no good. Where is a better place to put this? M -- Mark Murray 46 Harvey Rd, Claremont, Cape Town 7700, South Africa +27 21 61-3768 GMT+0200 Finger mark@grondar.za for PGP key