industrial hardware and qemu

31
Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona Alberto Garcia <[email protected]>

Upload: others

Post on 12-Sep-2021

19 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Industrial hardware and QEMU

Industrial hardware and QEMU

LinuxCon Europe 2012, Barcelona

Alberto Garcia <[email protected]>

Page 2: Industrial hardware and QEMU

Industrial hardware and QEMU

Introduction

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 3: Industrial hardware and QEMU

About me

Who am I?

Alberto GarciaComputer engineer, Coruña UniversityWorking at Igalia since 2001Experience in operating systemsDebian maintainerInvolved in Maemo and MeeGo

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 4: Industrial hardware and QEMU

This talk

How to make the development of device drivers easier:

Debug problems that are hard to reproduceForesee points of failureIndustrial hardware as an exampleUseful for any kind of hardware

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 5: Industrial hardware and QEMU

Industrial hardware and QEMU

Industrial hardware

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 6: Industrial hardware and QEMU

Industrial hardware

Used by:Companies: factories,shipyards, robotics, ...Research laboratoriesUniversities

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 7: Industrial hardware and QEMU

Typical features

SimpleReliableWell-tested technologyExpensive / hard to findHard to replaceSometimes designed ad-hoc

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 8: Industrial hardware and QEMU

Types of industrial hardware

ADCs, DACsWaveform GeneratorsTime to digital convertersCommunications: serialports, fieldbus

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 9: Industrial hardware and QEMU

What it is used for

ActuatorsSensorsControl systems

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 10: Industrial hardware and QEMU

Examples

Struck SIS3320-250 8 channel ADC

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 11: Industrial hardware and QEMU

Industrial hardware and QEMU

Challenges

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 12: Industrial hardware and QEMU

Challenges of developing for this hardware

Limited availabilityBugs in the production environment cannot be reproducedin the laboratoryDifficult to debug on-site

Narrow time windowsDangerous environment

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 13: Industrial hardware and QEMU

Challenges of developing for this hardware

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 14: Industrial hardware and QEMU

Debugging

Is it a problem in the driver or in the device?Is the firmware faulty? Is it wrongly loaded?Is the hardware damaged?How can we reproduce the bug?Do we have easy access to the environment?Is it remotely located?

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 15: Industrial hardware and QEMU

Industrial hardware and QEMU

Using virtualization to makethings easier

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 16: Industrial hardware and QEMU

QEMU

Machine emulator and virtualizerSupports multiple architecturesCan be accelerated using KVMFree softwareFlexible

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 17: Industrial hardware and QEMU

How QEMU can help us

We can emulate the device we’re working withEven if the hardware doesn’t exist yet!Useful not just for software:

Develop hardware and its driver in parallelSimulate hard to reproduce conditions

Force hardware errors or other uncommon situationsForesee potential points of failureMake the driver more reliable

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 18: Industrial hardware and QEMU

Hardware we’ve worked with

Simple PCIe FMC Carrier(SPEC)

FMC Time to Digital Converter

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 19: Industrial hardware and QEMU

How to create new devices in QEMU

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 20: Industrial hardware and QEMU

Emulating the device

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 21: Industrial hardware and QEMU

Industrial hardware and QEMU

Testing our drivers

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 22: Industrial hardware and QEMU

Tests

Create a set of tests for the deviceTests can “talk” to QEMU and inject errors or force otherconditionsDetect problems before the changes are put intoproduction

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 23: Industrial hardware and QEMU

Test environment

Framework written in pythonSimple process:

The virtual machine is startedThe test environment is set upTests are runThe results are compared with the expected values

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 24: Industrial hardware and QEMU

Unattended testing

Run QEMU without user interactionNo display necessarySelect the kernel that you want to bootLog all messages, compare them against expected valuesEasily share files between both sidesDetect when the system crashes

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 25: Industrial hardware and QEMU

Running the tests

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 26: Industrial hardware and QEMU

Continuous integration

We can run tests automatically when the driver is updatedAlso if the hardware specs changeDetect regressions more easily

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 27: Industrial hardware and QEMU

Industrial hardware and QEMU

Conclusions

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 28: Industrial hardware and QEMU

Overall benefits

No need to have the actual hardwareYou can also help the development of the hardware

Hardware and software can be developed in parallel

Distributed teamsMore stable driversTest changes before they are deployed

Faster development

Continuous integrationContribute to QEMU

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 29: Industrial hardware and QEMU

Industrial hardware and QEMU

Questions & Answers

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 30: Industrial hardware and QEMU

Industrial hardware and QEMU

Thank you!

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona

Page 31: Industrial hardware and QEMU

Images used in this presentation

http://www.flickr.com/photos/9197427@N06/2885827751

http://www.flickr.com/photos/twosevenoneonenineeightthreesevenatenzerosix/7848902444/

http://www.flickr.com/photos/altemark/273968506/

http://www.flickr.com/photos/11304375@N07/2046228644/

http://www.ohwr.org/projects/spec/wiki

http://www.ohwr.org/projects/fmc-tdc/wiki

Industrial hardware and QEMU LinuxCon Europe 2012, Barcelona