9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] USB CDRW
@ 2001-10-03 12:29 Sape Mullender
  0 siblings, 0 replies; 7+ messages in thread
From: Sape Mullender @ 2001-10-03 12:29 UTC (permalink / raw)
  To: 9fans

> What is the status of USB support in Plan9...

We have a USB driver (which I'll make available as soon as I've cleaned
up the code, maybe in a few weeks).  Forsyth wrote the initial driver
and I've modified it extensively.

The current driver deals with hubs, mice, a joystick, one camera, printers
and most audio devices.

Adding simple devices such as keyboards is trivial.  All you have to
do is read and interpret the data stream and this is staightforward.

Adding complex devices, such as disks, cameras, network interfaces
and the like is much more complicated because they require many
message interchanges before they will do what they are supposed to do.

When I wrote the audio driver, for example, I had to write code to understand
all of the `configuration' messages from the device that tell the driver what the
audio device can do (can it do output?  input?  does it have volume control?
if yes, what's the max, what's the min?  what sample rates are supported?
what sample sizes?  how many channels? the list is endless).  The audio devices
I've seen adhere to the USB audio standard (you can find it on usb.org), but I
know that audio devices exist that do not conform to this standard (iMic for one).

Dhog has played with cameras.  He told me he found only one that obeys the USB
standard fro cameras.  For every other camera you're on your own trying to find out
what to send to the device to make it tick (or click).

The USB system for Plan 9 consists of a driver that only knows how to send and receive
USB data packets.  Packets are sent on `end points', think of them as USB device addresses.
Some devices have multiple addresses (e.g., one for audio data, one for audio control, and
one for buttons on the device).  The kernel makes them avalable as files of the form
/dev/usb/3/ep2data (endpoint 2 for device number 3).  The kernel does not
understand devices.  There is a usb daemon (usbd) which runs as a user program
that reads and interprets descriptors from the connected devices, finds out what they
are and tells the kernel to configure the appropriate endpoints and make the epndata
files.  Usbd understands and configures hubs, but no other devices.

Programs such as usbmouse and usbaudio will look among the device codes to find
mice or audio devices.  They will then configure these just like usbd configures hubs.
usbmouse takes mouse events and sends them to #m/mousein whete the system
mixes them with mouse events from the regular mouse. Usbaudio configures the audio
device and implements a file system with /dev/audio and /dev/volume making it look
like a sound blaster.

Printers are simple.  The end point must be configured and it can then be written just like
/dev/lpt0.  There's a program which finds a printer and binds its endpoint to /n/lp.
Print to that instead of /dev/lpt0.

Now that we finally understand how USB works in all of its rather unglorious detail,
dhog and I want to rewrite the thing.  It's become kind of ugly.  Be patient for another
week or two and we'll send out our driver.

	Sape



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] USB CDRW
@ 2001-10-03 14:08 jmk
  0 siblings, 0 replies; 7+ messages in thread
From: jmk @ 2001-10-03 14:08 UTC (permalink / raw)
  To: 9fans


On Wed Oct  3 08:19:20 EDT 2001, boyd@fr.inter.net wrote:
> i _might_ look at USB.
> 

It's taken me 2 hours to coax my mailbox out of the fetal position.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] USB CDRW
@ 2001-10-03 13:53 rob pike
  0 siblings, 0 replies; 7+ messages in thread
From: rob pike @ 2001-10-03 13:53 UTC (permalink / raw)
  To: 9fans

Boyd:
> i _might_ look at USB.

I'll alert the media.

-rob



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] USB CDRW
@ 2001-10-03 12:27 Sape Mullender
  0 siblings, 0 replies; 7+ messages in thread
From: Sape Mullender @ 2001-10-03 12:27 UTC (permalink / raw)
  To: 9fans

> What is the status of USB support in Plan9...

We have a USB driver (which I'll make available as soon as I've cleaned
up the code, maybe in a few weeks).  Forsyth wrote the initial driver
and I've modified it extensively.

The current driver deals with hubs, mice, a joystick, one camera, printers
and most audio devices.

Adding simple devices such as keyboards is trivial.  All you have to
do is read and interpret the data stream and this is staightforward.

Adding complex devices, such as disks, cameras, network interfaces
and the like is much more complicated because they require many
message interchanges before they will do what they are supposed to do.

