Subject: Re: printf in drivers?
To: None <>
From: Hubert Feyrer <>
List: tech-kern
Date: 06/23/1999 12:58:28
On Tue, 22 Jun 1999 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?

Sure printf() is ok, just look at the existing code.

As an unrelated(?) note, I bought a Logitech wireless keyboard & mouse
yesterday, and the mouse has two buttons and a wheel. XFree on my shark
hat no problem using the wheel as middle mouse button, so maybe you
shouldn't have too much problem with your wheel as such either. 
Assuming the converter works as expected.

 - Hubert

NetBSD - Better for your uptime than Viagra