Polishing the Dirt Deploying vendor software in embedded Linux systems Porting legacy RTOS code to Userspace drivers framework © Vitaly Wool, BroLab AB,

Slides:



Advertisements
Similar presentations
Contiki A Lightweight and Flexible Operating System for Tiny Networked Sensors Presented by: Jeremy Schiff.
Advertisements

SM3121 Software Technology Mark Green School of Creative Media.
Cambodia-India Entrepreneurship Development Centre - : :.... :-:-
Building an Application Server for Home Network based on Android Platform Yi-hsien Liao Supervised by : Dr. Chao-huang Wei Department of Electrical Engineering.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Operating System.
Virtualization: Not Just For Servers Hollis Blanchard PowerPC kernel hacker.
Chapter 14 Part II: Architectural Adaptation BY: AARON MCKAY.
 Virtual machine systems: simulators for multiple copies of a machine on itself.  Virtual machine (VM): the simulated machine.  Virtual machine monitor.
CSE 451: Operating Systems Winter 2015 Module 5 1 / 2 User-Level Threads & Scheduler Activations Mark Zbikowski 476 Allen Center.
CSC414 “Introduction to UNIX/ Linux” Lecture 2. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
The Performance of Micro-Kernel- Based Systems H. Haertig, M. Hohmuth, J. Liedtke, S. Schoenberg, J. Wolter Presentation by: Tim Hamilton.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
I/O Software CS 537 – Introduction to Operating Systems.
Kernel Modules – Introduction CSC/ECE 573, Sections 001 Fall, 2012.
Course 03 Basic Concepts assist. eng. Jánó Rajmond, PhD
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Written by : Oren Frenkel Intel Confidential ® C CD SDS.
Saving Power with Wi-Fi: How to prolong your battery life and still stay connected Vitaly Wool Senior Consultant, SonyEricsson Mobile Communications.
Embedded Linux development: a glance from inside Embedded Linux development: a glance from inside Mike Rapoport CompuLab Ltd.
NAND Chip Driver Optimization and Tuning
Tgt: Framework Target Drivers FUJITA Tomonori NTT Cyber Solutions Laboratories Mike Christie Red Hat, Inc Ottawa Linux.
Migrate a RTAI Application to RT- Preempt - A case study lin u troni x.
Why Freelance Developers Are Switching To Econtracts
Introduction to Operating Systems Concepts
Computer System Structures
Computer System Structures
Voice Controlled Robot by Cell Phone with Android App
Operating System Overview
Android Mobile Application Development
Efficient Software-Based Fault Isolation
CHAPTER 4 Methodology.
Development Environment
Kernel Design & Implementation
Chapter Objectives In this chapter, you will learn:
Processes and threads.
Server Upgrade HA/DR Integration
Understanding Android Security
Security Management: Successes and Failures
N-Tier Architecture.
LWIP TCP/IP Stack 김백규.
Mobile App Development
Protecting Memory What is there to protect in memory?
6.0 INTRODUCTION TO REAL-TIME OPERATING SYSTEMS (RTOS/RTK)
CASE STUDY 1: Linux and Android
Software as Data Structure
Whether you decide to use hidden frames or XMLHttp, there are several things you'll need to consider when building an Ajax application. Expanding the role.
Software Life Cycle Models
Embedded Linux Conference - April 2009
Introduction to Computers
IT Systems Analysis & Design
CSCI/CMPE 3334 Systems Programming
OS Virtualization.
Serial Data Hub (Proj Dec13-13).
Threads and Data Sharing
The Object-Oriented Thought Process Chapter 05
Chapter 2: The Linux System Part 1
SISAI STATISTICAL INFORMATION SYSTEMS ARCHITECTURE AND INTEGRATION
Lecture Topics: 11/1 General Operating System Concepts Processes
Chapter 5: I/O Systems.
Multithreaded Programming
MORE ON ARCHITECTURES The main reasons for using an architecture are maintainability and performance. We want to structure the software into reasonably.
Topic 5: Communication and the Internet
ONLINE SECURE DATA SERVICE
Understanding Android Security
Legacy system components
Chapter-1 Computer is an advanced electronic device that takes raw data as an input from the user and processes it under the control of a set of instructions.
CS703 – Advanced Operating Systems
Software Re-engineering and Reverse Engineering
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Polishing the Dirt Deploying vendor software in embedded Linux systems Porting legacy RTOS code to Userspace drivers framework © Vitaly Wool, BroLab AB, 2010

Vendor software? ● Software that comes from semiconductor vendors together with the chip – Firmware an chip enablement – Basic examples – Middleware ● Intrusion into Android framework –...and even applications ● Ok. Why?

Product development objectives ● Marketing pressure – Faster time to market – Feature richness ● “Development minimization” paradigm and stereotypes – Building from blocks – OSS perception: “just take what you need” ● Why not use only OSS solutions then?

