Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Tasks USB Serial Adapter driver
Clone this wiki locally
Status: Completed (For FTDI). Available at OptionRomPkg/Bus/Usb/FtdiUsbSerialDxe.
Develop a USB driver for a common USB Serial Adapter.
- Difficulty: Medium
- Language: C
- Suggested by:
Table of Contents
Today there are many inexpensive USB Serial adapters available, and most systems are built with USB ports available. But at the same time, the dedicated Serial port is becoming less common to find available in a system.
A serial port can still be useful for software debugging purposes. (debug trace messages)
It can also be useful in providing a secondary terminal to the UEFI system.
This task would involve writing a USB driver which interfaces with a USB Serial Adapter.
Ideally, this project should enable a driver that will attach to the USB Serial Adapter and produce the SerialIo protocol to enable the UEFI terminal to become available through the USB Serial adapter.
The MdeModulePkg/Bus/Usb/UsbKbDxe (USB Keyboard) driver may provide a useful starting point for your project.
Building: This project can be completed on any edk2 supported OS or toolchain.
With QEMU you can use the '-usb -usbdevice serial::vc' parameters to add an emulated FTDI into the system.
Support for the FTDI device was worked on during GSoC2012. The latest code is currently available at:
- Look for the driver code under OptionRomPkg/Bus/Usb/FtdiUsbSerialDxe
$ OvmfPkg/build.sh $ OvmfPkg/build.sh qemu -usb -usbdevice serial::vcOnce QEMU/OVMF starts, press Control+Alt+5 to see the 'usbserial' output.
OVMF (on Linux) would probably provide the easiest environment for testing your project with real hardware. You should be able to build your driver into OVMF and then run OVMF with the USB adapter being mapped inside the virtual machine environment. If you utilize OVMF for testing, then documenting the procedure for running OVMF to attach to the USB device would be a useful 'extra' side-project.
You could also test your driver on another UEFI system by using the EFI shell 'load' command.
Some possible sub-goals for the driver
- Optional: If using OVMF for testing, document the environment and commands you use to enable the adapter to show up in the VM
- recognize and attach to the adapter
- configure the serial port settings for the adapter
- send test characters out the adapter which are successfully read on the other side of the serial cable
- receive some test characters, and print them out in debug trace messages
- connect to SerialIo to enable a full terminal console
There are many USB Serial adapters available. Some examples are listed here, but no specific adapter is required or recommended for this project.
- The QEMU virutal machine environment emulates an FTDI based device (see more details above!)
- Keyspan USA-19HS
- Belkin USB to Serial adapter
- CablesToGo USB to DB9 Serial Adapter
- IOGEAR USB to Serial RS-232 Adapter
This project would be for an edk2 based driver, so please discuss the project on edk2-devel.