No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Latest commit b71eb4f Jan 4, 2018
Permalink
Failed to load latest commit information.
pcie_uio @ 4400d42 move files to pcie_uio Jan 4, 2018
.gitmodules move files to pcie_uio Jan 4, 2018
Makefile move files to pcie_uio Jan 4, 2018
README.md fix README Dec 9, 2017
hub.cc first commit Nov 14, 2017
hub.h first commit Nov 14, 2017
keyboard.cc first commit Nov 14, 2017
keyboard.h first commit Nov 14, 2017
main.cc first commit Nov 14, 2017
ringbuffer.h first commit Nov 14, 2017
usb.cc first commit Nov 14, 2017
usb.h first commit Nov 14, 2017
xhci.cc first commit Nov 14, 2017
xhci.h first commit Nov 14, 2017

README.md

xhci_uio

Simple implementation of xHCI (USB3.0 Host Controller) Linux usermode driver (and keyboard driver for demo)

HOWTO

!! You should use SSH. !!

setup environment

This script downloads linux kernel source and builds uio kernel module. It will work on Ubuntu 14.04 or later.

$ wget https://raw.githubusercontent.com/PFLab-OS/Raph_Kernel_devenv_box/master/uio.sh
$ chmod +x uio.sh
$ ./uio.sh

Identify vendor ID and bus number

$ lspci | grep xHCI
00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31)

In this case, bus id of xHCI is 00:14.0.

awamoto@ubuntu:~$ lspci -n
00:02.0 0380: 8086:191d (rev 06)
00:14.0 0c03: 8086:a12f (rev 31)
00:14.2 1180: 8086:a131 (rev 31)
00:16.0 0780: 8086:a13a (rev 31)

You now know the vendor ID is 8086:a12f. (See the entry of 00:14.0)

Edit the Makefile.

load:
	sudo modprobe uio_pci_generic
	sudo sh -c "echo '8086 a12f' > /sys/bus/pci/drivers/uio_pci_generic/new_id"   <-- vendor ID
	sudo sh -c "echo -n 0000:00:14.0 > /sys/bus/pci/drivers/xhci_hcd/unbind"      <-- bus ID
	sudo sh -c "echo -n 0000:00:14.0 > /sys/bus/pci/drivers/uio_pci_generic/bind" <-- bus ID

Complie and Run.

$ make load
$ make run

Enjoy!

image

Future Work

  • Bulk / Isoch Transfers
  • Segmented Rings
  • Multi Interrupters