1. Part
2
:
Code
Reading
of
F9
Microkernel
Scheduling
ben6
2013-‐11-‐18
2. F9
Agenda
• Brief
of
F9
Microkernel
Scheduling
• All
about
Algorithms
• Scheduling
Code
reading
3. F9
Agenda
• Brief
of
F9
Microkernel
Scheduling
• All
about
Algorithms
• Scheduling
Code
reading
4. F9
Microkernel
Overview
• an
experimental
microkernel
used
to
construct
flexible
embedded
systems
inspired
by
famous
L4
microkernel.
• The
moMvaMon
of
F9
microkernel
is
to
deploy
modern
kernel
techniques
to
support
– running
real-‐Mme
and
Mme-‐sharing
applicaMons
(ex:
wireless
communicaMons)
for
ARM
Cortex-‐M
series
microprocessors
with
efficiency
(performance
+
power
consumpMon)
– security
(memory
protecMon
+
isolated
execuMon)
6. Mckless
scheduler
• F9
implements
a
Mckless
scheduler
which
implies
the
dynamic
Mmer.
• You
can
track
the
development
here:
hWps://github.com/southernbear/RIOT/wiki/
Development
• F9
follows
some
concepts
about
TiROS
for
Mckless:
hWp://Mros.sourceforge.net/
7. F9
Agenda
• Brief
of
F9
Microkernel
Scheduling
• All
about
Algorithms
• Scheduling
Code
reading
8. Tickless
Scheduling
• Reference
concept
of
TiROS
• TiROS
avoids
most
context-‐switching
overhead
costs
by
eliminaMng
periodic
Mcks.
• Most
embedded
real-‐Mme
OSes,
a
trade
off
between
high
Mme-‐resoluMon
(by
increasing
Mck
frequency)
and
overhead.
• TiROS
does
not
use
Mcks
and
achieves
high-‐
Mme
resoluMon
with
very
low
overhead.
9. F9
Agenda
• Brief
of
F9
Microkernel
Scheduling
• All
about
Algorithms
• Scheduling
Code
reading
21. __NAKED
• __aWribute__((naked))
Using
While
IRQ
funcMon
Use
this
aWribute
on
the
ARM,
AVR,
MCORE,
MSP430,
NDS32,
RL78,
RX
and
SPU
ports
to
indicate
that
the
specified
funcMon
does
not
need
prologue/epilogue
sequences
generated
by
the
compiler.
It
is
up
to
the
programmer
to
provide
these
sequences.
The
only
statements
that
can
be
safely
included
in
naked
funcMons
are
asm
statements
that
do
not
have
operands.
All
other
statements,
including
declaraMons
of
local
variables,
if
statements,
and
so
forth,
should
be
avoided.
Naked
funcMons
should
be
used
to
implement
the
body
of
an
assembly
funcMon,
while
allowing
the
compiler
to
construct
the
requisite
funcMon
declaraMon
for
the
assembler.