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

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

Transcript of Some Experience About μkernel and Device Driver 970529 Sean Lin.

Some Experience About μkernel and Device Driver970529 Sean Lin

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

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

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

Why Microkernel(μkernel)

Cost of monolithic kernel Complexity Growing size Limited maintainability

The Idea of Microkernel

Provide core functionality Applications communicate via message-

passing IPC

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

History of Microkernel

1st generation μkernel Mach Chorus Amoeba L3

History of Microkernel (cont.)

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

Comparison

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

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

Introduction of L4 Microkernel

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

Design Issue of L4

Abstractions Address spaces Threads

Mechanisms Inter-process communication (IPC) Mapping

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

Famous L4 μkernel

Fiasco Design by TU Dresden Preemptible real-time kernel Used for DROPS project GPL License

Last release: March 2007, Fiasco 1.2

http://os.inf.tu-dresden.de/drops/

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.

DROPS (cont.)

Multiple instances of Linux running on one machine

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.4

http://l4ka.org/projects/pistachio/

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 short

Last release: Feb 2007, pistachio 1.1 (discontinued)http://ertos.nicta.com.au/software/kenge/pistachio/latest/

Famous L4 μkernel (cont.)

OKL4 Design by OKLab (Open Kernel Labs) OKLab spun out from NICTA Based on NICTA::Pistachio-embedded Commercial deployment

Last release: Apr 2008, OKL4 2.1

http://wiki.ok-labs.com/

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)

Related Research - SIGMA

A Study on Asymmetric Operating Systems on Symmetric Multiprocessors, Yu Murata, Wataru Kanda, Kensuke Hanaoka, and Tatsuo Nakajima, EUC07

Achieve asymmetric multiple operating system environments for symmetric multiprocessors No virtualization Direct control

SIGMA (cont.)

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

embedded)Guest OS: SIGMA Linux

The OS managerThe bootloader of CPU1

SIGMA (cont.)

SIGMA (cont.)

Estimated use cases

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

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

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

GPIO

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

Configure GPIO Registers

Remarks in GPIO

Others important setting depend on the platform Power Pinmux

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

Power Setting (cont.)

Pinmux Setting

DM644x allows multiplexing of shared device pins between peripherals.

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

Pinmux Setting (cont.)

Pinmux Setting (cont.)

Debug Experience

SPI – DAC 88347

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

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.

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).

USB – Mode Setting (cont.)

USB_ID pin

Thanks

Q & A