Pow, Christopher (SWCOE | 26 Aug 2011 15:49
Picon
Favicon

Porting USB stack -- questions on ioconf.c

I am porting the USB stack of NetBSD to a different OS/platform and have some questions regarding the
content of ioconf.c.  I am expecting to support mass storage, keyboard, mouse (generic HID).  I have
the stack up and running except for being able to unplug and re-plug devices.

For example, when I plug in a keyboard, I get:

Found uhidev0 and uhub0  port 2 configuration 1 interface 0
Dell Dell QuietKey Keyboard, rev 1.10/1.55, addr 2, iclass 3/1
Found uhid0 at uhidev0
: input=8, output=1,feature=0

Then when I un-plug it:

detached
detached
uhidev0: at uhub0 port 2 (addr 2) disconnected

Then when I plug it back in:

Found ugen0 at uhub0  port 2
Dell Dell QuietKey Keyboard, rev 1.10/1.55, addr 2, iclass 3/1

I had to hack together ioconf.c to get this far...so I'm *sure* my ioconf.c is a total mess.  However I've
been unable to find anything resembling useful-including searching through the code for "config"-to
help figure out what I need to have in ioconf.c.  

Hopefully someone out there can give me some pointers as to how the tables in ioconf.c relate and how they
should be set up differently than what I've got...?

Here's my ioconf.c:
(Continue reading)

Hubert Feyrer | 26 Aug 2011 22:18
Picon
Favicon

Re: Porting USB stack -- questions on ioconf.c


On Fri, 26 Aug 2011, Pow, Christopher (SWCOE) wrote:
> Hopefully someone out there can give me some pointers as to how the 
> tables in ioconf.c relate and how they should be set up differently than 
> what I've got...?

I can't, but maybe a few hints:
  * ioconf.c is created by running "config KERNELNAME" in NetBSD,
    and it's created in the kernel compile directory (besides ioconf.h)
  * from that, digging into the config(8) program may help
  * also, NetBSD's autoconf system may be useful - see
    http://www.netbsd.org/docs/kernel/programming.html#autoconf and
    http://nixdoc.net/man-pages/NetBSD/autoconf.9.html for a start.
  * Other documentation that may be useful if you haven't found it
    already:
     - http://www.netbsd.org/docs/kernel/ddwg.html
     - http://www.netbsd.org/docs/kernel/pseudo/
     - http://www.netbsd.org/docs/internals/en/

Good luck!

  - Hubert

P.S.: What OS are you porting the USB stack to?

Pow, Christopher (SWCOE | 26 Aug 2011 22:24
Picon
Favicon

RE: Porting USB stack -- questions on ioconf.c

Hello Hubert, I've actually solved the problem today working with Jared
McNeill from this list.  It turns out the implementation of malloc() in
my code did not honor the M_ZERO flag, didn't fill the allocated block
with zeros, and thus caused quite a bit of downstream-from-malloc
confusion.

Thanks for your response, though!  I will be sure and post more
questions as I continue on this porting adventure.  I'm sure there's
more crocodiles in the pond.  

As for the operating system I'm porting to:
http://www.ddci.com/products_deos.php

-----Original Message-----
From: Hubert Feyrer [mailto:hubert <at> feyrer.de] 
Sent: Friday, August 26, 2011 3:18 PM
To: Pow, Christopher (SWCOE)
Cc: netbsd-ports <at> NetBSD.org
Subject: Re: Porting USB stack -- questions on ioconf.c

On Fri, 26 Aug 2011, Pow, Christopher (SWCOE) wrote:
> Hopefully someone out there can give me some pointers as to how the 
> tables in ioconf.c relate and how they should be set up differently
than 
> what I've got...?

I can't, but maybe a few hints:
  * ioconf.c is created by running "config KERNELNAME" in NetBSD,
    and it's created in the kernel compile directory (besides ioconf.h)
  * from that, digging into the config(8) program may help
(Continue reading)


Gmane