Supporting USB in a Microkernel Framework Alexander Aring, Timon - - PowerPoint PPT Presentation

supporting usb in a microkernel framework
SMART_READER_LITE
LIVE PREVIEW

Supporting USB in a Microkernel Framework Alexander Aring, Timon - - PowerPoint PPT Presentation

Supporting USB in a Microkernel Framework Alexander Aring, Timon Link 13. February 2014 Alexander Aring, Timon Link 13. February 2014 1 / 18 Ubersicht Universal Serial Bus 1 Introduction Basics Device Device-Classes Descriptors


slide-1
SLIDE 1

Supporting USB in a Microkernel Framework

Alexander Aring, Timon Link

  • 13. February 2014

Alexander Aring, Timon Link

  • 13. February 2014

1 / 18

slide-2
SLIDE 2

¨ Ubersicht

1

Universal Serial Bus Introduction Basics Device Device-Classes Descriptors Transfer-Types Host-Controller

2

HelenOS Introduction Requirements Device Driver Framework USB drivers Devicetree Hotplugging Example

Alexander Aring, Timon Link

  • 13. February 2014

2 / 18

slide-3
SLIDE 3

Bus-System: Introduction

Bus

Bus Binary Unit System Serial Serial communication Parallel Parallel communication Kinds Memorybus, Peripheralbus, Fieldbus, ...

Examples

USB Universal Serial Bus: Peripheralbus I2C Two-Wire: Peripheralbus CAN Controller Area Network: Fieldbus PROFIBUS Process Field Bus: Fieldbus

Alexander Aring, Timon Link

  • 13. February 2014

3 / 18

slide-4
SLIDE 4

Universal Serial Bus: Basics

USB Specifications

USB 1.x Published 1996 USB 2.0 Published 2000 USB 3.0 Published 2008

Characteristics

Master/Slave Mechanism Hotplugging Feature Different USB-Connectors Differential Voltage Connection (Twisted-Pair)

Alexander Aring, Timon Link

  • 13. February 2014

4 / 18

slide-5
SLIDE 5

Universal Serial Bus: Device

Device

Contains a unique ID VID Vendor-ID PID Product-ID

Alexander Aring, Timon Link

  • 13. February 2014

5 / 18

slide-6
SLIDE 6

Universal Serial Bus: Device-Classes

Device-Classes

HID Human Interface Device-Class MSC Mass Storage Device-Class UVC USB Video Class Printer Printer Device-Class ... There are more in the USB Specification

Each Device-Class has an generic Interface

Alexander Aring, Timon Link

  • 13. February 2014

6 / 18

slide-7
SLIDE 7

Universal Serial Bus: Descriptors

Descriptor-Tables

Information about a USB-Device Placed inside the USB-Device Firmware

Kinds of Descriptors

Device General Information like VID and PID Configuration Configuration of the Device Interface Interface for Endpoints Endpoint Channel for communication

Alexander Aring, Timon Link

  • 13. February 2014

7 / 18

slide-8
SLIDE 8

Universal Serial Bus: Transfer-Types

USB Transfer Types

Control Configuration/Status Requests Bulk Huge payload data Isochronous Huge payload with guarantee of bandwidth Interrupt Small Message: Polling

Examples

Control Every USB Device (Endpoint 0) Bulk Mass Storage Isochronous Video Class Interrupt Human Interface Devices

Alexander Aring, Timon Link

  • 13. February 2014

8 / 18

slide-9
SLIDE 9

Universal Serial Bus: Host-Controller

USB Device Driver

Device specific

USB Stack

USB Software Handling

USB Host Controller

Electrical Chip Offers Interface (UHCI) Connected to all Devices

Figure : Host Composition.

Alexander Aring, Timon Link

  • 13. February 2014

9 / 18

slide-10
SLIDE 10

HelenOS outline

1 Introduction 2 Requirements 3 Device Driver Framework 4 USB drivers 5 Devicetree 6 Hotplugging Example Alexander Aring, Timon Link

  • 13. February 2014

10 / 18

slide-11
SLIDE 11

Introduction

microkernel based OS compatible with big- and little-endian, 32 and 64 bit runs on most common platforms, e.g. AMD64/EM64T, ARM, IA-32, IA-64, MIPS, 32-bit PowerPC, SPARC V9

  • ffers services: file system, networking, device drivers and user

interface

important

HelenOS supports USB 1.1 for mice an keyboards.

Alexander Aring, Timon Link

  • 13. February 2014

11 / 18

slide-12
SLIDE 12

Requirements

1 drivers for host controllers 2 drivers for USB devices 3 starting device driver on hotplugging 4 interaction with client-applications and drivers 5 communication between drivers

Device Driver Framework (DDF)

HelenOS’ DDF offers solution for requirements 3,4,5

Alexander Aring, Timon Link

  • 13. February 2014

12 / 18

slide-13
SLIDE 13

Device Driver Framework (DDF)

drivers → tasks in userspace communication between tasks using IPC (async) DDF consists of two parts:

◮ device manager service devman ◮ libdrv - used by drivers

client applications interact through driver interfaces with devices interfaces are sets of callback functions the driver must implement

Alexander Aring, Timon Link

  • 13. February 2014

13 / 18

slide-14
SLIDE 14

DDF Workflow

DDF workflow

1 bus driver generates match ID for each detected device, e.g.

pci/ven=106b&dev=003f

2 match IDs are sent to the devman 3 devman iterates a list with all known drivers and chooses the most

suitable one

4 devman starts the chosen driver, or sends a message if it’s already

started

5 the driver invokes a callback function from libdrv defined by author ◮ in this function the device will be initialized ◮ on success the driver informs devman Alexander Aring, Timon Link

  • 13. February 2014

14 / 18

slide-15
SLIDE 15

USB drivers

important notice: DDF allows splitting drivers in several parts UHCI and OHCI are implemented as one Driver split in two tasks UHCI and OHCI are strictly coupled cooperation of multiple drivers leads to MID

◮ MIDs offer several interfaces to access the device, e.g. digital cameras ◮ special vendor driver ◮ fallback driver, e.g. mass storage Alexander Aring, Timon Link

  • 13. February 2014

15 / 18

slide-16
SLIDE 16

Devicetree

Figure : example of a possible USB devicetree

Alexander Aring, Timon Link

  • 13. February 2014

16 / 18

slide-17
SLIDE 17

Hotplugging example

Figure : Hotplugging and registration

Alexander Aring, Timon Link

  • 13. February 2014

17 / 18

slide-18
SLIDE 18

Questions

Many Thanks for your attention.

Questions

Any questions? alexander.aring@student.hs-rm.de timon.b.link@student.hs-rm.de

Alexander Aring, Timon Link

  • 13. February 2014

18 / 18