Attached a USB device and have a question!

Hello everyone!

Totally new to FreeBSD and I have a question.

I attached a hydrabus that I usually connect to with picocom on other systems. I ran dmesg to get the TTY it was running on so I could connect. dmesg said it was at usbus0. I looked in /dev and didn't see usbus0. In order to compare the /dev directory I ran a ls with the device attached and not attached and piped the output of each to different files. I diffed the files and noticed there were a few differences most notably a ttyU0. I gave it a go and was able to connect!

My question is why was the tty different than what dmesg said. Again I'm totally new to FreeBSD(just got it installed today!) and I assume there is something I'm not understanding about how FreeBSD works.

Here is a few screen shots. I hope they look ok. Still testing things out!
 

Attachments

  • dmesg.png
    dmesg.png
    45.9 KB · Views: 26
  • diff.png
    diff.png
    11.8 KB · Views: 24
  • picocom.png
    picocom.png
    16 KB · Views: 23
USB is complicated (as are most other interfaces). Internally in the computer, there are likely a variety of USB interfaces, which then have layers. The FreeBSD host knows all of those, and gives them names. But you can't talk to an interface, only to a device plugged into an interface. The fact that "the USB hole at the top left of my laptop, which has a USB hub plugged into it, and then the 3rd USB port from the top of that hub" has a name which is visible in places like dmesg or the output of usbconfig doesn't mean that it deserves a /dev/ entry for a device that one can do something with.

So there is a whole hierarchy of usbus and ugen entries that are visible in dmesg but don't show up in /dev/. I just looked on my server, and there are three USB things attached: A keyboard (shows up as /dev/uhid0), a modem (shows up as /dev/ttyU0), and a hard disk (shows up as /dev/da0, all other disks are /dev/adaX). To be honest, I can't remember how to exactly map from ugen8.2 to /dev/ttyU0 and back; the output from the usbconfig utility shows an enormous amount of information, but not the mapping to the device entry that is created, nor does dmesg.
 
Great information in your response! I have learned a lot of new things by your response after some good research.

1: ugen is like a generic USB driver if there is no special driver for the USB device.
2: Not all devices deserve a entry in /dev/(if Im understanding correctly).
3: The basics of usbconfig and how to use it.
4: Each USB controller gets assigned a name like usbus0.
5: There is a naming convention for /dev/ devices.

Good stuff! Thanks again for the reply. I learned a lot.
 
Back
Top