Presentation on theme: "2006/1/201IGEL Co.,Ltd. / Renesas Solution Corp. Studies on User Level Device Driver in Embedded Environment （ Progress Report ） Katsuya Matsubara IGEL."— Presentation transcript:
2006/1/201IGEL Co.,Ltd. / Renesas Solution Corp. Studies on User Level Device Driver in Embedded Environment （ Progress Report ） Katsuya Matsubara IGEL Co.,Ltd.
2006/1/202IGEL Co.,Ltd. / Renesas Solution Corp. Stories so far Investigated behaviors of threads –RT Task vs Non-RT Task Number of Load Tasks Switching Time(WRITE Task->Vertual DD->Read Task)Wakeup Vertual DD->Read Task) Response Time(microsec)
2006/1/203IGEL Co.,Ltd. / Renesas Solution Corp. Background and Objectives Want to implement device drivers in user level –Easy to devleop –Reduce system down due to driver bugs – （ Avoid GPL ） Some issues on implementing user level device drivers –Access to I/O memory, physical memory –Forwarding of Interupttion Requests （ IRQ ） –Response performance to interuption – ‥‥ New features in Kernel 2.6 –NPTL(Native POSIX Thread Library) –Sceduler improvement （ O(1) scheduler etc. ） –Kernel preemption –….
2006/1/204IGEL Co.,Ltd. / Renesas Solution Corp. Facts in Development of Embedded Software More development of drivers for new devices Applications directly control devices –To minimize latency –More intimate relation between devices and applications, thant desktop PC applications Hiding hardware specification
2006/1/205IGEL Co.,Ltd. / Renesas Solution Corp. User Level Device Drivers Implementing Device Drivers in User Space Expected effects –Use of abundant tools/libraries (e.g. files) –Ease of development and debugging –Less system hang ups –Less distance to applications –…. Related research –Peter Chubb, “Get more device drivers out of kernel,” OLS2004.
2006/1/206IGEL Co.,Ltd. / Renesas Solution Corp. Features Required for Device Drivers Access to I/O Memory –Device control through register I/O, data I/O Interrupt Receipt and Handling Physical Memory Allocation and Access –Necessary for devices which access directly to memory using DMA, etc. –In case of DMA, allocation of consecutive memory may be required Lock of CPU ， Realtime Interface to Applications
2006/1/207IGEL Co.,Ltd. / Renesas Solution Corp. Interrupt Receipt and Handling in User Level Device Drivers Interrupt Reciept by File I/O –Prepare device files for each interrupt number –read() the device file and block until interrupt occurs
2006/1/208IGEL Co.,Ltd. / Renesas Solution Corp. Memory Access in User Level Device Drivers Direct Access to I/O Memory with Memory Map(mmap) –open(), mmap() the /dev/mem or specific device file –Once mmap’ed, then accessible as usual For Physical Memory, Allocate, then mmap
2006/1/209IGEL Co.,Ltd. / Renesas Solution Corp. Interface to Applications in User Level Device Drivers As User Level Device Driver can Exist in the Same User Space as Applications, Such Interfaces as Interprocess Communications, Shared Memory, etc. can Implementable Easy to Integrate with Applications
2006/1/2010IGEL Co.,Ltd. / Renesas Solution Corp. CPU Lock, Realtime in User Level Device Drivers With RT Threads, to Some Extent… To be discussed
2006/1/2017IGEL Co.,Ltd. / Renesas Solution Corp. Experiment Just started experimenting… Serial I/O –Measured throughput with 1MB READ/WRITE for serial device –Used SM501 byte I/O mode –Kernel drivers are those included in 184.108.40.206 –User level device driver was executed as RT task –User level device driver was integrated with serial I/O process –Connected R2D board and note PC(TeraTerm) with serial cross cable
2006/1/2018IGEL Co.,Ltd. / Renesas Solution Corp. Experiment Results 38.4kbps300bps ReadWriteReadWrite User Level DD29.95kbps30.68kbps210.70bps213.34bps Kernel Level DD 29.69kbps28.08kbps232.82bps232.70bps Data Size ： 1MB Buffer Size ： 1KB Baud Rate ： 300 or 38400 bps Mesured values ： Average of the 10 trial results of the same experiment
2006/1/2019IGEL Co.,Ltd. / Renesas Solution Corp. Impressions Negligible Overhead At least in Low Load Environment (where no one intervenes)? –ULDD is rather faster for 38.4kbps –Deserves analysis – My action item System Stability, Ease of Coding and Debugging, and Abundance of User Land Features are Attractive
2006/1/2020IGEL Co.,Ltd. / Renesas Solution Corp. Issues Behavior in Heavy Load Environment –RT tasks / Non-RT tasks Comparison with PC Environment Evaluation with Other Devices Summary of Characteristics of Kernel Level Device Drivers and User Level Device Drivers Seeking for Novelty…