OSS for an end user product? ● OSS is not production ready – Always in development stage ● Vendors produce specific chips per big customers' demand – No OSS support out of the box ● Needs quite a bit of tweaking – Someone is to implement support for that ● Vendor? ● End user product manufacturer? ● Third party?

Vendor software evolution ● “Complete solutions” instead of chip enablement – Save development time – Mostly integration work – Less risk for the product producer – Vendors take the responsibility for their code ● Bugfixing ● Maintenance ● So why so sad?

Vendor software: as it is ● A lot of redundant code – Support for multiple platforms – Support for chip families ● “Sorry, you're not our only customer” ● Many levels of indirection – Ex. 5 callback levels ● Legacy code – Developed for years, the base might be old ● And that's not it...

Vendor software and Linux ● Origin is very different – Initially written for an RTOS – Assumes single address space – No kernel/userspace separation ● Clean porting to Linux is not a no-brainer – Requires deep knowledge – Time consuming ● Ends up with a quick-and-dirty porting

Vendor software: pray or deny? ● Make the most of the vendor SW – Let the vendor do the work (development/integration) – Leave maintenance to the vendor ● Minimize the use of the vendor SW – Treat it as a prototype – Develop own solution ● Solution analysis before deployment – Evaluation agreement

Collaborative approach ● Good as long as you're a customer – No local knowledge of the internals – No community acceptance – You totally depend on the vendor support – Each service pack is a problem ● Forward porting may become a problem – Another kernel version – Changes in the framework

“Denial” approach ● Might be good in the ideal world ● Not applicable in the real one – Takes too much effort – You won't get complete control anyway ● Binary parts (firmware) – You are not backed up by the vendor ● e. g. for the firmware upgrade

Analytic approach ● Apparently the best, but... – Criteria are unclear – Usually requires additional agreement with the vendor – Analysis itself takes time ● Still it's usually worth it :-) ● Our proposal: different criteria for – Open source vendor software – Non-open source vendor software

Open source vendor software ● Mostly kernel-related – Device drivers – Generic extensions – Hackery in generic code ● Criteria are clear enough – LDM conformance for drivers – No hackery as above – Mainline acceptance for generic changes

Non-OSS from vendors ● Proposed criteria – Modularity – Security – Proper kernel/userspace interaction ● Consider deploying userspace drivers ● NB! – Need to understand the reasoning behind “wrong” solutions – Need to communicate back to the vendor to not lose the warranty/support

Userspace drivers framework ● Kernel framework for having part of driver functionality in userspace ● Authors/credits – Thomas Gleixner, Hans-Juergen Koch ● Meant mostly for simple devices – Complete kernel driver might be an overkill ● Also can solve some licensing issues – No binary kernel module nonsense ● Userspace IO system (UIO)

UIO: highlights ● Kernel “stub” – Low level stuff (interrupt handling) – /dev/uioX device files ● Userspace daemon – Driver “logic” – Interaction with the kernel stub ● File operations, mmap()'ing etc...

Polishing examples

Vendor OSS example: WLAN driver stack ● Transport part – SDIO: abuses existing OSS driver – SPI: doesn't use kernel SPI framework ● WLAN part – Initially written for the legacy RTOS ● Licensing issues ● Consequences – Nowhere near community acceptance

Possible improvements ● Use mainline kernel features where possible – Use standard SD controller driver – Conform to LDM ● Use userspace drivers framework – Move WLAN state machine to userspace – Keep networking part in kernelspace – Keep SDIO part in kernelspace

Improvements: impact ● Stock SD driver deployment – SD card reading on resume problem is gone – Less code to maintain ● WLAN SM to userspace – No licensing issues – Some speed increase ● Faster interaction with wpa_supplicant

Vendor non-OSS example: FM radio ● Solution completely in userspace – Uses AF_BLUETOOTH socket to ● Send commands to the chip ● poll for events from it – Needs BlueZ hciattach to be running – Only can read all events at once ● Can only process 1 command at a time ● Has to ignore events while waiting for command completion ● High latencies in event processing

Possible improvements ● Implement a custom driver interacting with BT UART – No need to take HCI interface up ● Implement event processing as an userspace driver – Event reading in kernelspace – FM state machine in userspace

Improvements: impact ● Lower latency for event reception – better/faster FM radio operation ● No other outcome – FM SM can't handle more than one command at a time ● Global state variables ● Multiple race conditions – Async events (RDS text) may still be lost

Conclusions ● Deploying vendor software in a product... – Is unavoidable – Is to be considered carefully ● Userspace drivers – Provide efficient way for vendor SW redesign ● Performance, licensing, maintenance ● Communication is very important

Q&A Thanks for your attention!