Some Experience A bout μ kernel and Device Driver

45
Some Experience About μkernel and Device Driver 970529 Sean Lin

description

Some Experience A bout μ kernel and Device Driver. 970529 Sean Lin. Outline. Introduction of μ kernel Introduction of L4 μ kernel Family Something Interesting in L4 μ kernel Introduction of T he Platform The Bug of USB Host Device Driver Other Experiences of Driver Debugging. - PowerPoint PPT Presentation

Transcript of Some Experience A bout μ kernel and Device Driver

Page 1: Some Experience  A bout  μ kernel and Device Driver

Some Experience About μkernel and Device Driver970529 Sean Lin

Page 2: Some Experience  A bout  μ kernel and Device Driver

Outline

Introduction of μkernel Introduction of L4 μkernel Family Something Interesting in L4 μkernel Introduction of The Platform The Bug of USB Host Device Driver Other Experiences of Driver Debugging

Page 3: Some Experience  A bout  μ kernel and Device Driver

Outline

Introduction of μkernel Introduction of L4 μkernel Family Something Interesting in L4 μkernel Introduction of The Platform The Bug of USB Host Device Driver Other Experiences of Driver Debugging

Page 4: Some Experience  A bout  μ kernel and Device Driver

Monolithic Kernel

Kernel has access to all things All optimizations possible All techniques/mechanisms implementable

Kernel can be extended To add more code to the kernel

Page 5: Some Experience  A bout  μ kernel and Device Driver

Why Microkernel(μkernel)

Cost of monolithic kernel Complexity Growing size Limited maintainability

Page 6: Some Experience  A bout  μ kernel and Device Driver

The Idea of Microkernel

Provide core functionality Applications communicate via message-

passing IPC

Page 7: Some Experience  A bout  μ kernel and Device Driver

Outline

Introduction of μkernel Introduction of L4 μkernel Family Something Interesting in L4 μkernel Introduction of The Platform The Bug of USB Host Device Driver Other Experiences of Driver Debugging

Page 8: Some Experience  A bout  μ kernel and Device Driver

History of Microkernel

1st generation μkernel Mach Chorus Amoeba L3

Page 9: Some Experience  A bout  μ kernel and Device Driver

History of Microkernel (cont.)

2nd generation μkernel Spin (University of Washington) Exo-kernel (MIT) L4

Page 10: Some Experience  A bout  μ kernel and Device Driver

Comparison

1st generation μkernel were slow Complex API Poor design and implementation Too many features Slow and inflexible IPC

Page 11: Some Experience  A bout  μ kernel and Device Driver

L4 Microkernel Family

A family of second-generation microkernel There have been various re-implementations

of the original L4 kernel interface(ABI) Original version by Jochen Liedtke

Page 12: Some Experience  A bout  μ kernel and Device Driver

Introduction of L4 Microkernel

The L4 kernel API has evolved in numerous ways Version 2 Version X.0 Version X.2 NICTA N

Page 13: Some Experience  A bout  μ kernel and Device Driver

Design Issue of L4

Abstractions Address spaces Threads

Mechanisms Inter-process communication (IPC) Mapping

Page 14: Some Experience  A bout  μ kernel and Device Driver

Outline

Introduction of μkernel Introduction of L4 μkernel Family Something Interesting in L4 μkernel Introduction of The Platform The Bug of USB Host Device Driver Other Experiences of Driver Debugging

Page 15: Some Experience  A bout  μ kernel and Device Driver

Famous L4 μkernel

Fiasco Design by TU Dresden Preemptible real-time kernel Used for DROPS project GPL LicenseLast release: March 2007, Fiasco 1.2http://os.inf.tu-dresden.de/drops/

Page 16: Some Experience  A bout  μ kernel and Device Driver

DROPS

Dresden Real-Time Operating Systems Project Find design techniques for the construction of

distributed real time operating systems Every component guarantees a certain level of service to

applications.

Page 17: Some Experience  A bout  μ kernel and Device Driver

DROPS (cont.)

Multiple instances of Linux running on one machine

Page 18: Some Experience  A bout  μ kernel and Device Driver

Famous L4 μkernel (cont.)

L4Ka::Pistachio Design by L4Ka team and NICTA EROPS

Group L4 API V X.2

Last release: June 2004, Pistachio 0.4http://l4ka.org/projects/pistachio/

Page 19: Some Experience  A bout  μ kernel and Device Driver

Famous L4 μkernel (cont.)

NICTA::Pistachio-embedded Design by UNSW and NICTA EROPS Group based on L4Ka::Pistachio, designed for

embedded systems keep almost all system calls shortLast release: Feb 2007, pistachio 1.1 (discontinued)http://ertos.nicta.com.au/software/kenge/pistachio/latest/

