porting freertos to xen on arm · parrot “ar.drone” quadcopter...
TRANSCRIPT
![Page 1: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/1.jpg)
© 2014 Galois, Inc. All rights reserved.
Porting FreeRTOS to Xen on ARM
Jonathan Daugherty ([email protected])
Xen Developer Summit | August 19, 2014
![Page 2: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/2.jpg)
© 2014 Galois, Inc. All rights reserved.
Agenda
§ Background § Project status § Approach § Challenges § Highlights § Wishlist
![Page 3: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/3.jpg)
© 2014 Galois, Inc. All rights reserved.
Parrot “AR.Drone” Quadcopter
![Page 4: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/4.jpg)
© 2014 Galois, Inc. All rights reserved.
Inside the Parrot Drone
Linux FreeRTOS
![Page 5: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/5.jpg)
© 2014 Galois, Inc. All rights reserved.
Consolidated System
Linux FreeRTOS
![Page 6: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/6.jpg)
© 2014 Galois, Inc. All rights reserved.
Benefits of Consolidation
§ Simpler hardware design § Lower SWAP: Space,
Weight, and Power § More runtime flexibility
Linux FreeRTOS
![Page 7: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/7.jpg)
© 2014 Galois, Inc. All rights reserved.
Our Use Case: SMACCMPilot
http://smaccmpilot.org/
High-levelimplementation
Generated FreeRTOS
implementation
![Page 8: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/8.jpg)
© 2014 Galois, Inc. All rights reserved.
Agenda
§ Background § Project status § Approach § Challenges § Highlights § Wishlist
![Page 9: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/9.jpg)
© 2014 Galois, Inc. All rights reserved.
What’s Done
§ Ported FreeRTOS 7.6.0 to Xen 4.4
§ Open source release soon! § Used HaLVM’s C library, now
available at https://github.com/GaloisInc/minlibc
![Page 10: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/10.jpg)
© 2014 Galois, Inc. All rights reserved.
What’s Left
§ Investigate just how “real time” FreeRTOS is on Xen • Try with ARINC 653 scheduler
§ Test FreeRTOS with Xen 4.5 § Explore adoption (FreeRTOS community?)
![Page 11: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/11.jpg)
© 2014 Galois, Inc. All rights reserved.
Agenda
§ Background § Project status § Approach § Challenges § Highlights § Wishlist
![Page 12: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/12.jpg)
© 2014 Galois, Inc. All rights reserved.
Phase 1: Port FreeRTOS to virtual ARMv7-A
§ Developed ARM kernel in a Xen domain § Ignored PV support for this phase § Used HYPERVISOR_console_io for debugging
![Page 13: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/13.jpg)
© 2014 Galois, Inc. All rights reserved.
Phase 2: Add PV Support
§ Used Mini-OS for ARM as a starting point • Xenbus • Event channels • Grant tables • Xen console
§ Mini-OS showed how to use hypercalls
![Page 14: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/14.jpg)
© 2014 Galois, Inc. All rights reserved.
Agenda
§ Background § Project status § Approach § Challenges § Highlights § Wishlist
![Page 15: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/15.jpg)
© 2014 Galois, Inc. All rights reserved.
New guests reveal virtualization gaps
§ FreeRTOS wants: • ARM interrupt priorities & priority masking • ARM interrupt nesting
§ Linux doesn’t use these HW features § Now Xen supports more ARM features
![Page 16: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/16.jpg)
© 2014 Galois, Inc. All rights reserved.
Guest implementation docs are spread out
§ Required reading: public/xen.h, public/arch-arm.h!• Supported hypercalls • ABI requirements
§ Linux sources for guidance on which hypercalls apply on ARM
![Page 17: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/17.jpg)
© 2014 Galois, Inc. All rights reserved.
(Spoiler alert) Mini-OS could benefit
from more testing
![Page 18: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/18.jpg)
© 2014 Galois, Inc. All rights reserved.
XSA-95: malformed kernel binaries crashed ‘xl’
![Page 19: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/19.jpg)
© 2014 Galois, Inc. All rights reserved.
Agenda
§ Background § Project status § Approach § Challenges § Highlights § Wishlist
![Page 20: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/20.jpg)
© 2014 Galois, Inc. All rights reserved.
Xen on ARM is a great development platform
![Page 21: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/21.jpg)
© 2014 Galois, Inc. All rights reserved.
ARM port of Mini-OS by Karim Allah was a huge help
![Page 22: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/22.jpg)
© 2014 Galois, Inc. All rights reserved.
Fantastic support from Xen+ARM developers!
Thanks to: Julien Grall, Stefano Stabellini, Ian Campbell
![Page 23: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/23.jpg)
© 2014 Galois, Inc. All rights reserved.
Agenda
§ Background § Project status § Approach § Challenges § Highlights § Wishlist
![Page 24: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/24.jpg)
© 2014 Galois, Inc. All rights reserved.
blkback!
blkfront!
PV driver “bugfix negotiation”
![Page 25: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/25.jpg)
© 2014 Galois, Inc. All rights reserved.
libXenGuest.a!
- Hypercalls!
- Xenbus!
- Event chans!
- Grant tables!
- Console!
![Page 26: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/26.jpg)
© 2014 Galois, Inc. All rights reserved.
Implementing Xen Guests
Port your favorite OS to Xen!
![Page 27: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/27.jpg)
© 2014 Galois, Inc. All rights reserved.
Summary
§ FreeRTOS 7.6.0 running on Xen 4.4 on ARM § Open source release on GitHub soon! § Minimal C library at
https://github.com/GaloisInc § Learn more about SMACCMPilot at
http://smaccmpilot.org/
Get in touch at [email protected]!
![Page 28: Porting FreeRTOS to Xen on ARM · Parrot “AR.Drone” Quadcopter ©2014Galois,Inc.Allrightsreserved. Inside the Parrot Drone Linux FreeRTOS ©2014Galois,Inc.Allrightsreserved. Consolidated](https://reader035.vdocuments.us/reader035/viewer/2022081614/5fcf77e8e783d43cac2894f5/html5/thumbnails/28.jpg)
© 2014 Galois, Inc. All rights reserved.
All trademarks, service marks, trade names, trade dress, product names and logos appearing in these slides are the property of their respective owners, including in some instances Galois, Inc. All rights are reserved.