THE ACTOR MODEL APPLIED TO THE RASPBERRY PI AND THE EMBEDDED DOMAIN
Omer Kilic || @OmerK
Erlang Solutions Ltd.
1
THE ACTOR MODEL APPLIED TO THE RASPBERRY PI AND THE EMBEDDED DOMAIN - - PowerPoint PPT Presentation
THE ACTOR MODEL APPLIED TO THE RASPBERRY PI AND THE EMBEDDED DOMAIN Omer Kilic || @OmerK Erlang Solutions Ltd. 1 Agenda Current state of Embedded Systems Overview of the Actor Model Erlang Embedded Project Modelling and
Omer Kilic || @OmerK
Erlang Solutions Ltd.
1
01/10/2012 GOTO Aarhus
2
01/10/2012 GOTO Aarhus
An embedded system is a computer system designed for specific control functions within a larger system, often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts. By contrast, a general-purpose computer, such as a personal computer (PC), is designed to be flexible and to meet a wide range of end-user needs
– Infinite Wisdom of Wikipedia
3
01/10/2012 GOTO Aarhus
Source: http://embedded.com/electronics-blogs/programming-pointers/4372180/Unexpected-trends 4
01/10/2012 GOTO Aarhus
5
01/10/2012 GOTO Aarhus
scheduling guarantees, minimal jitter
6
01/10/2012 GOTO Aarhus
scheduling guarantees, minimal jitter
6
01/10/2012 GOTO Aarhus
7
01/10/2012 GOTO Aarhus
abundant supply of cheap boards
new territory for embedded engineers
tasks
8
01/10/2012 GOTO Aarhus
concurrent systems
languages
9
01/10/2012 GOTO Aarhus
functionality mailbox state
10
01/10/2012 GOTO Aarhus
11
01/10/2012 GOTO Aarhus
number_cruncher
11
01/10/2012 GOTO Aarhus
number_cruncher
{calc, Values}
11
01/10/2012 GOTO Aarhus
number_cruncher worker_a worker_b worker_c
{calc, Values}
11
01/10/2012 GOTO Aarhus
number_cruncher worker_a worker_b worker_c
{calc, ValSubsetA} {calc, ValSubsetB} {calc, ValSubsetA} {calc, Values}
11
01/10/2012 GOTO Aarhus
number_cruncher worker_a worker_b worker_c
{result, ResSubsetA} {result, ResSubsetB} {result, ResSubsetC}
12
01/10/2012 GOTO Aarhus
number_cruncher worker_a worker_b worker_c
{result, ResSubsetA} {result, ResSubsetB} {result, ResSubsetC} {result, Values}
12
01/10/2012 GOTO Aarhus
problematic for certain applications
processes
larger systems
13
01/10/2012 GOTO Aarhus
Solutions and University of Kent
systems development using Erlang to the field of embedded systems; through investigation, analysis, software development and evaluation.
14
01/10/2012 GOTO Aarhus
companies
15
01/10/2012 GOTO Aarhus
supervision hierarchies
16
01/10/2012 GOTO Aarhus
spawn(math, fact, [5]) Pid1
17
01/10/2012 GOTO Aarhus
spawn(math, fact, [5]) math:fact(5) Pid2 Pid1
17
01/10/2012 GOTO Aarhus
Pid2 Pid1 Pid2 ! {self(),msg}
18
01/10/2012 GOTO Aarhus
Pid2 Pid1 Pid2 ! {self(),msg} {Pid1,msg}
18
01/10/2012 GOTO Aarhus
PidB PidA link(PidB)
19
01/10/2012 GOTO Aarhus
PidB PidA link(PidB)
19
01/10/2012 GOTO Aarhus
Supervisor Worker
20
01/10/2012 GOTO Aarhus
PidA PidB PidC
21
01/10/2012 GOTO Aarhus
PidA PidB PidC
21
01/10/2012 GOTO Aarhus
PidB {'EXIT', PidA, Reason} PidC
21
01/10/2012 GOTO Aarhus
PidB PidC
21
01/10/2012 GOTO Aarhus
PidC {'EXIT', PidB, Reason}
21
01/10/2012 GOTO Aarhus
21
01/10/2012 GOTO Aarhus
PidA PidC PidB
22
01/10/2012 GOTO Aarhus
PidA PidC PidB
22
01/10/2012 GOTO Aarhus
{'EXIT', PidA, Reason} PidC PidB
22
01/10/2012 GOTO Aarhus
PidC PidB
22
01/10/2012 GOTO Aarhus
used to interface external world to the Erlang runtime.
app hw_if hw_driver.c
Erlang VM
23
01/10/2012 GOTO Aarhus
(flickr/dereckesanches)
24
01/10/2012 GOTO Aarhus
Video, 3.5mm Stereo Jack, DSI, CSI-2)
25
01/10/2012 GOTO Aarhus
UK registered charity.
the study of computer science and related topics, especially at school level, and to put the fun back into learning computing."
(flickr/lebeus)
26
01/10/2012 GOTO Aarhus
27
01/10/2012 GOTO Aarhus
28
01/10/2012 GOTO Aarhus
http://vimeo.com/48375416
29
01/10/2012 GOTO Aarhus
pin17 proc_a {state, high}
30
01/10/2012 GOTO Aarhus
pin17 proc_a {state, high} proc_b {state, low} proc_c {state, high}
30
01/10/2012 GOTO Aarhus
pin17 proc_a {state, high}
proc_b {state, low} proc_c {state, high}
30
01/10/2012 GOTO Aarhus
GPIO proc_a pin17 {state, 17, high} proc_b {state, 17, low} proc_c {state, 17, high}
31
01/10/2012 GOTO Aarhus
embedded design
control, etc.
32
01/10/2012 GOTO Aarhus
33
01/10/2012 GOTO Aarhus
Component API
Universal Peripheral/Component Modules
Peripheral API Peripheral Implementation Platform Specific Universal
34
01/10/2012 GOTO Aarhus
Universal Peripheral/Component Modules
An Example:
TMP102 Temperature Sensor I2C Bus Driver Linux Kernel Driver Sensor API
I2C Bus Driver Linux sysfs
TMP102 Temperature Sensor I2C Bus Driver Linux Kernel Driver
Sensor API I2C Bus Driver BSD sysctl
TMP102 Temperature Sensor I2C Bus Driver Linux Kernel Driver
Sensor API I2C Bus Driver mmap()'ed register voodoo Temperature Sensor with I2C Interface
35
01/10/2012 GOTO Aarhus
TI OMAP Reference System
36
01/10/2012 GOTO Aarhus
(flickr/carrierdetect)
37
01/10/2012 GOTO Aarhus
38
01/10/2012 GOTO Aarhus
39
01/10/2012 GOTO Aarhus
40
01/10/2012 GOTO Aarhus
developing the next generation of concurrent/ distributed Embedded Systems
Erlang Embedded Framework Erlang/OTP 101 Embedded Linux Primer Hardware Platform
Get in touch if you’re interested.
41
01/10/2012 GOTO Aarhus
Any sufficiently complicated concurrent program in another language contains an ad-hoc, informally- specified, bug-ridden, slow implementation of half of Erlang.
– Robert Virding
Co-Inventor of Erlang
42