Page 20: Some Experience  A bout  μ kernel and Device Driver

Famous L4 μkernel (cont.)

OKL4 Design by OKLab (Open Kernel Labs) OKLab spun out from NICTA Based on NICTA::Pistachio-embedded Commercial deploymentLast release: Apr 2008, OKL4 2.1http://wiki.ok-labs.com/

Page 22: Some Experience  A bout  μ kernel and Device Driver

Trusted Computing Base in μkernel

traditionalembedded

Linux/Windows

Microkernelbased

all code 100,000’s loc 10,000’s loc

System

TCB

Diagram from Kashin Lin (NEWS Lab)

Page 23: Some Experience  A bout  μ kernel and Device Driver

Related Research - SIGMA

A Study on Asymmetric Operating Systems on Symmetric Multiprocessors, Yu Murata, Wataru Kanda, Kensuke Hanaoka, and Tatsuo Nakajima, EUC07Achieve asymmetric multiple operating system

environments for symmetric multiprocessors No virtualization Direct control

Page 24: Some Experience  A bout  μ kernel and Device Driver

SIGMA (cont.)

A multiple OS environmentHost OS: L4 micro kernel (NICTA::L4-

embedded)Guest OS: SIGMA Linux

The OS managerThe bootloader of CPU1

Page 25: Some Experience  A bout  μ kernel and Device Driver

SIGMA (cont.)

Page 26: Some Experience  A bout  μ kernel and Device Driver

SIGMA (cont.)

Estimated use cases

Page 27: Some Experience  A bout  μ kernel and Device Driver

Outline

Introduction of μkernel Introduction of L4 μkernel Family Something Interesting in L4 μkernel Introduction of The Platform The Bug of USB Host Device Driver Other Experiences of Driver Debugging

Page 28: Some Experience  A bout  μ kernel and Device Driver

Outline

Introduction of μkernel Introduction of L4 μkernel Family Something Interesting in L4 μkernel Introduction of The Platform The Bug of USB Host Device Driver Other Experiences of Driver Debugging

Page 29: Some Experience  A bout  μ kernel and Device Driver

Outline

Introduction of μkernel Introduction of L4 μkernel Family Something Interesting in L4 μkernel Introduction of The Platform The Bug of USB Host Device Driver Other Experiences of Driver Debugging

Page 30: Some Experience  A bout  μ kernel and Device Driver

GPIO

Page 31: Some Experience  A bout  μ kernel and Device Driver

GPIO support in DM6446

71 GPIO signals. GPIO[53:0] are 1.8V I/O signals. GPIOV33_[16:0] are 3.3V I/O signals.

16 registers one bank Total 5 banks

Page 32: Some Experience  A bout  μ kernel and Device Driver

Configure GPIO Registers

Page 33: Some Experience  A bout  μ kernel and Device Driver

Remarks in GPIO

Others important setting depend on the platform Power Pinmux

Page 34: Some Experience  A bout  μ kernel and Device Driver

Power Setting

In the DM644x system, the Power & Sleep Controller (PSC) is responsible for managing transitions of system power on/off, clock on/off, and reset

Page 35: Some Experience  A bout  μ kernel and Device Driver

Power Setting (cont.)

Page 36: Some Experience  A bout  μ kernel and Device Driver

Pinmux Setting

DM644x allows multiplexing of shared device pins between peripherals.

Check the GPIO pins you used whether shares to other device?

Page 37: Some Experience  A bout  μ kernel and Device Driver

Pinmux Setting (cont.)

Page 38: Some Experience  A bout  μ kernel and Device Driver

Pinmux Setting (cont.)

Page 39: Some Experience  A bout  μ kernel and Device Driver

Debug Experience

Page 40: Some Experience  A bout  μ kernel and Device Driver

SPI – DAC 88347

Need a power meter Send different value Measure the voltage on output pin

Page 41: Some Experience  A bout  μ kernel and Device Driver

SPI – Input/Ouput Connection

DM6446 is master Peripheral is slave The SPI output pin of master device needs to

be connected to the input pin of slave device.

Page 42: Some Experience  A bout  μ kernel and Device Driver

USB – Mode Setting

USB controller in DM6446 Support USB 2.0 peripheral at High Speed (480

Mbps) and Full Speed (12 Mbps). Support USB 2.0 host at High Speed (480

Mbps), Full Speed (12 Mbps), and Low Speed (1.5 Mbps).

Page 43: Some Experience  A bout  μ kernel and Device Driver

USB – Mode Setting (cont.)

USB_ID pin

Page 44: Some Experience  A bout  μ kernel and Device Driver

Thanks

Page 45: Some Experience  A bout  μ kernel and Device Driver

Q & A