When I wrote the audio driver, for example, I had to write code to understand
all of the `configuration' messages from the device that tell the driver what the
audio device can do (can it do output?  input?  does it have volume control?
if yes, what's the max, what's the min?  what sample rates are supported?
what sample sizes?  how many channels? the list is endless).  The audio devices
I've seen adhere to the USB audio standard (you can find it on usb.org), but I
know that audio devices exist that do not conform to this standard (iMic for one).

Dhog has played with cameras.  He told me he found only one that obeys the USB
standard fro cameras.  For every other camera you're on your own trying to find out
what to send to the device to make it tick (or click).

The USB system for Plan 9 consists of a driver that only knows how to send and receive
USB data packets.  Packets are sent on `end points', think of them as USB device addresses.
Some devices have multiple addresses (e.g., one for audio data, one for audio control, and
one for buttons on the device).  The kernel makes them avalable as files of the form
/dev/usb/3/ep2data (endpoint 2 for device number 3).  The kernel does not
understand devices.  There is a usb daemon (usbd) which runs as a user program
that reads and interprets descriptors from the connected devices, finds out what they
are and tells the kernel to configure the appropriate endpoints and make the epndata
files.  Usbd understands and configures hubs, but no other devices.

Programs such as usbmouse and usbaudio will look among the device codes to find
mice or audio devices.  They will then configure these just like usbd configures hubs.
usbmouse takes mouse events and sends them to #m/mousein whete the system
mixes them with mouse events from the regular mouse. Usbaudio configures the audio
device and implements a file system with /dev/audio and /dev/volume making it look
like a sound blaster.

Now that we finally understand how USB works in all of its rather unglorious detail,
dhog and I want to rewrite the thing.  It's become kind of ugly.  Be patient for another
week or tow and we'll send out our driver.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] USB CDRW
@ 2001-10-03 12:15 forsyth
  2001-10-03 12:15 ` Boyd Roberts
  0 siblings, 1 reply; 7+ messages in thread
From: forsyth @ 2001-10-03 12:15 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

is the usb cdrw device guaranteed to adhere to a standard?
i'd have thought the link speed would anyway be rather slow,
and i'd have gone for an ide/scsi link myself.

usb drivers that do non-trivial things are non-trivial.
the plan 9 device driver interface is the least of your problems.
my driver has bounced back and forth between plan9
and inferno, and with contributions from a handful
of others has gradually become sufficiently useful
that worth revamping it.


[-- Attachment #2: Type: message/rfc822, Size: 2395 bytes --]

To: 9fans@cse.psu.edu
Subject: [9fans] USB CDRW
Date: Wed, 03 Oct 2001 12:32:44 +0100
Message-ID: <1918726281@snellwilcox.com>

Hi,

What is the status of USB support in Plan9...

What I'am really asking is If I bought a USB CDRW drive and used it with NT for
now
would I be able to use it with Plan9 in the forseeable future?

I know I could write a driver but I am still on the flat part of the learning
curve WRT
both the Plan9 kernel and USB, and still too busy with work to do anything about
it.

-Steve
 
   
----------------------------------------------------------------------
The contents of this communication are confidential to the normal user of
the email address to which it was sent.  If you have received this email
in error, any use, dissemination, forwarding, printing or copying of this
email is strictly prohibited.  If this is the case, please notify the
sender and delete this message.
----------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [9fans] USB CDRW
  2001-10-03 12:15 forsyth
@ 2001-10-03 12:15 ` Boyd Roberts
  0 siblings, 0 replies; 7+ messages in thread
From: Boyd Roberts @ 2001-10-03 12:15 UTC (permalink / raw)
  To: 9fans

i _might_ look at USB.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* [9fans] USB CDRW
@ 2001-10-03 11:32 steve.simon
  0 siblings, 0 replies; 7+ messages in thread
From: steve.simon @ 2001-10-03 11:32 UTC (permalink / raw)
  To: 9fans

Hi,

What is the status of USB support in Plan9...

What I'am really asking is If I bought a USB CDRW drive and used it with NT for
now
would I be able to use it with Plan9 in the forseeable future?

I know I could write a driver but I am still on the flat part of the learning
curve WRT
both the Plan9 kernel and USB, and still too busy with work to do anything about
it.

-Steve
 
   
----------------------------------------------------------------------
The contents of this communication are confidential to the normal user of
the email address to which it was sent.  If you have received this email
in error, any use, dissemination, forwarding, printing or copying of this
email is strictly prohibited.  If this is the case, please notify the
sender and delete this message.
----------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-10-03 14:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-03 12:29 [9fans] USB CDRW Sape Mullender
  -- strict thread matches above, loose matches on Subject: below --
2001-10-03 14:08 jmk
2001-10-03 13:53 rob pike
2001-10-03 12:27 Sape Mullender
2001-10-03 12:15 forsyth
2001-10-03 12:15 ` Boyd Roberts
2001-10-03 11:32 steve.simon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).