Some Experience A bout μ kernel and Device Driver
description
Transcript of Some Experience A bout μ kernel and Device Driver
![Page 1: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/1.jpg)
Some Experience About μkernel and Device Driver970529 Sean Lin
![Page 2: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/2.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/3.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/4.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/5.jpg)
Why Microkernel(μkernel)
Cost of monolithic kernel Complexity Growing size Limited maintainability
![Page 6: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/6.jpg)
The Idea of Microkernel
Provide core functionality Applications communicate via message-
passing IPC
![Page 7: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/7.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/8.jpg)
History of Microkernel
1st generation μkernel Mach Chorus Amoeba L3
![Page 9: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/9.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/10.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/11.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/12.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/13.jpg)
Design Issue of L4
Abstractions Address spaces Threads
Mechanisms Inter-process communication (IPC) Mapping
![Page 14: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/14.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/15.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/16.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/17.jpg)
DROPS (cont.)
Multiple instances of Linux running on one machine
![Page 18: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/18.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/19.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/20.jpg)
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 21: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/21.jpg)
OKL4
Adopted by Qualcomm for CDMA chipsets OKL4-based Toshiba phonehttp://www.fluffyspider.com/demos/live_videos/flv/fancypants-openmoko-neo1973-video-browser-phone-dialer.html
![Page 22: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/22.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/23.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/24.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/25.jpg)
SIGMA (cont.)
![Page 26: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/26.jpg)
SIGMA (cont.)
Estimated use cases
![Page 27: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/27.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/28.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/29.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/30.jpg)
GPIO
![Page 31: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/31.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/32.jpg)
Configure GPIO Registers
![Page 33: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/33.jpg)
Remarks in GPIO
Others important setting depend on the platform Power Pinmux
![Page 34: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/34.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/35.jpg)
Power Setting (cont.)
![Page 36: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/36.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/37.jpg)
Pinmux Setting (cont.)
![Page 38: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/38.jpg)
Pinmux Setting (cont.)
![Page 39: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/39.jpg)
Debug Experience
![Page 40: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/40.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/41.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/42.jpg)
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](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/43.jpg)
USB – Mode Setting (cont.)
USB_ID pin
![Page 44: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/44.jpg)
Thanks
![Page 45: Some Experience A bout μ kernel and Device Driver](https://reader036.fdocument.org/reader036/viewer/2022062302/56816384550346895dd46897/html5/thumbnails/45.jpg)
Q & A