Subject: Re: printf in drivers?
To: None <mcmahill@mtl.mit.edu>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-kern
Date: 06/22/1999 06:59:31
On Tue, 22 Jun 1999 09:55:36 -0400 (EDT) 
 mcmahill@mtl.mit.edu wrote:

 > I have a simple question.  I'm brand new to trying to make any kernel
 > source changes.  I'm looking at /usr/src/sys/dev/sun/ms.c which appears to
 > be the mouse driver for my sparc.  I have a wheel mouse attached to the
 > machine (via a PS/2 <=> SUN converter box) and I'm interested in having
 > the driver print the raw data to the screen as it comes in.  That way I
 > can see what codes come from the mouse (if any, don't know if the
 > converter box lets it through) when the mouse wheel is moved.  Then I can
 > figure out how to handle the wheel.  Can I just use printf in a driver
 > like that?  Or is there a problem with printf not knowing where stdout is?
 > Is there a better way of getting info like that?

You can certainly printf() in a driver like that.  The kernel printf
doens't really have any notion of stdout :-)  It just all goes to the
console.

        -- Jason R. Thorpe <thorpej@nas.nasa.gov>