استفاده از مفهوم نرمافزار آزاد، پیشرفتهای شگرفی را در حوزههای مرتبط با علوم کامپیوتری در دو دههٔ اخیر به همراه داشته است. بهبود عملکرد و پیشرفت در قابلیت اطمینان و صحت کارکرد، از مهمترین دستاوردهای ورود مفاهیم نرمافزارهای آزاد و متنباز به حوزه علوم کامپیوتری بود. در چندین سال اخیر، این مفاهیم به حوزهٔ الکترونیک و سختافزار نیز وارد شده و با ورود خود موجب افزایش قابلیت اطمینان، بهبود در راندمان، کاهش زمان طراحی (از ایده تا اجرا) و افزایش سرعت تولید محصولات الکترونیکی و مکاترونیکی شده است. در واقع تاریخ در این حوزه نیز تکرار شده است. در این میان، نقش سیستمهای عامل متنباز همانند گنو/لینوکس، که دقیقاً به علت آزاد و متنباز بودن به راحتی به معماریهای مختلف سختافزاری پورت شدهاند، بسیار پررنگ و حائز اهمیت است. در سالهای اخیر، گنو/لینوکس و مشتقات آن، با قدرتی بینظیر، به شکلی متفاوت و بسیار ساده به حوزه سختافزار وارد شده است. انتظار میرود با ورود شرکتهای بزرگ سختافزاری دنیا همانند اینتل، سامسونگ و بسیاری از شرکتهای مهم دیگر در سالهای پیش رو، حوزههای الکترونیک، اینترنت اشیا (IoT)، نرمافزارهای آزاد و جامعه آنها، سیستمهای بر روی تراشه (SoC) و کامپیوترهای فوق کوچک دارای سیستمعامل، با یکدیگر ترکیب و بیش از پیش موجب تحول در کسب و کارهای سنتی و مبتنی بر روشهای قدیمی طراحی سختافزار شود. در این مقاله نگاهی به پیشرفتهای حاصل شده در این زمینه و انتظارات سالهای پیش رو خواهیم داشت.
سرفصلها:
نرمافزارهای آزاد و راهیابی به به دنیای سیستمهای نهفته
الکترونیک دیجیتال و ورود سیستمعامل
سیستمهای نهفته و چالش کاربردهای بیدرنگ
اینترنت اشیاء، محلی برای نمایش قدرت نرمافزارهای آزاد
حرکت شتابدار به سوی دنیای Embedded System و نقش نرمافزارهای آزاد بر آن
1. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Towards Embedded Systems
Motivational Role of Free Software
Mojtaba Barzegari
mbarzegary@msn.com
Software Freedom Day
Sharif University of Technology
29th September 2016
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 1 / 40
2. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Outline
Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 2 / 40
3. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Free Software: a Prison Break
• Free Software: Four Essential Freedoms
• A bit about History
• GNU/Linux
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 3 / 40
4. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Free Software: Four Essential Freedoms
• A program is considered free when its license offers to all its
users the following four freedoms
• Freedom to run the software for any purpose
• Freedom to study the software and to change it
• Freedom to redistribute copies
• Freedom to distribute copies of modified versions
• These freedoms are granted for both commercial and
non-commercial use
• They imply the availability of source code, software can be
modified and distributed to customers
• Good match for embedded systems!
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 4 / 40
5. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
A bit about History
• 1983, Richard Stallman, GNU project and the free software
concept. Beginning of the development of gcc, gdb, glibc and
other important tools
• 1991, Linus Torvalds, Linux kernel project, a Unix-like
operating system kernel. Together with GNU software and
many other open-source components: a completely free
operating system, GNU/Linux
• 1995, Linux is more and more popular on server systems
• 2000, Linux is more and more popular on embedded systems
• 2008, Linux is more and more popular on mobile devices
• 2010, Linux is more and more popular on phones
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 5 / 40
6. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
GNU/Linux
Richard Stallman
What you guys are referring to as Linux, is in fact, GNU/Linux, or
as I’ve recently taken to calling it, GNU plus Linux. Linux is not an
operating system unto itself, but rather another free component of
a fully functioning GNU system made useful by the GNU corelibs,
shell utilities and vital system components comprising a full OS as
defined by POSIX.
0101101110
0101110101
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 6 / 40
7. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Play Your Notes: Embedded Systems
• What is an Embedded System?
• What makes Embedded Systems different?
• Embedded Systems Complexity
• To Be or Not to Be, That is the Question
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 7 / 40
8. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
What is an Embedded System?
An embedded system is a computer system with a dedicated
function within a larger mechanical or electrical system, often with
real-time computing constraints. It is embedded as part of a
complete device often including hardware and mechanical parts.
Embedded systems control many devices in common use today
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 8 / 40
9. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
What makes Embedded Systems different?
• Real-time operation
• Size
• Cost
• Time
• Reliability
• Safety
• Energy
• Security
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 9 / 40
10. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Embedded Systems Complexity
Moore’s Law (Second edition)
The observation made in 1975 by Gordon Moore, co-founder of
Intel, that the number of transistors per square inch on integrated
circuits had doubled every double year since the integrated circuit
was invented.
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 10 / 40
11. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
To Be or Not to Be, That is the Question
So, why does your TV run Linux? At frst glance, the function of a
TV is simple: it has to display a stream of video on a screen. Why
is a complex Unix-like operating system like Linux necessary?
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 11 / 40
12. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Digital Electronics and Operating Systems
• Electronics: Analog and Digital
• Enter the Sandman: Microcontroller
• Productivity Nightmares: Primary Solutions
• Open Source OSes
• Linux and Free Software
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 12 / 40
13. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Electronics: Analog and Digital
Analog Digital
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 13 / 40
14. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Enter the Sandman: Microcontroller
• Gate + Clock ⇒ Microprocessor
• Microprocessor + Peripherals ⇒ Microcontroller
• Microcontroller + CoProcessors ⇒ Embedded Processor
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 14 / 40
15. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Productivity Nightmares: Primary Solutions
Serious Challenges:
• Managing Peripherals
• Moore’s Law
• Programming APIs
• Hardware Dependency
Recommended Solutions:
• Open Hardware
• Arduino/Genuino
• Open Source Hardware Programming Platforms
• Mbed
• Operating System
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 15 / 40
16. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Open Source OSes
• FreeRTOS
• RIOT
• Contiki
• TinyOS
• OpenWSN
• Zephyr
• GNU/Linux
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 16 / 40
17. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Linux and Free Software
Advantages of Linux and Free Software for embedded systems:
• Re-using components
• Low cost
• Full control
• Quality
• Easy testing of new features
• Community support
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 17 / 40
18. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Re-using components
• The key advantage of Linux and open-source in embedded
systems is the ability to re-use components
• The open-source ecosystem already provides many
components for standard features, from hardware support to
network protocols, going through multimedia, graphic,
cryptographic libraries, etc.
• As soon as a hardware device, or a protocol, or a feature is
wide-spread enough, high chance of having open-source
components that support it.
• Allows to quickly design and develop complicated products,
based on existing components.
• No-one should re-develop yet another operating system kernel,
TCP/IP stack, USB stack or another graphical toolkit library.
• Allows to focus on the added value of your product.
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 18 / 40
19. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Low cost
• Free software can be duplicated on as many devices as you
want, free of charge.
• If your embedded system uses only free software, you can
reduce the cost of software licenses to zero. Even the
development tools are free, unless you choose a commercial
embedded Linux edition.
• Allows to have a higher budget for the hardware or to increase
the companys skills and knowledge
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 19 / 40
20. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Full control
• With open-source, you have the source code for all
components in your system
• Allows unlimited modifications, changes, tuning,
debugging, optimization, for an unlimited period of time
• Without lock-in or dependency from a third-party vendor
• To be true, non open-source components must be avoided
when the system is designed and developed
• Allows to have full control over the software part of your
system
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 20 / 40
21. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Quality
• Many open-source components are widely used, on millions
of systems
• Usually higher quality than what an in-house development
can produce, or even proprietary vendors
• Of course, not all open-source components are of good
quality, but most of the widely-used ones are.
• Allows to design your system with high-quality
components at the foundations
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 21 / 40
22. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Easy testing of new features
• Open-source being freely available, it is easy to get a piece
of software and evaluate it
• Allows to easily study several options while making a choice
• Much easier than purchasing and demonstration procedures
needed with most proprietary products
• Allows to easily explore new possibilities and solutions
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 22 / 40
23. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Community support
• Open-source software components are developed by
communities of developers and users
• This community can provide a high-quality support: you can
directly contact the main developers of the component you
are using. The likelyhood of getting an answer doesn’t depend
what company you work for.
• Often better than traditional support, but one needs to
understand how the community works to properly use the
community support possibilities
• Allows to speed up the resolution of problems when
developing your system
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 23 / 40
24. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Linux Disadvantages!!!
• Linux certainly is a robust and developer-friendly OS
• Linux will have many uses in embedded devices, particularly
ones that provide graphically rich user interfaces.
• Linux has a disadvantage when compared to other embedded
operating systems:
• Memory footprint
• It simply will not run on 8 or 16-bit MCUs
• Real-time operations problem
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 24 / 40
25. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Real-Time OS: Dream or Reality??
Library
Hardware
Application
Linux Kernel
C Library
Read/WriteRequest
Response
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 25 / 40
26. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Real-Time OS: Dream or Reality??
Typical Problems:
• Controlling Servo Motors
• Generating High Frequency Signals
• Generating PWM and Duty Cycles
• Sampling a Signal (e.g. Audio Signal)
• Controlling a Sensitive Robot
• Developing Flight Controllers
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 26 / 40
27. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Real-Time OS: Dream or Reality??
Suggested Solutions:
1 Using High-Speed Interfaces
• PCI
• Ethernet
• USB
• RS232
2 Developing System Drivers
3 Designing Auxiliary Hardware and Co-Processor
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 27 / 40
28. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Internet of Things: Domination of Free Software
• What is Internet of Things (IoT)?
• Things Connected Through Internet
• IoT Applications
• Top Free and Open Source IoT Projects
• Rise of Linux: IoT-ready Hardwares
• Beyond the IoT: The Computation Thunderbolt
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 28 / 40
29. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
What is Internet of Things (IoT)?
What is IoT?
[Wikipedia]: The network of physical objects or things embedded
with electronics, software, sensors, and connectivity to enable
objects to exchange data with the manufacturer, operator and/or
other connected devices.
What is IoT?
[WhatIs]: A scenario in which objects, animals or people are
provided with unique identifiers and the ability to transfer data
over a network without requiring human-to-human or
human-to-computer interaction.
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 29 / 40
30. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Things Connected Through Internet
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 30 / 40
31. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
IoT Applications
• Smart home
• Wearables
• Smart City
• Smart grids
• Industrial Internet
• Connected Car
• Connected Health
• Smart Retail
• Smart Supply Chain
• Smart Farming
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 31 / 40
32. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Top Free and Open Source IoT Projects
• AllSeen Alliance (Interoperability framework)
• DeviceHive (Big Data analytics)
• DSA (Distributed Services Architecture)
• Eclipse IoT (Java-based rules-based routing engine)
• Kaa (scalable end-to-end IoT framework )
• Macchina.io (Web-enabled, modular and extensible JavaScript
and C++ runtime)
• Open Connectivity Foundation (IoTivity)
• OpenIoT (Java-based connectivity framework)
• PlatformIO (Python-based suite for remote data access)
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 32 / 40
33. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Rise of Linux: IoT-ready Hardwares
• Yocto Project!!!
• Raspberry Pi
• Intel Edison
• Intel Joule
• BeagleBone Black
• Qualcomm DragonBoard
• MinnowBoard MAX
• Orange Pi
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 33 / 40
34. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
IoT and Linux
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 34 / 40
35. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Raspberry Pi
• SoC: Broadcom BCM2837
• CPU: 4 ARM Cortex-A53,
1.2GHz
• GPU: Broadcom
VideoCore IV
• RAM: 1GB LPDDR2 (900
MHz)
• Networking: Ethernet,
2.4GHz 802.11n wireless
• Bluetooth: Bluetooth 4.1
Low Energy
• Storage: microSD
• GPIO: 40-pin header
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 35 / 40
36. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Intel Edison
• CPU: Dual-core Intel Atom
@500 MHz
• RAM: 1 GB LPDDR3
• Storage: 4 GB eMMC + micro
SD card connector
• Connectivity: Dual band Wi-Fi
and Bluetooth 4.0
• USB: 1x micro USB connector
• I/Os:
• 2x UART
• 2x I2C
• 1x SPI with 2 chip
selects
• 1x I2S
• 12x GPIO including 4
capable of PWM output
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 36 / 40
37. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Intel Joule
• CPU: Intel Atom T5700 64-bit quad-core @1.7GHz/2.4GHz
• RAM: 4GB LPDDR4 RAM
• GPU: Intel HD Graphics with 4K video capture and display
• Storage: 16GB eMMC memory
• Connectivity: 802.11ac Wi-Fi with MIMO and Bluetooth 4.1
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 37 / 40
38. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Beyond the IoT: The Computation Thunderbolt
These devices can be utilized in standalone computations:
• Speech Recognition
• Machine Learning
• Image Processing
• Grid Computing
• Video Encoding/Decoding
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 38 / 40
39. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Conclusion
Why Reinvent The Wheel When You Don’t Have To???
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 39 / 40
40. Free Software: a Prison Break
Play Your Notes: Embedded Systems
Digital Electronics and Operating Systems
Real-Time OS: Dream or Reality??
Internet of Things: Domination of Free Software
Tehran Software Freedom Day
Thanks for Your Attention
Question & Answer
Mojtaba Barzegari 9/29/2016 Towards Embedded Systems 40 / 40