English Chinese (Traditional) (zh_TW)
Part III. System Administration
Chapter 26. USB Device Mode / USB OTG
USB Device Mode / USB OTG
How to set up USB Device Mode functionality on FreeBSD.
How to configure the virtual serial port on FreeBSD.
How to connect to the virtual serial port from various operating systems.
How to configure FreeBSD to provide a virtual USB network interface.
How to configure FreeBSD to provide a virtual USB storage device.
USB Virtual Serial Ports
To enable USB device mode serial ports, add those lines to [.filename]#/etc/ttys#:
ttyU0 "/usr/libexec/getty 3wire" vt100 onifconsole secure
ttyU1 "/usr/libexec/getty 3wire" vt100 onifconsole secure
Then add these lines to [.filename]#/etc/devd.conf#:
notify 100 {
match "system" "DEVFS";
match "subsystem" "CDEV";
match "type" "CREATE";
match "cdev" "ttyU[0-9]+";
action "/sbin/init q";
Reload the configuration if man:devd[8] is already running:
# service devd restart
Make sure the necessary modules are loaded and the correct template is set at boot by adding those lines to [.filename]#/boot/loader.conf#, creating it if it does not already exist:
To load the module and set the template without rebooting use:
# kldload umodem
# sysctl hw.usb.template=3
# cu -l /dev/ttyU0