We are using the driver portability layer called Device Driver Environment kit to provide support for USB host on the MINIX 3 operating system. The Device Driver Environment was developed for reuse of legacy device drivers. It defines an operating system agnostic kernel application programming interface (API) and provides Linux 2.6.29 based legacy drivers for supporting USB-host among other things. DDE with USB host support has been ported to MINIX 3 by Dirk Vogd.
DDEKIT provides a BSD licensed abstraction layer for driver development. This abstraction, defined in includes files, defines the following primitives: data types, memory allocation, paging, threading, semaphores, timers, low level hardware I/O, requesting interrupts and dma access. It is located inside the MINIX3 source tree at /usr/src/minix/include/ddekit and implemented in /usr/src/minix/lib/libddekit.
The dde-linux26 is a GPLv2 package that uses ddekit host Linux device drivers. Using ddekit it replaces key parts of the Linux device driver model to be able to run drivers on a non Linux kernel. It contains large parts of the Linux 2.6.29 source code in the contrib directory and provide abstractions for a the following type of drivers: common, block, common, net, partitions, scsi and usb. This code only depends on ddekit and is not MINIX 3 specific.
The Dde-linux26-usb-drivers use dde-linux26 to implement an USB stack for MINIX.
The USB host controller driver is a MINIX 3 service that talks to the USB host controller hardware using established standards like EHCI and OHCI and mediates access to USB devices by implementing a virtual host controller driver.
UsbStubDriver::
For new device notification
UsbHostControllerDriver::
MINIX bus driver implementation using usbcore
USBCORE::
Linux library to implement host controllers
EHCI::
Standard way of talking to the usb host controller
DDELinux::
the support library for things like platform_device creation
The USB drivers in MINIX3 will communicates with USB devices host controller over a virtual host controller interface provided by USBD. The class drivers uses the DDE kit and Linux drivers like SCSI to implement Their service.
UsbClassStorage::
implements a minix interface like block device
DDE helpers::
helpers like the SCSI lib part in case of the USB mass storage class
VHCI::
Virtual host controller as also used to provide usb over ethernet. This driver talks to USBD using grants and messages.
Devman is a device manager who's main goal is to enable hot-plugging of hardware. Based on events from USBD and a configuration file it will create device nodes and start or stop USB class drivers.
There are two parts to devman. One is a MINIX3 service and the second one is a userland daemon.
The initialization is as follow
The shutdown sequence is the following
The device manager is located in the MINIX 3 sources but the remaining components are lotacted outside of this source tree and are referred from the pkgsrc tree. To get the code working go to /usr/pkgsrc/minix/dde-linux26-usb-drivers run bmake install and reboot. To develop we suggest your first run bmake install and after that run bmake build-env in either the dde-linux26-usb-drivers or dde-linux26 directory. running “bmake && bmake install” after that will directly install the libraries in the correct location. The code for dde-linux26 and dde-linux26-usb-driver is hosted on git.minix3.org
To perform an update of the code you need to do a few things: