code:
SHELL := bash

PWD := $(shell pwd)

CHAPTERS := introduction \
            getting_started \
            architecture \
            components \
            development \
            system_configuration \
            under_the_hood \
            functional_specification

REPO_URL := https://github.com/genodelabs/genode/blob/20.05

# return list of sections for given basename of chapter
sections = $(shell ./splitter/filter-sec.sh list < ../$1.txt)

#
# Disarm the section-list parsing whenever the Makefile is invoked by
# epub_html.gosh for creating a png image.
#
ifneq ($(filter %.png,$(MAKECMDGOALS)),)
sections =
endif

# return Nth path element
second_elem = $(word 2,$(subst /, ,$1))
third_elem  = $(word 3,$(subst /, ,$1))

# populate 'SECTIONS(i)' variables, using the chapter as index
$(foreach C,$(CHAPTERS),$(eval SECTIONS($C) := $(call sections,$C)))

ALL_SECTIONS := $(foreach C,$(CHAPTERS),\
                   $(foreach S,${SECTIONS($C)},\
                      $C/$S))

ALL_SECTIONS_TXT  := $(addprefix sections/,$(addsuffix .txt,$(ALL_SECTIONS)))
ALL_CHAPTERS_TXT  := $(addprefix chapters/,$(addsuffix .txt,$(CHAPTERS)))
ALL_SECTIONS_HTML := $(addprefix html/,$(addsuffix .html,$(ALL_SECTIONS)))
ALL_CHAPTERS_INDEX_HTML := $(addprefix html/,$(addsuffix /index.html,$(CHAPTERS)))
ALL_HTML := $(ALL_SECTIONS_HTML) $(ALL_CHAPTERS_INDEX_HTML) html/index.html

# gosh arguments used for all html documents
GOSH_DOC_ARGS :=  --style ../epub/epub_html \
                  --web-build \
                  --html-xrefs xrefs \
                  --code-refs class_index \
                  --repo-url $(REPO_URL) \
                  --stylesheet style.css

default: html/style.css html/bg_pattern.png $(ALL_HTML)

#
# Create img directory before generating html documents to allow epub_html.gosh
# to create the individual images as side effects of creating the html
# documents.
#
IMG_DIR_CONTENT := Makefile \
                   tikz-common.tex tikz-preamble.tex tikz-standalone.tex \
                   qt_avplay_screen.png

$(ALL_HTML): $(addprefix img/,$(IMG_DIR_CONTENT))
$(addprefix img/,$(IMG_DIR_CONTENT)):
	mkdir -p img
	ln -sf ../../../img/$(notdir $@) $@

# generate cross-reference index
xrefs: $(ALL_SECTIONS_TXT) $(ALL_CHAPTERS_TXT)
	( $(foreach C,$(CHAPTERS),\
	    gosh --style html_xrefs --html-path '$C/index.html' \
	         'chapters/$C.txt'; \
	    $(foreach S,${SECTIONS($C)},\
	      gosh --style html_xrefs --html-path '$C/$S.html' \
	           'sections/$C/$S.txt' | grep -v FAKE-CHAPTER; )) \
	) | sed -E 's/ (chapter|section) ([^ #]+)#[^ ]*$$/ \1 \2/' > $@

# generate class index based on the existing ../spec/class_index.mk
ifeq ($(wildcard ../spec/class_index.mk),)
$(error please create class index via 'make class_index.mk' in the spec/ directory)
endif

include ../spec/class_index.mk

$(ALL_SECTIONS_TXT) $(ALL_CHAPTERS_TXT): class_index

class_index: ../spec/class_index.mk
	@( $(foreach class,$(CLASSES),\
		echo '$(class) $(CLASS_HEADER($(class))) $(CLASS_NAME($(class)))';) \
	) > $@

# install images generated during the creation of the html documents
default: html/img
html/img: $(ALL_HTML)
.PHONY: html/img
html/img:
	mkdir -p $@
	cp img/*.png $@

# install CSS file
html/style.css: style.css
	mkdir -p $(dir $@)
	cp $< $@

# install background image
html/bg_pattern.png: bg_pattern.png
	mkdir -p $(dir $@)
	cp $< $@

#
# Main index.html file
#

html/index.html : xrefs
	mkdir -p $(dir $@)
	gosh $(GOSH_DOC_ARGS) --main-index <(echo '') > $@

#
# Chapter index.html files
#

# rule to extract only the intro of a chapter
chapters/%.txt:
	mkdir -p $(dir $@)
	./splitter/filter-sec.sh chapter < ../$*.txt > $@

# let each chapter index.html file depend from its corresponding chapter text
$(foreach C,$(CHAPTERS),$(eval html/$C/index.html : ../$C.txt))

# rule to generate index.html for a chapter
$(ALL_CHAPTERS_INDEX_HTML) : xrefs
	mkdir -p $(dir $@)
	gosh $(GOSH_DOC_ARGS) \
	     --basepath "../" --unique-name '$(call second_elem,$@)' \
	     'chapters/$(call second_elem,$@).txt' > '$@'

#
# Sections
#

# let each section text depend on its original chapter text
$(foreach C,$(CHAPTERS),\
   $(eval $(addprefix sections/$C/,$(addsuffix .txt,${SECTIONS($C)})) : ../$C.txt))

# rule to extract a section txt from a chapter,
# called with the pattern '<chapter>/<section>'
sections/%.txt:
	mkdir -p $(dir $@)
	./splitter/filter-sec.sh get '$(notdir $*)' \
	                          < ../$(firstword $(subst /, ,$*)).txt \
	                          > '$@'

# let each section HTML file depend from its corresponding section text
$(foreach S,$(ALL_SECTIONS),$(eval html/$S.html : sections/$S.txt))

# rule to generate HTML from a section txt
$(ALL_SECTIONS_HTML) : xrefs
	mkdir -p $(dir $@)
	chapter='$(call second_elem,$@)'; \
	section='$(call third_elem,$(basename $@))'; \
	gosh $(GOSH_DOC_ARGS) \
	     --basepath "../" --unique-name "$$section" \
	     --style ./splitter/skip-chapter.gosh \
	     "sections/$$chapter/$$section.txt" > '$@'

include ../epub/img.mk

clean:
	rm -rf sections chapters html xrefs img class_index

repo_name: Fhiss/genode

path: foundations/www/Makefile


code:
Instructions
============

To build the www version of the manual,

# Generate the spec/class_index.mk file by using the following command from
  within the manual/spec directory:

  ! make class_index.mk

  This step scans the Genode API for the list of classes. This information
  is later used to assemble the content of the "Functional Specification"
  chapter of the book.

# Generate the HTML files for the book by issueing 'make' from within the
  _www/_-directory.

# The generated HTML files reside at the _www/html/_ directory. The table
  of contents is located at _www/html/index.html_.

This directory is self-sufficient. It may be copied to a web server as is,
or you may browse it offline (e.g., via 'firefox html/index.html').

To remove the generated files, use 'make clean' from within the www/
directory.

About the web version
=====================

This is probably just a prototype. Known bugs / problems / missing features:
* API references are only simple hyperlinks to the corresponding header files
  on GitHub.
* Various hacks are used. Unexpected input might break something.
* Minor HTML bugs, e.g., broken footnotes

All links across the HTML documents are relative, but they assume a preserved
directory structure. So you can put all files as a whole into subdirectories as
long as you don't change the internal file structure.

path: foundations/www/README


code:
#!/bin/dash

#section filter for gosh docs
#It reads gosh doc from stdin. Results are written on stdout.
#The following modes are provided:
# * Generate gosh doc with all sections removed (mode: chapter)
# * Generate gosh doc with all but the requested section removed (mode: get)
#   * The second argument specifies the section to be extracted.
#   * Note: A dummy chapter headline is included because gosh can't read the
#     result otherwise.
# * List all sections (mode: list)
#
#Since GNU make doesn't like filenames with spaces, spaces in section names are
#replaced with _. The content of the generated gosh doc's, however, is not
#treated this way.
#
#Alternatively, we may implement these tasks within a gosh backend so that we
#don't have to re-implement the parsing code. However, gosh removes tables and
#footnotes before calling the backend's functions. So until gosh provides an
#appropriate switch option, we use this probably buggy shell filter.
#
# Additional requirements: GNU sed

err() {
	echo "$1" >&2
	exit 1
}

#return an ordered line number list of all section headlines
section_lines() {
	lister=$(cat << 'DELI'
N
#zero length lines would break the fancy length comparison, and they can't be
#headlines anyway
/^[^\n]+/ {
	#replace characters of the first line with #
	{
		#save both lines
		h
		#get first line
		s/\n.*//
		#replace it with #s for the length check
		s/./=/g
		#append both unmodified lines
		G
		#remove first, unmodified line
		s/\n.*\n/\n/
	}

	#print line number if we have a headline
	/(^[^\n]+)\n\1/ =
}
D
DELI
)
	lines=$(sed -r -n "$lister")
	for line in $lines; do
		#decr by 1, probably because of the double line reading in our sed code
		echo $(($line - 1))
	done
}

#print all lines before the $1nth line
#if $1 is an empty string, print all lines
keep_until_line() {
	if [ -n "$1" ]; then
		set -- $(($1 - 1))
	fi
	sed -n "1,${1:-\$} p"
}

get_doc() {
	printf '%s\n' "$doc"
}

do_list() {
	lister=$(get_doc | section_lines | sed 's/$/p/')
	get_doc | sed -n "$lister" | sed 's/ /_/g'
}

do_get() {
	target_line=-1
	#using a loop instead of sed magic, we avoid escaping for sed syntax
	for sec_line in $(get_doc | section_lines); do
		sec=$(get_doc | sed -n "${sec_line}p" | sed 's/ /_/g')
		if [ -1 -ne "$target_line" ]; then
			#In order to keep correct line numbers, we cut out the subsequent
			#sections first. The preceding part, however, is not cutted out within
			#this loop because the requested section may be the last one.
			doc=$(get_doc | keep_until_line "$sec_line")
			break
		elif [ "$1" = "$sec" ]; then
			target_line="$sec_line"
		fi
	done
	if [ -1 -eq "$target_line" ]; then
		err "section not found: $1"
	fi
	doc=$(get_doc | sed -n "$target_line,\$ p")

	printf '%s\n%s\n%s\n' 'FAKE-CHAPTER' \
	                      '############' \
	                      "$doc"
}

do_chapter() {
	first_sec_line=$(get_doc | section_lines | sed -n '1p')
	get_doc | keep_until_line "$first_sec_line"
}

doc=$(cat) #used only by the do_ functions and get_doc

if [ 0 -eq $# ]; then
	err "please specify one of the modes: list,get,chapter"
fi
if [ $1 = 'list' ]; then
	do_list
elif [ $1 = 'get' ]; then
	if [ 2 -ne $# ]; then
		err "please specify the section"
	fi
	do_get "$2"
elif [ $1 = 'chapter' ]; then
	do_chapter
else
	err "Invalid mode"
	exit 1
fi


code:
#skip chapter headlines
proc process_chapter_html {txtblock} {
	handle_txtblock chapter [lrange $txtblock 2 end]
}


code:
body {
	font: 100% "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif;
	background-color: transparent;
	background-image: url(bg_pattern.png);
	margin: 25px;
}

.content {
	background-color: #fff;
	max-width: 1000px;
	margin-left: auto;
	margin-right: auto;
	border-radius: 6px;
	padding: 8px 32px 16px 32px;
}

h1 {
	font-family: "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif;
	font-size: 160%;
	font-weight: 500;
}
h2 {
	font: 145% "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif;
}
h3 {
	font: 135% "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif;
}

pre {
	font-family: Monaco, monospace;
	border-left: 2px solid #ccc;
	overflow-x: auto;
}

tt { font-family: Monaco, monospace; }

a { text-decoration: none; }
a:link { color: #00a; }
a:visited { color: #44c; }
a:hover { color: #66f; }

p {
	line-height: 125%;
	text-align: justify;
}
p.direct-img {
	text-align: center;
}
img {
	max-width: 90%;
	max-height: 90vh;
}

/* fieldset */ .figure {
	display: block;
	text-align: center;
	border: 1px solid #888;
	max-width: 90%;
	margin-left: auto;
	margin-right: auto;
}
.caption {
	text-align: justify;
	display: block;
	margin-top: 6px;
}

ol.toc a.chapter {
	font-size: 135%;
	font-weight: 500;
}
ol { padding-left: 2em; }
ol li { margin-top: 2px; }
p.code-ref {
	background-color: #F0F0F0;
	border-style: solid;
	border-width: thin;
}


code:
SHELL := bash

default:
	@echo Create PDF from individual Tikz image
	@echo -e "\nusage: make <name.pdf>\n"

invoke_pdflatex = pdflatex -jobname $* \
                    "\input{tikz-standalone.tex} \input{$<} \end{document}"

%.pdf: %.tikz
	$(invoke_pdflatex)
	$(invoke_pdflatex)
	$(invoke_pdflatex)

#
# Make each target depend on common included files and the Makefile
#
TIKZ_FILES := $(wildcard *.tikz)
PDF_FILES  := $(TIKZ_FILES:.tikz=.pdf)

$(PDF_FILES): tikz-common.tex tikz-preamble.tex tikz-standalone.tex Makefile

path: img/Makefile


code:
\begin{tikzpicture}

	%
	% CPU nodes
	%

	\foreach \y in {0,1,...,4} {
		\foreach \x in {0,1,...,4} {
			\path (\x*4ex,-\y*4ex)
				node[ball color=black!60, circle,
				     inner sep=0.5ex, dropshadow] (cpu\x\y) {};
		}
	}

	%
	% Arrows between CPU nodes
	%

	\foreach \y in {0,1,...,4} {
		\foreach \prevx/\x in {0/1,1/2,2/3,3/4} {
			\draw[arrow, <->, opacity=0.3] (cpu\prevx\y) -- (cpu\x\y);
			\draw[arrow, <->, opacity=0.3] (cpu\y\prevx) -- (cpu\y\x);
		}
	}

	%
	% Color definitions for CPU affinity spaces
	%

	\definecolor{cpuall}    {rgb}{0.8,0.8,0.8}
	\definecolor{cpuyellow} {rgb}{1.0,0.95,0.6}
	\definecolor{cpured}    {rgb}{0.9,0.8,0.7}
	\definecolor{cpublue}   {rgb}{0.85,0.85,1.0}

	%
	% Component tree
	%

	\tikzstyle{treenode} = [component, path fading=flow fade,
	                        align=center, rounded corners=1,
	                        minimum width=7ex, minimum height=3ex]

	\path (cpu44)+(20ex,-1ex) node[treenode] (init) {Init};

	\path (init.north)  node[treenode, above=3ex,   bottom color=cpuyellow, xshift=-6ex] (init1)  {Init};
	\path (init.north)  node[treenode, above=8.5ex, bottom color=cpublue,   xshift=6ex]  (init2)  {Init};
	\path (init2.north) node[treenode, above=3.5ex, bottom color=cpured,    xshift=-6ex] (init21) {Init};

	%
	% Parent-child relationships
	%

	\tikzstyle{treechildarrow} = [arrow, thick, opacity=0.2]

	\path[treechildarrow] (init)  -- (init1);
	\path[treechildarrow] (init)  -- (init2);
	\path[treechildarrow] (init2) -- (init21);

	%
	% CPU affinity spaces
	%

	\tikzstyle{cpucompound} = [inner sep=0.9ex, rounded corners=3,
	                           draw, draw opacity=0.7,
	                           inner color=white]

	\tikzstyle{cpuall}    = [cpucompound, draw=cpuall!70!black,    outer color=cpuall]
	\tikzstyle{cpuyellow} = [cpucompound, draw=cpuyellow!70!black, outer color=cpuyellow]
	\tikzstyle{cpublue}   = [cpucompound, draw=cpublue!70!black,   outer color=cpublue]
	\tikzstyle{cpured}    = [cpucompound, draw=cpured!70!black,    outer color=cpured]

	\begin{scope}[on background layer]
		\node[fit=(cpu00) (cpu44), cpuall, inner sep=1.2ex] (cpucompoundall)    {};
		\node[fit=(cpu03) (cpu24), cpuyellow]               (cpucompoundyellow) {};
		\node[fit=(cpu10) (cpu42), cpublue]                 (cpucompoundblue)   {};
		\node[fit=(cpu31) (cpu31), cpured]                  (cpucompoundred)    {};
	\end{scope}

	%
	% Association of components with affinity spaces
	%

	\tikzstyle{treerelation} = [arrow, densely dashed]

	\draw[treerelation] (init)   -- (cpucompoundall.320);
	\draw[treerelation] (init1)  -- (cpucompoundyellow.25);
	\draw[treerelation] (init2)  -- (cpucompoundblue.340);
	\draw[treerelation] (init21) -- (cpucompoundred.45);

\end{tikzpicture}


code:
\begin{tikzpicture}[node distance=10ex]

	%
	% init
	%
	\labeledcompoundnode{init}
	                    {component}
	                    {Init}{

		\rpcobjectrnode{parentgui}{node distance=3.5ex}{}{Parent}
		\node[capability, right of=parentgui, opacity=0] (rootcap) {};
		\rpcobjectrnode{parentlauncher}{node distance=3.5ex, xshift=7ex,
		                                right of=rootcap, opacity=0.5}{}{Parent}
	}

	%
	% launcher
	%
	\labeledcompoundnode{launcher}
	                    {component, above=5ex of init, xshift=15ex}
	                    {Launcher}{
		\rpcobjectrnode{parentapplication}{node distance=3.5ex}{}{Parent}
		\downwardthreadnode{launcherthread}{below of=parentapplication,
		                                    text opacity=0, node distance=4ex}
		\node[capability, below=0ex of launcherthread] (launcherparentcap) {};
	}

	%
	% application
	%
	\labeledcompoundnode{application}
	                    {component, above=5ex of launcher, xshift=8ex,
	                     minimum width=15ex}
	                    {Application}{
		\downwardthreadnode{applicationthread}{text opacity=0}
		\node[capability, below=0ex of applicationthread] (applicationparentcap) {};
	}

	%
	% gui
	%
	\labeledcompoundnode{gui}
	                    {component, above=5ex of init, xshift=-12ex}
	                    {GUI}{
		\rpcobjectrnode{guiroot}{node distance=5ex}{3}{GUI root}
		\downwardthreadnode{guithread}{below of=guiroot, node distance=4ex}
		\node[capability, below=0ex of guithread] (guiparentcap) {};
	}

	\path[arrow] (guiparentcap) .. controls +(0,-4ex) and +(0,4ex)
	                            .. node [sloped=false, pos=0.6, xshift=-10ex]
	                            {$announce$("GUI", 3)} (parentguiobj);

	% capability delegations
%	\path [draw, dashed] (guirootcap)           .. controls +(5ex,-5ex) and +(0,5ex) .. (rootcap);
	\path [draw, dashed] (guiparentcap)         .. controls +(5ex,-5ex) and +(0,5ex) .. (parentguicap);
	\path [draw, dashed] (applicationparentcap) .. controls +(0ex,-5ex) and +(0,5ex) .. (parentapplicationcap);
	\path [draw, dashed] (launcherparentcap)    .. controls +(0ex,-5ex) and +(0,5ex) .. (parentlaunchercap);

\end{tikzpicture}


code:
\begin{tikzpicture}

	\labeledcompoundnode{app1}{component}{Server}{

		\node[dataspace, inner sep=0, minimum height=10ex, minimum width=10ex] (ds1) {
			Dataspace\\\\
			\begin{memrange}
				\alloc{2ex}{heapalloc1} \remembersouth{ar1}
				\alloc{1ex}{heapalloc2} \remembersouth{ab1}
				\alloc{2ex}{heapalloc1} \remembersouth{ar2}
				\alloc{1ex}{heapempty}
				\alloc{4ex}{heapalloc2} \remembersouth{ab2}
			\end{memrange}
		};

		\node[dataspace, inner sep=0, minimum height=10ex, right=4ex of ds1] (ds2) {
			Dataspace\\\\
			\begin{memrange}
				\alloc{5ex}{heapalloc2} \remembersouth{ab3}
				\alloc{1ex}{heapalloc1} \remembersouth{ar3}
				\alloc{1ex}{heapalloc1} \remembersouth{ar4}
				\alloc{3ex}{heapempty}
			\end{memrange}
		};

		\node[dataspace, inner sep=0, minimum height=10ex, right=4ex of ds2] (ds3) {
			Dataspace\\\\
			\begin{memrange}
				\alloc{3ex}{heapempty}
				\alloc{1ex}{heapalloc1} \remembersouth{ar5}
				\alloc{2ex}{heapempty}
				\alloc{1ex}{heapalloc2} \remembersouth{ab4}
				\alloc{3ex}{heapempty}
			\end{memrange}
		};

		\draw[arrow] (ds1.east) .. controls +(1ex,0.5ex) and +(-1ex,0.5ex) .. (ds2.west);
		\draw[arrow] (ds2.east) .. controls +(1ex,0.5ex) and +(-1ex,0.5ex) .. (ds3.west);

		\node[above=1ex of ds2, minimum height=2ex] (heaplabel) {};

		\node[fit=(ds1) (ds2) (ds3) (heaplabel), fill, fill opacity=0.01, draw, draw opacity=0.2, rounded corners,
		      inner sep=2ex] (heap) {};

		\path (heap.north west) node[compoundlabel] {Heap};

		% session objects
		\rpcobjectrnode{session1}{align=center, below=5ex of heap, xshift=-10ex}{}{Session}
		\rpcobjectrnode{session2}{align=center, below=5ex of heap, xshift=10ex}{}{Session}

		% allocations from left (red) session
		\foreach \i in {1,...,5}{
			\draw[arrow, red!70!black] (session1obj)
				.. controls +(0,4ex) and +(0,-8ex) .. (ar\i);
		}

		% allocations from right (blue) session
		\foreach \i in {1,...,4}{
			\draw[arrow, yellow!40!black] (session2obj)
				.. controls +(0,4ex) and +(0,-8ex) .. (ab\i);
		}
	}

\end{tikzpicture}


code:
\begin{tikzpicture}[scale=1.7, transform shape]

	\definecolor{regular} {rgb}{1,0.8,0.5}
	\definecolor{yellow}  {rgb}{1,0.8,0.1}
	\definecolor{initred} {rgb}{0.9,0.7,0.5}
	\definecolor{tcbred}  {rgb}{0.7,0.3,0.2}

	%
	% Tree nodes
	%

	\tikzstyle{treenode} = [component, path fading=flow fade,
	                        align=center, rounded corners=2,
	                        inner sep=0,
	                        minimum width=2ex, minimum height=2ex,
	                        top color=white, bottom color=regular]
	\tikzstyle{appnode}  = [treenode, top color=yellow, bottom color=yellow!80!black]
	\tikzstyle{initnode} = [treenode, top color=initred, bottom color=initred!80!black]

	\node[initnode] (init) {};

	\node[treenode, above=2ex of init, xshift=-2ex] (a1) {};
	\node[treenode, above=2ex of init, xshift=3ex]  (a2) {};

	\node[treenode, above=2ex of a1, xshift=-5ex] (a11) {};
	\node[treenode, above=2ex of a1, xshift=-1ex] (a12) {};
	\node[treenode, above=2ex of a2, xshift=-1ex] (a21) {};
	\node[treenode, above=2ex of a2, xshift=3ex]  (a22) {};

	\node[treenode, above=2ex of a12, xshift=-4ex] (a121) {};
	\node[treenode, above=2ex of a12, xshift=0ex]  (a122) {};
	\node[treenode, above=2ex of a12, xshift=4ex]  (a123) {};
	\node[treenode, above=2ex of a22, xshift=2ex]  (a221) {};

	\node[treenode, above=2ex of a121, xshift=-2ex] (a1211) {};
	\node[treenode, above=2ex of a121, xshift=2ex]  (a1212) {};
	\node[appnode,  above=2ex of a123, xshift=-2ex] (a1231) {};

	\node[treenode, above=2ex of a221, xshift=-2ex] (a2211) {};
	\node[treenode, above=2ex of a221, xshift=3ex]  (a2212) {};

	\node[treenode, above=2ex of a2211, xshift=-2ex] (a22111) {};
	\node[treenode, above=2ex of a2211, xshift=2ex]  (a22112) {};

	%
	% Arrows
	%

	\tikzstyle{owns} = [thick, fill=black!40!red, draw=black!40!red, ->, >= stealth]

	\path[owns] (init)  -- (a1);
	\path[owns] (init)  -- (a2);
	\path[owns] (a1)    -- (a11);
	\path[owns] (a1)    -- (a12);
	\path[owns] (a2)    -- (a21);
	\path[owns] (a2)    -- (a22);
	\path[owns] (a12)   -- (a121);
	\path[owns] (a12)   -- (a122);
	\path[owns] (a12)   -- (a123);
	\path[owns] (a22)   -- (a221);
	\path[owns] (a121)  -- (a1211);
	\path[owns] (a121)  -- (a1212);
	\path[owns] (a123)  -- (a1231);
	\path[owns] (a221)  -- (a2211);
	\path[owns] (a221)  -- (a2212);
	\path[owns] (a2211) -- (a22111);
	\path[owns] (a2211) -- (a22112);

	%
	% Outline around the TCB of the appnode
	%

	\tikzstyle{outline} = [inner sep=0ex]

	\node[outline, fit=(init)]  (oinit) {};
	\node[outline, fit=(a1)]    (o1)    {};
	\node[outline, fit=(a11)]   (o11)   {};
	\node[outline, fit=(a12)]   (o12)   {};
	\node[outline, fit=(a123)]  (o123)  {};
	\node[outline, fit=(a1231)] (o1231) {};

	\begin{scope}[on background layer]

		\tikzstyle{tcb} = [fill=tcbred, opacity=0.4, rounded corners=5, draw]

		\path[tcb] (oinit.south west)
		        -- (oinit.north west)
		        -- (o1.south west)
		        -- (o1.160)
		        -- (o11.300)
		        -- (o11.south west)
		        -- (o11.north west)
		        -- (o12.70)
		        -- (o123.200)
		        -- (o123.north west)
		        -- (o1231.south west)
		        -- (o1231.north west)
		        -- (o1231.north east)
		        -- (o1231.south east)
		        -- (o123.north east)
		        -- (o123.south east)
		        -- (o123.south)
		        -- (o12.20)
		        -- (o12.south east)
		        -- (o1.north east)
		        -- (o1.south east)
		        -- (oinit.north east)
		        -- (oinit.south east)
		        --cycle;

	\end{scope}

\end{tikzpicture}


code:
\begin{tikzpicture}

	\definecolor{plugincolor}    {rgb}{0.6,0.7,0.9}
	\definecolor{nitpickercolor} {rgb}{0.9,0.5,0.4}
	\definecolor{aroracolor}     {rgb}{0.6,0.8,0.7}

	\tikzstyle{treenode} = [component, path fading=flow fade,
	                        minimum width=12ex, minimum height=5ex, align=center,
	                        rounded corners=1]

	\tikzstyle{pluginnode}  = [treenode, bottom color=plugincolor]
	\tikzstyle{browsernode} = [treenode, bottom color=aroracolor]

	%
	% Components
	%

	% base system
	\node[treenode]                         (init)      {Init};
	\node[treenode, above=4ex of init]      (nitpicker) {Nitpicker\\GUI};
	\node[treenode, left=4ex of nitpicker]  (loader)    {Loader};
	\node[treenode, right=4ex of nitpicker] (launcher)  {Launcher};

	% browser
	\node[browsernode, above=12ex of launcher, xshift=3ex] (browser) {Web\\Browser\\\\};
	\path (browser.south) node[browsernode, above=0ex, shadow blur radius=0,
	                           minimum height=3ex] (tcpip) {TCP/IP};

	% plugin
	\node[pluginnode, above=5ex of loader]          (plugininit)      {Init};
	\node[pluginnode, above=4ex of plugininit]      (pluginnitpicker) {Nitpicker};
	\node[pluginnode, right=1ex of pluginnitpicker] (pluginnitfb)     {Virtual\\Framebuffer};
	\node[pluginnode, left=1ex of pluginnitpicker]  (pluginlauncher)  {Launcher};
	\node[pluginnode, above=4ex of pluginlauncher]  (pluginapp)       {App};

	%
	% Parent-child relationships
	%

	\tikzstyle{treechildarrow} = [arrow, thick, opacity=0.4]

	\path[treechildarrow] (init)                  -- (loader.south);
	\path[treechildarrow] (init)                  -- (nitpicker);
	\path[treechildarrow] (init)                  -- (launcher.south);
	\path[treechildarrow] (launcher)              -- (browser.south);
	\path[treechildarrow] (loader)                -- (plugininit);
	\path[treechildarrow] (plugininit)            -- (pluginnitpicker);
	\path[treechildarrow] (plugininit.north east) -- (pluginnitfb.south);
	\path[treechildarrow] (plugininit.north west) -- (pluginlauncher.south);
	\path[treechildarrow] (pluginlauncher)        -- (pluginapp);

	%
	% Session relationships
	%

	\tikzstyle{treesessionarrow} = [arrow, densely dashed]

	% launcher -> nitpicker
	\path[treesessionarrow] (launcher.210)
		.. controls +(0,-3ex) and +(0,-3ex) .. (nitpicker.330);

	% midway coordinate between browser and nitpicker
	\path (browser.180)+(-3ex,-14ex) coordinate (browsertonitpicker) {};

	% midway coordinate between browser and loader
	\path (browser.180)+(-4ex,-13ex) coordinate (browsertoloader) {};

	% browser -> nitpicker
	\path[treesessionarrow] (browser.180)
		.. controls +(180:3ex) and +(45:3ex) .. (browsertonitpicker)
		.. controls +(225:3ex) and +(90:3ex) .. (nitpicker.30);

	% browser -> loader
	\path[treesessionarrow] (browser.160)
		.. controls +(180:4.5ex) and +(45:3ex) .. (browsertoloader)
		.. controls +(225:3ex) and +(90:3ex) .. (loader.45);

	% plugin nitfb -> nitpicker
	\path[treesessionarrow] (pluginnitfb.300)
		.. controls +(0,-7ex) and +(0,7ex) .. (nitpicker);

	% plugin nitpicker -> plugin nitfb
	\path[treesessionarrow] (pluginnitpicker.330)
		.. controls +(0,-3ex) and +(0,-3ex) .. (pluginnitfb.210);

	% plugin launcher -> plugin nitpicker
	\path[treesessionarrow] (pluginlauncher.330)
		.. controls +(0,-3ex) and +(0,-3ex) .. (pluginnitpicker.210);

	% plugin app -> plugin nitpicker
	\path[treesessionarrow] (pluginapp.330)
		.. controls +(0,-3ex) and +(0,3ex) .. (pluginnitpicker.150);

	%
	% Background of the plugin nodes
	%

	% helper nodes around the components
	\node[fit=(plugininit),      inner sep=1ex] (plugininitoutline)      {};
	\node[fit=(pluginnitfb),     inner sep=1ex] (pluginnitfboutline)     {};
	\node[fit=(pluginnitpicker), inner sep=1ex] (pluginnitpickeroutline) {};
	\node[fit=(pluginapp),       inner sep=1ex] (pluginappoutline)       {};
	\node[fit=(pluginlauncher),  inner sep=1ex] (pluginlauncheroutline)  {};

	\begin{scope}[on background layer]

		\path[fill=plugincolor, fill opacity=0.2, draw=plugincolor, rounded corners=5]
			(plugininitoutline.south west)     --
			(plugininitoutline.south east)     --
			(plugininitoutline.15)             --
			(pluginnitfboutline.south)         --
			(pluginnitfboutline.south east)    --
			(pluginnitfboutline.north east)    --
			(pluginnitpickeroutline.120)       --
			(pluginappoutline.340)             --
			(pluginappoutline.north east)      --
			(pluginappoutline.north west)      --
			(pluginlauncheroutline.south west) --
			(pluginlauncheroutline.south)      --
			(plugininitoutline.165)            --cycle;
	\end{scope}

	%
	% Thick red border between browser and plugin
	%

	\path (browsertoloader)+(-1ex,1ex) coordinate (borderstart) {};
	\path (borderstart)+(0,24ex) coordinate (borderend) {};
	\path[ultra thick, draw=red!70!black, dashed]
		(borderstart) -- (borderend);

\end{tikzpicture}


code:
\begin{tikzpicture}

	\definecolor{arrowcol} {rgb}{0.7,0.8,0.9}

	\node[draw, dropshadow, path fading=flow fade, shape=double arrow,
	      draw opacity=0.5,
	      top color=arrowcol, bottom color=black!50!arrowcol,
	      double arrow head extend=1.5ex,
	      inner xsep=5ex, inner ysep=1.5ex]
	      (arrow) { };

	\node[left=0ex  of arrow, minimum width=30ex] {};
	\node[right=0ex of arrow, minimum width=30ex] {};

	\node[left=2ex  of arrow, yshift=0.1ex] { \Large Assurance };
	\node[right=2ex of arrow, yshift=-0.3ex] { \Large Scalability };

\end{tikzpicture}


code:
\begin{tikzpicture}

	\begin{timelinediagram}

		\renewcommand{\timestepvector}{0,-0.8}

		% initial timelines

		\path (0,0) node (timelineanchor) {};
		\newtimeline{server}
		\path (server) node[above, align=center] (serverlabel) {\normalsize Server\\};

		\path (timelineanchor)+(5.5,0) node (timelineanchor) {};
		\newtimeline{parent}
		\path (parent) node[above, align=center] (parentlabel) {\normalsize Parent\\};

		\path (timelineanchor)+(3.5,0) node (timelineanchor) {};
		\newtimeline{client}
		\path (client) node[above, align=center] (clientlabel) {\normalsize Client\\};

		\activate{client}
		\timestep

		% session request

		\transition{client}{parent}{}
		\node[align=center] at (transitionlabel) {call $cap_{parent}$ \\ session(id, name, args)};
		\timestep

		% parent notifies server about updated "session_requests"
		\draw[arrow, densely dotted] (parent) -- node[align=center] {"session requests" ROM \\ updated} (server);
		\transition{parent}{client}{return}

		\activate{server}
		\renewcommand{\timestepvector}{0,-0.4}
		\timestep
		\deactivate{client}
		\timestep
		\renewcommand{\timestepvector}{0,-0.8}

		% server picks up session requests

		\transition{server}{parent}{}
		\node[align=center] at (transitionlabel) {call $cap_{rom}$ \\ update};
		\renewcommand{\timestepvector}{0,-1}
		\timestep

		% parent generates "session_requests"

		\path (parent)+(-10ex,0) node [inner ysep=0, inner sep=0, umlinfo, anchor=east] (requestsrom) {\tiny
\begin{lstlisting}
<session_requests>
  <create name=...
          id=.../>
</session_requests>
\end{lstlisting}
};

		\draw[arrow, densely dashed] (parent) -- node {generate} (requestsrom);
		\timestep
		\renewcommand{\timestepvector}{0,-1}

		\transition{parent}{server}{return}

		\timestep

		% server creates session object

		\transition{server}{parent}{}
		\node[align=center] at (transitionlabel) {call $cap_{parent}$ \\ deliver id, $cap_{session}$};

		\renewcommand{\timestepvector}{0,-0.4}
		\timestep

		% parent notifies client
		\draw[arrow, densely dotted] (parent) -- node[align=center] {notify \\ session response} (client);
		\activate{client}

		\timestep
		\transition{parent}{server}{return}
		\timestep
		\deactivate{server}
		\timestep
		\renewcommand{\timestepvector}{0,-0.8}

		% cliend requests cap

		\transition{client}{parent}{}
		\node[align=center] at (transitionlabel) {call $cap_{parent}$ \\ session\_cap(id)};
		\timestep
		\transition{parent}{client}{}
		\node[align=center] at (transitionlabel) {return \\ $cap_{session}$};
		\timestep

	\end{timelinediagram}

	\begin{scope}[on background layer]
	\node[timelinegroup, fit=(serverlabel)  (server)] {};
	\node[timelinegroup, fit=(parentlabel)  (parent)] {};
	\node[timelinegroup, fit=(clientlabel)  (client)] {};
	\end{scope}

\end{tikzpicture}


code:
\begin{tikzpicture}

	\definecolor{slicecolor}{rgb}{0.4,0.5,0.9}

	\node[dataspace] (dataspace) {

		Dataspace \\\\
		\begin{tikzpicture}
			\node[draw, rectangle, fill=white, align=center] (currpos) {current\\position};

			\path (currpos) node[below=5ex, align=center] (wheel) {

				\begin{wheel}{12ex}
					\slices{30,40,...,120}{inner color=slicecolor!50!white,
					                       outer color=slicecolor, dropshadow}

					\rememberouter{120}{wheelsource}
					\rememberouter{30}{wheelsink}

					\rememberinner{30}{wheelcurr}
				\end{wheel}
			};
		\end{tikzpicture}
	};

	\node[above=0.5ex of dataspace] {\emph{shared between source and sink}};

	\tikzstyle{audiooutcomponent} = [component, minimum size=10ex]

	\node[audiooutcomponent, left=8ex of dataspace, yshift=-5ex] (source) {Source};

	\node[audiooutcomponent, right=8ex of dataspace, yshift=-5ex] (sink) {Sink};

	\path (sink.160)+(-3ex,0) coordinate (leftofsink160) {};
	\path (source.20)+(3ex,0) coordinate (rightofsource20) {};
	\path (dataspace.south)+(0,-6ex) coordinate (southofdataspace) {};

	% arrows

	\draw[arrow] (sink.160) -- (leftofsink160) |- (currpos);
	\draw[arrow] (currpos) -| (rightofsource20) -- (source.20);

	\draw[arrow, thick] (source.east) .. controls +(8ex,0) and +(120:6ex) .. (wheelsource);
	\draw[arrow, thick] (wheelsink) .. controls +(30:6ex) and +(-8ex,0) .. (sink.west);

	\draw[arrow, dashed]
		(sink.200) .. controls +(-8ex,0) and +(20ex,0) ..
		(southofdataspace) .. controls +(-20ex,0) and +(8ex,0) ..
		(source.340);
	\path (southofdataspace) node[above] {progress signal};

	\draw[arrow] (currpos) -- (wheelcurr);

\end{tikzpicture}


code:
\begin{tikzpicture}

	\tikzstyle{bstep} = [fill, fill opacity=0.1, text opacity=1, minimum width=16ex, minimum height=6ex]

	\node[bstep] (uboot) {U-Boot};

	\path (uboot.north east)+(-0ex,0) node[bstep, anchor=south west]
	      (bootstrap) {Bootstrap};

	\path (bootstrap.north east)+(-0ex,0) node[bstep, anchor=south west]
	      (core) {Core / Kernel};

	\path (core.north east)+(-0ex,0) node[bstep, anchor=south west]
	      (init) {Init};

	\path[draw, thick] (uboot.south west) -- (uboot.north west)
	   -- (bootstrap.west |- uboot.north) -- (bootstrap.north west)
	   -- (core.west |- bootstrap.north) -- (core.north west)
	   -- (init.west |- core.north) -- (init.north west) -- (init.north east);

	\path[draw] (uboot.north east) -- (uboot.north west);
	\path[draw] (bootstrap.north east) -- (bootstrap.north west);
	\path[draw] (core.north east) -- (core.north west);

	% artificially extend image to the right for visual balance
	\path (init.east |- core.north)+(16ex,0) coordinate (cpumodeeast);

	\path[draw=red!80!black, thick, densely dashed] (uboot.west |- core.north)+(-16ex,0)
	   -- node[pos=0.1, above] {user mode}
	      node[pos=0.1, below] {privileged mode} (init.east |- core.north);

	\tikzstyle{elfload} = [arrow, sloped=false];

	\path[elfload] (uboot.east)+(-2ex,0) .. controls +(5ex, -2ex) and +(2ex, -3ex)
	   .. node[pos=0.6, below=1ex, scale=0.8] {ELF load} (bootstrap.south);

	\path[elfload] (bootstrap.east)+(-2ex,0) .. controls +(5ex, -2ex) and +(2ex, -3ex)
	   .. node[pos=0.6, below=1ex, scale=0.8] {ELF load} (core.south);

	\path[elfload] (core.east)+(-2ex,0) .. controls +(5ex, -2ex) and +(2ex, -3ex)
	   .. node[pos=0.6, below=1ex, scale=0.8] {ELF load} (init.south);

	\path (bootstrap.east)+(-0ex,0) coordinate (mmuboundary);

	\path (init.north)+(0,2ex)   coordinate (northboundary);
	\path (uboot.south)+(0,-6ex) coordinate (southboundary);

	\path (bootstrap.west |- southboundary) node[below] {MMU disabled};
	\path (bootstrap.west |- southboundary) node[above, opacity=0.5] {physical memory};
	\path (init.west      |- southboundary) node[below] {MMU enabled};
	\path (init.west      |- southboundary) node[above, opacity=0.5] {virtual memory};

	\begin{scope}[on background layer]

		\definecolor{physicalcolor}    {rgb}{0.6,0.7,0.9}
		\definecolor{virtualcolor}     {rgb}{0.6,0.8,0.7}

		\path[fill=physicalcolor, fill opacity=0.2, draw=physicalcolor, rounded corners=0]
		   (uboot.west  |- southboundary) -- (uboot.west  |- northboundary) --
		   (mmuboundary |- northboundary) -- (mmuboundary |- southboundary) --cycle;

		\path[fill=virtualcolor, fill opacity=0.2, draw=virtualcolor, rounded corners=0]
		   (mmuboundary |- southboundary) -- (mmuboundary |- northboundary) --
		   (init.east   |- northboundary) -- (init.east   |- southboundary) --cycle;

	\end{scope}

\end{tikzpicture}


code:
\definecolor{filecolor} {rgb}{0.6,0.7,0.9}
\definecolor{dircolor}  {rgb}{0.8,0.7,0.6}

\tikzstyle{treenode} = [minimum height=3ex, anchor=north west, rounded corners=2,
                        fill opacity=0.3, draw opacity=0.4, text opacity=1,
                        inner sep=0.2ex]
\tikzstyle{dirnode}  = [treenode] %, fill=dircolor,  draw=dircolor]
\tikzstyle{filenode} = [treenode, fill=filecolor, draw=filecolor]

\tikzstyle{branch} = [draw, color=black!30!white, rounded corners=1]

\newcommand\advancelevel[1]{
	\path (anchor)+(0,-3.25ex) coordinate (anchor);

	% advance all anchors above level #1
	\foreach \i in {#1,...,10} {
		\path (anchor\i |- anchor) coordinate (anchor\i); }

	% branch to parent node
	\setcounter{decrhelper}{#1}
	\addtocounter{decrhelper}{-1}
	\path (anchor\arabic{decrhelper})+(1.5ex,-3ex) coordinate (branchfrom);
	\path (anchor#1)+(0,-1.5ex) coordinate (branchto);
	\path[branch] (branchfrom) -- (branchfrom |- branchto) -- (branchto);
}

\newcommand\dirstructure[1]{

	\foreach \i in {0,...,10} {
		\path (anchor)+(\i*3ex,0) coordinate (anchor\i); }

	%
	% lib/mk/spec/arm_v8
	%
	\advancelevel{1}
	\path (anchor1) node[dirnode] {lib/};

	\advancelevel{2}
	\path (anchor2) node[dirnode] {mk/};

	\advancelevel{3}
	\path (anchor3) node[dirnode] {spec/};

	\advancelevel{4}
	\path (anchor4) node[dirnode] {arm\_v8/};

	\advancelevel{5}
	\path (anchor5) node[filenode] {bootstrap-hw-#1.mk};

	\advancelevel{5}
	\path (anchor5) node[filenode] {core-hw-#1.mk};

	%
	% src/include/hw
	%

	\advancelevel{1}
	\path (anchor1) node[dirnode] {src/};

	\advancelevel{2}
	\path (anchor2) node[dirnode] {include/};

	\advancelevel{3}
	\path (anchor3) node[dirnode] {hw/};

	\advancelevel{4}
	\path (anchor4) node[dirnode] {spec/};

	\advancelevel{5}
	\path (anchor5) node[dirnode] {arm\_64/};

	\advancelevel{6}
	\path (anchor6) node[filenode] {#1\_board.h};

	%
	% src/bootstrap
	%

	\advancelevel{2}
	\path (anchor2) node[dirnode] {bootstrap/};

	\advancelevel{3}
	\path (anchor3) node[dirnode] {board/};

	\advancelevel{4}
	\path (anchor4) node[dirnode] {#1/};

	\advancelevel{5}
	\path (anchor5) node[filenode] {platform.cc};

	\advancelevel{5}
	\path (anchor5) node[filenode] {board.h};

	%
	% src/core
	%

	\advancelevel{2}
	\path (anchor2) node[dirnode] {core/};

	\advancelevel{3}
	\path (anchor3) node[dirnode] {board/};

	\advancelevel{4}
	\path (anchor4) node[dirnode] {#1};

	\advancelevel{5}
	\path (anchor5) node[filenode] {board.h};
}


code:
\begin{tikzpicture}

	\definecolor{containercolor} {rgb}{0.95,0.95,0.95}
	\definecolor{textcolor}      {rgb}{0.97,0.94,0.90}
	\definecolor{datacolor}      {rgb}{0.9,0.9,0.95}
	\definecolor{physicalcolor}  {rgb}{0.6,0.7,0.9}
	\definecolor{virtualcolor}   {rgb}{0.6,0.8,0.7}

	\tikzstyle{compound} = [draw, dropshadow, fill opacity=0.8, draw opacity=0.2,
	                        rounded corners=1]

	\tikzstyle{container}   = [compound, fill=containercolor]
	\tikzstyle{textsegment} = [compound, fill=textcolor]
	\tikzstyle{datasegment} = [compound, fill=datacolor]

	\node[container, minimum width=45ex, minimum height=48ex] (imageelf) {};
	\node[below=0.5ex of imageelf.north] {\texttt{image.elf}};

	\node[container, above=2ex of imageelf.south,
	      minimum width=40ex, minimum height=32ex] (imagedata) {};

	\node[textsegment, fill=physicalcolor!50!white, above=2ex of imagedata.north,
	      minimum width=40ex, minimum height=8ex] (imagetext) {};
	\node[below=0.5ex of imagetext.north, text opacity=0.5] {Executable};

	\node[below=3ex of imagetext.north] {\texttt{bootstrap/hw/bootstrap-hw-pine\_a64lts.o}};

	\node[textsegment, fill=virtualcolor!50!white, below=4ex of imagedata.north,
	      minimum width=35ex, minimum height=8ex] (coreobj) {};
	\node[below=0.5ex of coreobj.north, text opacity=0.5] {Executable};

	\node[below=3ex of coreobj.north] {\texttt{core/hw/core-hw-pine\_a64lts.a}};

	\node[container, below=2ex of coreobj.south,
	      minimum width=35ex, minimum height=16ex] (bootmodules) {};

	\node[below=0.5ex of bootmodules.north] {\texttt{var/run/log.boot\_modules.o}};

	\node[below=0.5ex of imagedata.north] {\texttt{core.elf}};

	\node[container, below=4ex of bootmodules.north, fill=white,
	      minimum width=30ex, minimum height=5ex, align=left] (bootmodulescontent)
	      {\texttt{config}\\ \texttt{init}\\ \texttt{ld.lib.so}\\ \texttt{test-log}};

\end{tikzpicture}


code:
\begin{tikzpicture}

	\begin{timelinediagram}

		\renewcommand{\timestepvector}{0,-0.8}

		% initial timelines

		\path (0,0) node (timelineanchor) {};
		\newtimeline{client}
		\path (client) node[above=2pt, align=center] (clientlabel) {\normalsize Client\\};

		\path (timelineanchor)+(2.5,0) node (timelineanchor) {};
		\newtimeline{servermain}
		\path (servermain) node[above=2pt, align=center] (serverlabel) {\normalsize Server\\};

		\path (timelineanchor)+(2.5,0) node (timelineanchor) {};
		\newtimeline{serverep}
		\node[draw, fill=white, align=center, dropshadow] at (serverep) (ep) {RPC\\Entrypoint};

		\path (timelineanchor)+(2.5,0) node (timelineanchor) {};
		\newtimeline{serverobjpool}
		\node[draw, fill=white, align=center, dropshadow] at (serverobjpool) (objpool) {Object\\pool};

		\path (timelineanchor)+(2.5,0) node (timelineanchor) {};
		\newtimeline{serverrpcobj}
		\node[draw, fill=white, align=center, dropshadow] at (serverrpcobj) (rpcobj) {RPC object\\ \textbf{a}};

		\activate{client}
		\timestep

		% invoke capability

		\transition{client}{serverep}{}
		\node[align=center] at (transitionlabel) {invoke \\ \textbf{$cap_a$}};
		\timestep
		\transition{serverep}{serverobjpool}{}
		\node[align=center] at (transitionlabel) {lookup by \\ \textbf{$cap_a$}};
		\timestep
		\renewcommand{\timestepvector}{0,-0.4}
		\draw[timelinemessage, dashed, shorten >= 0.0ex] (serverobjpool) -- node[above] {$lookup$} (serverrpcobj);
		\renewcommand{\timestepvector}{0,-0.8}
		\timestep
		\transition{serverobjpool}{serverep}{return \textbf{a}}
		\timestep
		\transition{serverep}{serverrpcobj}{dispatch}
		\renewcommand{\timestepvector}{0,-1}
		\timestep
		% remember current serverrpcobj position as node rpcfunction
		\node at (serverrpcobj) (rpcfunction) {};
		\timestep
		\renewcommand{\timestepvector}{0,-0.8}
		\transition{serverrpcobj}{serverep}{}
		% draw rpcfunction label on top of activetimeline of serverrpcobj
		\node[rotate=90] at (rpcfunction) {RPC function};
		\timestep
		\transition{serverep}{client}{reply}
		\timestep

	\end{timelinediagram}

	\begin{scope}[on background layer]
	\node[timelinegroup, fit=(serverlabel)  (serverrpcobj) (rpcobj)] {};
	\node[timelinegroup, fit=(clientlabel)  (client)] {};
	\end{scope}

\end{tikzpicture}


code:
\begin{tikzpicture}[node distance=1.5cm]

	\node (client) {$cap_{arg}$};

	\node[flowbox, below of=client, align=left] (lookupobj) {
		lookup object identity for $cap_{arg}$};

	\path[arrow, sloped=false] (client) -- (lookupobj);

	\labeledcompoundnode{clientcapspace}
	            {compound, right of=lookupobj, node distance=27ex}
	            {Client capability space}{
		\capspacenode{capspace}{5}{}
	}

	\path[arrow, dashed] (lookupobj) -- (clientcapspace);

	\node[flowdecision, below of=lookupobj] (lookupobjdecision) {success?};

	\path[arrow] (lookupobj) -- (lookupobjdecision);

	\node[flowbox, below of=lookupobjdecision, align=left] (search) {
		find cap for object identity};

	\path[arrow, sloped=false] (lookupobjdecision) -- node[right] {yes} (search);

	\node [kernelobj, left of=lookupobjdecision, yshift=2ex, node distance=20ex] (objectidentity)
	      {Object\\identity};

	\path[arrow, dashed] (lookupobjdecision.south)+(0,-1ex)
	      .. controls +(-2,0) and +(2,0) .. (objectidentity);

	\labeledcompoundnode{servercapspace}
	            {compound, left of=search, node distance=25ex}
	            {Server capability space}{
		\capspacenode{capspace}{5}{}
	}

	\path[arrow, dashed] (search) -- (servercapspace);

	\node[flowdecision, below of=search] (searchdecision) {found?};

	\path[arrow, sloped=false] (search) -- (searchdecision);

	\node[flowbox, below of=searchdecision, align=left] (translate) {
		$cap_{translated}$ = $cap_{found}$};

	\node[flowbox, left of=searchdecision, align=left, node distance=25ex] (newcap) {
		create and insert $cap_{new}$};

	\node[capability, left of=newcap, node distance=15ex] (cap) {};

	\path[arrow, dashed] (newcap) -- (cap);

	\path [arrow, dashed] (cap)
	      .. controls +(0,3) and +(-3,0) .. (objectidentity);

	\path[arrow, sloped=false] (searchdecision) -- node[right] {yes} (translate);

	\path[arrow, sloped=false] (searchdecision) -- node[above] {no} (newcap);

	\path[arrow, dashed] (newcap) -- (servercapspace);

	\node[flowbox, left of=translate, align=left, node distance=25ex] (returnnew) {
		$cap_{translated}$ = $cap_{new}$};

	\path[arrow, sloped=false] (newcap) -- (returnnew);

	\node[below of=translate] (server) {$cap_{translated}$};

	\path[arrow] (translate) -- (server);
	\path[arrow] (returnnew) |- +(0,-4ex) -| (server.north);

	\node[flowbox, right of=translate, align=left, node distance=25ex] (returninvalid) {
		$cap_{translated}$ = $invalid$};

	\path [arrow] (lookupobjdecision) -- node[pos=0.1] {no}
	     (returninvalid.north |- lookupobjdecision.east) --
	     node[right, align=left, sloped=false] {lookup\\failed} (returninvalid.north);

	\path[arrow] (returninvalid) |- +(0,-4ex) -| (server.north);

\end{tikzpicture}


code:
\begin{tikzpicture}

	\node [inner sep=0, outer sep=0] (anchor) {};

	%
	% Client PD
	%

	\labeledcompoundnode{clientpdcompound}
	                    {component,
	                     below=0ex of anchor,
	                     minimum width=10ex}
	                    {Client PD}{

	    \downwardthreadnode{clientthread}{outer sep=0.5ex}
		\node[capability, below of=clientthread] (delegatedcap) {5};

		% client invokes capability
		\path [arrow, right, rotate=90] (clientthread) -- node [xshift=1ex] {$call(fn, args)$} (delegatedcap);
	}

	%
	% Server PD
	%

	\labeledcompoundnode{serverpdcompound}
	                    {component,
	                     below=0ex of anchor,
	                     xshift=30ex}
	                    {Server PD}{
	    \node (vspace) {};

		\rpcobjectlnode{rpcobja}{below of=vspace}{3}{RPC object A}

		\rpcobjectlnode{rpcobjb}{below of=rpcobja, xshift=10ex}{7}{RPC object B}

		\node[below of=rpcobjb, minimum height=2ex] {};
	}

	\entrypointnode{ep}{}{serverpdcompound}

	\node[fit=(serverpdcompound) (clientpdcompound)] (userland) {};

	\kernelboundary{minimum width=58ex, node distance=0, minimum height=0,
	                below of=userland, yshift=-25ex}

	\coordinate (clientkernel) at (delegatedcap |- kernelboundary.north);
	\coordinate (serverkernel) at (epep |- kernelboundary.north);

	% client calls kernel
	\path [arrow, right] (delegatedcap)
	      -- node [rotate=90] {$call(5, fn, args)$} (clientkernel);

	% kernel IPC operation
	\draw [dotted] (clientkernel) -- +(0,-5ex) -| (serverkernel);

	% kernel delivers request to server
	\path [arrow, right] (serverkernel)
	      -- node [rotate=270] {$request(3, fn, args)$} (epep);

	% ep calls RPC object
	\coordinate[xshift=2ex] (rightofrpcobjb) at (rpcobjb.east)+(13ex,0);
	\path [arrow] (epep) -- +(0,3ex) -| (rightofrpcobjb) node[left, yshift=-4ex] {$A\rightarrow dispatch(fn, args)$} |- (rpcobja);

	% RPC object A executes member function
	\path [arrow] (rpcobjaobj.north)+(-1ex,0)
	      .. controls +(-1,1) and +(1,1) ..
	      node[xshift=6ex, yshift=-4ex] {$fn(args)$} (rpcobjaobj.north);

	% line to delegated cap
	\path [draw, dashed] (rpcobjacap) --
	      node [pos=0.7] {} (delegatedcap);

\end{tikzpicture}


code:
\begin{tikzpicture}

	\tikzstyle{captype} = [umlclass, minimum height=5.5ex, align=center,
	                       minimum width=9ex, top color=white,
	                       bottom color=black!5,
	                       draw opacity=0.4]

	\node[captype] (untyped) {Capability};

	\definecolor{dataspace} {rgb}{0.85,0.85,1.0}
	\definecolor{session} {rgb}{1,0.95,0.8}

	%
	% Capability types
	%
	\coordinate[below=2.5ex of untyped] (belowuntyped) {};
	\path[umlinherit] (belowuntyped) -- (untyped);

	\node[captype, below=1.5ex of belowuntyped, bottom color=session] (session)   {Session};
	\path (session)+(11ex,0) node[captype, bottom color=dataspace]      (dataspace) {Dataspace};
	\path (dataspace)+(11ex,0) node[captype]    (thread)    {Thread};
	\path (thread)+(11ex,0) node[captype]       (parent)    {Parent};
	\path (parent)+(11ex,0) node[captype]       (root)      {Root};
	\path (root)+(11ex,0) node[captype]         (sigctx)    {Signal\\context};

	\foreach \i in {session, dataspace, thread, parent, root, sigctx} {
		\draw (\i) |- (belowuntyped); }

	%
	% Dataspace types
	%
	\coordinate[below=2.5ex of dataspace] (belowdataspace) {};
	\path[umlinherit] (belowdataspace) -- (dataspace);

	\node[captype, bottom color=dataspace, below=1.5ex of belowdataspace] (ram)   {RAM};
	\path (ram)+(11ex,0) node[captype, bottom color=dataspace] (rom)   {ROM};
	\path (rom)+(11ex,0) node[captype, bottom color=dataspace] (iomem) {I/O\\mem};

	\foreach \i in {ram, rom, iomem} {
		\draw (\i) |- (belowdataspace); }

	%
	% Session types
	%
	\coordinate[below=12ex of session] (belowsession) {};
	\path[umlinherit] (belowsession) -- (session);
	\coordinate[below=4.5ex of belowsession] (currpos) {};

	\foreach \i in {CPU, IRQ, PD, RM, ROM} {

		\node[captype, bottom color=session] at (currpos)
			(currnode) {\i};
		\path (currnode)+(11ex,0) coordinate (currpos) {};
		\draw (currnode) |- (belowsession);
	}

	\coordinate[below=12ex of belowsession] (currpos) {};
	\coordinate[right=5.5ex of currpos] (currpos) {};

	\foreach \i in {I/O\\port, I/O\\mem, TRACE, LOG} {
		\node[captype, bottom color=session] at (currpos)
			(currnode) {\i};
		\path (currnode)+(11ex,0) coordinate (currpos) {};
		\draw (currnode) |- (belowsession);
	}

\end{tikzpicture}


code:
\begin{tikzpicture}

	\definecolor{configcomponentcolor}{rgb}{1,1,0.6}

	\tikzstyle{configcomponent} = [component,
	                               path fading=flow fade,
	                               rounded corners=2,
	                               minimum width=10ex,
	                               minimum height=7ex,
	                               bottom color=configcomponentcolor,
	                               font=\normalsize \sffamily]

	\tikzstyle{configarrow} = [arrow, sloped=false, left, align=right]

	\node[configcomponent]                        (core)     {Core};
	\node[configcomponent, above=7ex of core]     (init)     {Init};
	\node[configcomponent, above=7ex of init]     (launcher) {Launcher};
	\node[configcomponent, above=7ex of launcher] (init2)    {Init};

	\draw[configarrow] (init)     -- node {request\\"config"} (core);
	\draw[configarrow] (launcher) -- node {request\\"config"} (init);
	\draw[configarrow] (init2)    -- node {request\\"config"} (launcher);

	\tikzstyle{configrom} = [dropshadow, fill=white,
	                         chamfered rectangle,
	                         chamfered rectangle corners=north east]
	\tikzstyle{configrom1} = [configrom, minimum width=7ex, minimum height=9ex]
	\tikzstyle{configrom2} = [configrom, minimum width=7ex, minimum height=7.5ex]
	\tikzstyle{configrom3} = [configrom, minimum width=7ex, minimum height=6.5ex]

	\tikzstyle{config1}  = [inner sep=0, minimum width=5ex,   minimum height=6ex,    fill=black!15]
	\tikzstyle{config1o} = [inner sep=0, minimum width=5ex,   minimum height=6ex,    draw=black!35]
	\tikzstyle{config2}  = [inner sep=0, minimum width=4.5ex, minimum height=4.5ex,  fill=black!10, xshift=0.25ex, yshift=-0.5ex]
	\tikzstyle{config2o} = [inner sep=0, minimum width=4.5ex, minimum height=4.5ex,  draw=black!35, xshift=0.25ex, yshift=-0.5ex]
	\tikzstyle{config3}  = [inner sep=0, minimum width=4ex,   minimum height=3.5ex,  fill=black!5,  xshift=0.5ex, yshift=-0.5ex]
	\tikzstyle{config3o} = [inner sep=0, minimum width=4ex,   minimum height=3.5ex,  draw=black!35, xshift=0.5ex, yshift=-0.5ex]
	\tikzstyle{config4}  = [inner sep=0, minimum width=3.5ex, minimum height=0.5ex,  fill=black!0,  xshift=0.75ex, yshift=0.5ex]
	\tikzstyle{config5}  = [inner sep=0, minimum width=3.5ex, minimum height=0.75ex, fill=black!0,  xshift=0.75ex, yshift=-1.25ex]

	\tikzstyle{configmap} = [opacity=0.7, densely dotted]

	% config right of core

	\node[right=7ex of core, configrom1] (coreconfigrom) {};
	\path (coreconfigrom) node[config1] {};
	\path (coreconfigrom) node[config2] {};
	\path (coreconfigrom) node[config3] {};
	\path (coreconfigrom) node[config4] {};
	\path (coreconfigrom) node[config5] {};
	\path (coreconfigrom) node[config1o] (coreconfigcontent) {};

	\draw[configarrow, right] (coreconfigrom.north west)
		.. controls +(120:4ex) and +(290:4ex) .. node {response} (init.south east);

	% config right of init

	\node[right=7ex of init, configrom1] (initconfigrom) {};
	\path (initconfigrom) node[config1] {};
	\path (initconfigrom) node[config2] (initconfigromwindow) {};
	\path (initconfigrom) node[config3] {};
	\path (initconfigrom) node[config4] {};
	\path (initconfigrom) node[config5] {};
	\path (initconfigrom) node[config1o] (initconfigcontent) {};

	\draw[configmap] (coreconfigcontent.north west) -- (initconfigcontent.south west);
	\draw[configmap] (coreconfigcontent.north east) -- (initconfigcontent.south east);

	% launcher config snippet right of init

	\node[right=7ex of initconfigrom, configrom2, yshift=2ex] (initlauncherconfigrom) {};
	\path (initlauncherconfigrom) node[config2] {};
	\path (initlauncherconfigrom) node[config3] {};
	\path (initlauncherconfigrom) node[config4] {};
	\path (initlauncherconfigrom) node[config5] {};
	\path (initlauncherconfigrom) node[config2o] (initlauncherconfigcontent) {};

	\draw[configmap] (initconfigromwindow.north west) -- (initlauncherconfigcontent.north west);
	\draw[configmap] (initconfigromwindow.south east) -- (initlauncherconfigcontent.south east);

	\draw[configarrow, below] (initlauncherconfigrom.north west)
		.. controls +(120:4ex) and +(290:4ex) .. node {response} (launcher.south east);

	% config right of launcher

	\node[right=7ex of launcher, configrom2] (launcherconfigrom) {};
	\path (launcherconfigrom) node[config2] {};
	\path (launcherconfigrom) node[config3] (launcherconfigromwindow) {};
	\path (launcherconfigrom) node[config4] {};
	\path (launcherconfigrom) node[config5] {};
	\path (launcherconfigrom) node[config2o] (launcherconfigcontent) {};

	\draw[configmap] (initlauncherconfigcontent.north east) -- (launcherconfigcontent.north east);
	\draw[configmap] (initlauncherconfigcontent.south west) -- (launcherconfigcontent.south west);

	% init2 config snippet right of launcher

	\node[right=7ex of launcherconfigrom, configrom3, yshift=2ex] (launcherinit2configrom) {};
	\path (launcherinit2configrom) node[config3] {};
	\path (launcherinit2configrom) node[config4] {};
	\path (launcherinit2configrom) node[config5] {};
	\path (launcherinit2configrom) node[config3o] (launcherinit2configcontent) {};

	\draw[configmap] (launcherconfigromwindow.north west) -- (launcherinit2configcontent.north west);
	\draw[configmap] (launcherconfigromwindow.south east) -- (launcherinit2configcontent.south east);

	\draw[configarrow, below] (launcherinit2configrom.north west)
		.. controls +(120:4ex) and +(290:4ex) .. node {response} (init2.south east);

	% config right of init2

	\node[right=7ex of init2, configrom3] (init2configrom) {};
	\path (init2configrom) node[config3] {};
	\path (init2configrom) node[config4] {};
	\path (init2configrom) node[config5] {};
	\path (init2configrom) node[config3o] (init2configcontent) {};

	\draw[configmap] (launcherinit2configcontent.north east) -- (init2configcontent.north east);
	\draw[configmap] (launcherinit2configcontent.south west) -- (init2configcontent.south west);

\end{tikzpicture}


code:
\begin{tikzpicture}

	\tikzstyle{creationcomponent} = [component, minimum width=60ex]

	\labeledcompoundnode{core}{creationcomponent}{Core}{

		\rpcobjectrnode{corermsession}{minimum width=0ex}{}{Region map}
		\rpcobjectrnode{coreramsession}{minimum width=0ex,
		                               below=1ex of corermsession, xshift=4ex}{}{PD session}

		% horizontal space
		\node[right=25ex of corermsession, minimum size=0] {};
	}

	\labeledcompoundnode{parent}{creationcomponent, above=2ex of core}{Parent}{

		\node[inner sep=0, minimum size=0, outer sep=0] (parentvm) {

			\begin{memrange}
				\alloc{0.5ex}{memreserved} \remembersouth{parentvmbase}
				\alloc{7.5ex}{memavail}
				\alloc{3ex}{memtext}
				\alloc{4ex}{memdata}
				\alloc{2ex}{memdata}
				\alloc{26ex}{memavail}
				\alloc{7ex}{memmanaged}
				\alloc{2ex}{memavail}
				% sum is 52
			\end{memrange}
		};
		\path (parentvm.north east) node[minimum size=0, above, left,
		                                 xshift=-3ex, yshift=1ex] {\tiny virtual memory};

		% vertical space
		\node[minimum size=0, below=4ex of parentvm] {};
	}

	\path (parent.south)+(0,3ex) coordinate (parentcapanchor) {};

	\path (coreramsessioncap |- parentcapanchor) node[capability, minimum size=2.3ex] (envramsessioncap) {};
	\draw[dashed] (coreramsessioncap) -- (envramsessioncap);

	\path (corermsessioncap |- parentcapanchor) node[capability, minimum size=2.3ex] (envrmsessioncap) {};
	\draw[dashed] (corermsessioncap) -- (envrmsessioncap);

	% association of the parent's region map with the parent's virtual memory
	\draw[dashed] (corermsessionobj.west)
	              .. controls +(-8ex,0) and +(-1ex,2ex) ..
	              (parentvmbase.west);

	\node[fit=(envrmsessioncap) (envramsessioncap) (corermsession) (coreramsession),
	      opacity=0.3, draw, rounded corners=5] (env) {};
	\path (env.north west) node[right, yshift=-1ex] {\scriptsize environment};

\end{tikzpicture}


code:
\begin{tikzpicture}

	\tikzstyle{creationcomponent} = [component, minimum width=60ex]

	\labeledcompoundnode{core}{creationcomponent}{Core}{

		\node[minimum width=0] (anchor) {};

		\rpcobjectrnode{coreromsession}{minimum size=0ex, align=center,
		                                right=2ex of anchor}{}{
			ROM session\\\\
			\begin{tikzpicture}[minimum width=0, minimum height=0]
				\node[dataspace, minimum width=3ex, minimum height=7ex,
				      rounded corners=0, align=center, inner sep=0] {
					\scriptsize Dataspace \\
					\begin{memrange}
						\alloc{1ex}{memreserved} \remembersouthwest{rombase}
						\alloc{2ex}{memtext}     \remembersouthwest{romtextbase}
						                         \remembersoutheast{romtextend}
						\alloc{3ex}{memdata}     \remembersoutheast{romend}
					\end{memrange}
				};
			\end{tikzpicture}
		}

		\rpcobjectrnode{corechildramsession}{minimum width=0ex,
		                               right=1ex of coreromsession,
		                                     align=center}{}{
			PD session\\\\
			\begin{tikzpicture}[minimum width=0, minimum height=0]
				\node[dataspace, minimum width=3ex, minimum height=7ex,
				      rounded corners=0, align=center, inner sep=0] {
					\scriptsize RAM Dataspace \\
					\begin{memrange}
						\alloc{7ex}{memdata} \remembersouthwest{database}
						                     \remembersoutheast{dataend}
					\end{memrange}
				};
			\end{tikzpicture}
		}

		\rpcobjectrnode{corechildrmsession}{minimum width=0ex,
		                                    right=1ex of corechildramsession
		                                    }{}{Region map}

		% horizontal space
	%	\node[right=25ex of corechildrmsession, minimum size=0] {};
	}

	\labeledcompoundnode{parent}{creationcomponent, above=2ex of core}{Parent}{

		\node[inner sep=0, minimum size=0, outer sep=0] (parentvm) {

			\begin{memrange}
				\alloc{0.5ex}{memreserved} \remembersouth{parentvmbase}
				\alloc{7.5ex}{memavail}
				\alloc{3ex}{memtext}
				\alloc{4ex}{memdata}
				\alloc{2ex}{memdata}
				\alloc{14ex}{memavail}
				\alloc{1ex}{memrodata} \remembersouthwest{parentrombase}
				\alloc{2ex}{memrodata}
				\alloc{3ex}{memrodata} \remembersoutheast{parentromend}
				\alloc{6ex}{memavail}
				\alloc{7ex}{memmanaged}
				\alloc{2ex}{memavail}
				% sum is 52
			\end{memrange}
		};

		\path (parentvm.north east) node[minimum size=0, above, left,
		                                 xshift=-3ex, yshift=1ex] {\tiny virtual memory};

		\downwardthreadnode{parentthread}{minimum size=0,
		                                  below=2ex of parentvmbase,
		                                  xshift=16ex}

		% vertical space
		\node[minimum size=0, below=8ex of parentvm] {};
	}

	\node[inner sep=0, minimum size=0, outer sep=0, above=4ex of parent] (childvm) {

		\begin{memrange}
			\alloc{0.5ex}{memreserved}
			\alloc{11.5ex}{memavail}
			\alloc{2ex}{memtext} \remembersouthwest{childtextbase}
			                     \remembersoutheast{childtextend}
			\alloc{7ex}{memdata} \remembersouthwest{childdatabase}
			                     \remembersoutheast{childdataend}
			\alloc{31ex}{memavail} \remembersoutheast{childvmend}
			% sum is 52
		\end{memrange}
	};

	\path (parent.south)+(0,3ex) coordinate (parentcapanchor) {};

	\path (coreromsessioncap |- parentcapanchor) node[capability, minimum size=2.3ex] (elfromsessioncap) {};
	\draw[dashed] (coreromsessioncap) -- (elfromsessioncap);

	\path (corechildramsessioncap |- parentcapanchor) node[capability, minimum size=2.3ex] (childramsessioncap) {};
	\draw[dashed] (corechildramsessioncap) -- (childramsessioncap);

	\path (corechildrmsessioncap |- parentcapanchor) node[capability, minimum size=2.3ex] (childrmsessioncap) {};
	\draw[dashed] (corechildrmsessioncap) -- (childrmsessioncap);

	\node[capability, minimum size=2.3ex, left=7ex of elfromsessioncap] (envramsessioncap) {};

	\node[capability, minimum size=2.3ex, left=2ex of envramsessioncap] (envrmsessioncap) {};

	% association of the child's region map with the child's virtual memory
	\draw[dashed] (corechildrmsessioncap.east)
	              .. controls +(3ex,3ex) and +(8ex,2ex) ..
	              (childvmend.east);

	% association of the dataspace with the parent's virtual address space
	\draw[densely dotted] (rombase) -- (parentrombase);
	\draw[densely dotted] (romend) -- (parentromend);

	% association of the ELF dataspace with the child's virtual address space
	\draw[densely dotted] (romtextbase) -- (childtextbase);
	\draw[densely dotted] (romtextend) -- (childtextend);

	% association of the RAM dataspace with the child's virtual address space
	\draw[densely dotted] (database) -- (childdatabase);
	\draw[densely dotted] (dataend) -- (childdataend);

	% parent environment
	\node[fit=(envrmsessioncap) (envramsessioncap),
	      opacity=0.3, draw, rounded corners=5] (env) {};

	\path[arrow, sloped=false] (parentthread.south)
		.. controls +(4ex,0) and +(0,4ex) ..
		node[below, pos=0.4] {\scriptsize alloc} (childramsessioncap);

	\path[arrow, sloped=false] (parentthread.south)
		.. controls +(4ex,0) and +(0,4ex) ..
		node[above, pos=0.7] {\scriptsize attach} (childrmsessioncap);

\end{tikzpicture}


code:
\begin{tikzpicture}

	\tikzstyle{creationcomponent} = [component, minimum width=60ex]

	\labeledcompoundnode{core}{creationcomponent, inner sep=2ex}{Core}{

		\rpcobjectrnode{corermsession}{minimum width=0ex}{}{Region map}
		\rpcobjectrnode{corepdsession}{minimum width=0ex,
		                               below=1ex of corermsession, xshift=4ex}{}{PD session}

		\rpcobjectrnode{coreromsession}{minimum size=0ex, align=center,
		                                right=3ex of corepdsession}{}{
			ROM session\\\\
			\begin{tikzpicture}[minimum width=0, minimum height=0]
				\node[dataspace, minimum width=3ex, minimum height=7ex,
				      rounded corners=0, align=center, inner sep=0] {
					\scriptsize Dataspace \\
					\begin{memrange}
						\alloc{1ex}{memreserved} \remembersouthwest{rombase}
						\alloc{2ex}{memtext}
						\alloc{3ex}{memdata}     \remembersoutheast{romend}
					\end{memrange}
				};
			\end{tikzpicture}
		}

		\rpcobjectrnode{corechildpdsession}{minimum width=0ex,
		                                    right=1ex of coreromsession
		                                    }{}{PD session}
	}

	\labeledcompoundnode{parent}{creationcomponent, above=2ex of core}{Parent}{

		\node[inner sep=0, minimum size=0, outer sep=0] (parentvm) {

			\begin{memrange}
				\alloc{0.5ex}{memreserved} \remembersouth{parentvmbase}
				\alloc{7.5ex}{memavail}
				\alloc{3ex}{memtext}
				\alloc{4ex}{memdata}
				\alloc{2ex}{memdata}
				\alloc{14ex}{memavail}
				\alloc{1ex}{memrodata} \remembersouthwest{parentrombase}
				\alloc{2ex}{memrodata}
				\alloc{3ex}{memrodata} \remembersoutheast{parentromend}
				\alloc{6ex}{memavail}
				\alloc{7ex}{memmanaged}
				\alloc{2ex}{memavail}
				% sum is 52
			\end{memrange}
		};

		\path (parentvm.north east) node[minimum size=0, above, left,
		                                 xshift=-3ex, yshift=1ex] {\tiny virtual memory};

		\downwardthreadnode{parentthread}{minimum size=0, below=2ex of parentvmbase,
		                                  xshift=-4ex}

		% vertical space
		\node[minimum size=0, below=8ex of parentvm] {};
	}

	\path (parent.south)+(0,3ex) coordinate (parentcapanchor) {};

	\path (corepdsessioncap |- parentcapanchor) node[capability, minimum size=2.3ex] (envpdsessioncap) {};
	\draw[dashed] (corepdsessioncap) -- (envpdsessioncap);

	\path (corermsessioncap |- parentcapanchor) node[capability, minimum size=2.3ex] (envrmsessioncap) {};
	\draw[dashed] (corermsessioncap) -- (envrmsessioncap);

	\path (coreromsessioncap |- parentcapanchor) node[capability, minimum size=2.3ex] (elfromsessioncap) {};
	\draw[dashed] (coreromsessioncap) -- (elfromsessioncap);

	\path (corechildpdsessioncap |- parentcapanchor) node[capability, minimum size=2.3ex] (childpdsessioncap) {};
	\draw[dashed] (corechildpdsessioncap) -- (childpdsessioncap);

	% association of the dataspace with the parent's virtual address space
	\draw[densely dotted] (rombase) -- (parentrombase);
	\draw[densely dotted] (romend) -- (parentromend);

	% parent environment
	\node[fit=(envrmsessioncap) (envpdsessioncap) (corermsession) (corepdsession),
	      opacity=0.3, draw, rounded corners=5] (env) {};

	\tikzstyle{quotatransfer} = [opacity=0.4,
	                         decoration={markings,
	                         mark=between positions 0.03 and 1 step 1ex with {\arrow{latex}}},
	                         postaction={decorate}]

	\path [quotatransfer] (corepdsessionobj)
		.. controls +(0,-10ex) and +(1ex,-8ex) ..
		(corechildpdsessionobj);

	\path[arrow, sloped=false] (parentthread.south)
		.. controls +(4ex,0) and +(0,4ex) ..
		node[below, pos=0.4] {\scriptsize attach} (envrmsessioncap);

	\path[arrow, sloped=false] (parentthread.south)
		.. controls +(4ex,0) and +(0,4ex) ..
		node[above, pos=0.7] {\scriptsize ref account, transfer quota} (envpdsessioncap);

\end{tikzpicture}


code:
\begin{tikzpicture}

	\tikzstyle{creationcomponent} = [component, minimum width=60ex]

	\labeledcompoundnode{core}{creationcomponent}{Core}{

		\node[minimum width=0] (anchor) {};

		\rpcobjectrnode{corechildpdsession}{minimum width=0ex,
		                                    right=12ex of anchor
		                                    }{}{PD session}

		\rpcobjectrnode{corechildcpusession}{minimum width=0ex,
		                                     below=1ex of corechildpdsession,
		                                     xshift=4ex,
		                                    }{}{CPU session}

		\rpcobjectrnode{corechildregionmap}{minimum width=0ex,
		                                    right=6ex of corechildpdsession,
		                                    align=center}{}{Region map}
	}

	\labeledcompoundnode{parent}{creationcomponent, above=2ex of core}{Parent}{

		\node[inner sep=0, minimum size=0, outer sep=0] (parentvm) {

			\begin{memrange}
				\alloc{0.5ex}{memreserved} \remembersouth{parentvmbase}
				\alloc{7.5ex}{memavail}
				\alloc{3ex}{memtext}
				\alloc{4ex}{memdata}
				\alloc{2ex}{memdata}
				\alloc{26ex}{memavail}
				\alloc{7ex}{memmanaged}
				\alloc{2ex}{memavail}
				% sum is 52
			\end{memrange}
		};

		\rpcobjectrnode{parentrpcobj}{minimum width=0ex,
		                              below=2ex of parentvm,
		                              xshift=-20ex}{}{Parent}

		\path (parentvm.north east) node[minimum size=0, above, left,
		                                 xshift=-3ex, yshift=1ex] {\tiny virtual memory};

		\downwardthreadnode{parentthread}{minimum size=0,
		                                  below=2ex of parentvmbase,
		                                  xshift=13ex}

		% vertical space
		\node[minimum size=0, below=8ex of parentvm] {};
	}

	\labeledcompoundnode{child}{creationcomponent, above=2ex of parent}{Child}{

		\node[inner sep=0, minimum size=0, outer sep=0] (childvm) {

			\begin{memrange}
				\alloc{0.5ex}{memreserved} \remembersouth{childvmbase}
				\alloc{11.5ex}{memavail}
				\alloc{2ex}{memtext} \remembersouthwest{childtextbase}
				                     \remembersoutheast{childtextend}
				\alloc{7ex}{memdata} \remembersouthwest{childdatabase}
				                     \remembersoutheast{childdataend}
				\alloc{31ex}{memavail} \remembersoutheast{childvmend}
				% sum is 52
			\end{memrange}
		};

		\downwardthreadnode{childthread}{minimum size=0,
		                                 below=2ex of childvmbase, xshift=4ex}

		% vertical space
		\node[minimum size=0, below=2ex of childthread] {};
	}

	\path (parent.south)+(0,3ex) coordinate (parentcapanchor) {};

	\path (child.south)+(0,3ex) coordinate (childcapanchor) {};

	\path (corechildpdsessioncap |- parentcapanchor) node[capability, minimum size=2.3ex] (childpdsessioncap) {};
	\draw[dashed] (corechildpdsessioncap) -- (childpdsessioncap);

	\path (corechildregionmapcap |- parentcapanchor) node[capability, minimum size=2.3ex] (childregionmapcap) {};
	\draw[dashed] (corechildregionmapcap) -- (childregionmapcap);

	\path (corechildcpusessioncap |- parentcapanchor) node[capability, minimum size=2.3ex] (childcpusessioncap) {};
	\draw[dashed] (corechildcpusessioncap) -- (childcpusessioncap);

	\path (corechildpdsessioncap |- parentcapanchor) node[capability, minimum size=2.3ex] (childpdsessioncap) {};
	\draw[dashed] (corechildpdsessioncap) -- (childpdsessioncap);

	\path (parentrpcobjcap |- childcapanchor) node[capability, minimum size=2.3ex] (childparentcap) {};
	\draw[dashed] (parentrpcobjcap) -- (childparentcap);

	% association of the child's CPU session with the child's initial thread
	\draw[dashed] (corechildcpusessionobj.west)
	              .. controls +(-20ex,0ex) and +(-12ex,-2ex) ..
	              (childthread);

	% association of the child's PD session with the child's PD
	\draw[dashed] (corechildpdsessionobj.west)
	              .. controls +(-8ex,0ex) and +(-11ex,-8ex) ..
	              (childthread |- child.south);

	% association of the parent RPC object with the child's PD session
	\draw[dashed] (corechildpdsessionobj.west)
	              .. controls +(-4ex,0ex) and +(-4ex,-4ex) ..
	              (parentrpcobjobj);

	\path[arrow, sloped=false] (parentthread.south)
		.. controls +(4ex,0) and +(0,4ex) ..
		node[above, pos=0.5] {\scriptsize create thread} (childcpusessioncap);

\end{tikzpicture}


code:
\begin{tikzpicture}

	\definecolor{containercolor} {rgb}{0.95,0.95,0.95}
	\definecolor{textcolor}      {rgb}{0.97,0.94,0.90}
	\definecolor{datacolor}      {rgb}{0.9,0.9,0.95}
	\definecolor{physicalcolor}  {rgb}{0.6,0.7,0.9}
	\definecolor{virtualcolor}   {rgb}{0.6,0.8,0.7}

	\tikzstyle{container}   = [compound, fill=containercolor]
	\tikzstyle{textsegment} = [compound, fill=textcolor]
	\tikzstyle{datasegment} = [compound, fill=datacolor]

	\tikzstyle{code} = [minimum height=3ex];

	\coordinate (anchor);

	\path (anchor) node[anchor=north west, code] (class) { class Kernel::Cpu : };

	\path (class.north east) node[anchor=north west, code] (inherit1) { public Genode::Cpu, };
	\path (inherit1.south west) node[anchor=north west, code] (inherit2) { private Irq::Pool, };
	\path (inherit2.south west) node[anchor=north west, code] (inherit3) { private Timout };

	\path (class.west |- inherit3.south) coordinate (anchor);

	\path (anchor) node[anchor=north west, code] (openbrace) { \{ };

	\path (openbrace.south east) coordinate (member);

	\path (member) node[anchor=north west, code] (arbitrary) {...};

	\path (arbitrary.south west) node[anchor=north west, code] (idtype) {unsigned const};
	\path (idtype.north west) node[anchor=north west, code, xshift=15ex] (id) {\_id;};

	\path (idtype.south west) node[anchor=north west, code] (pictype) {Board::Pic};
	\path (pictype.north west) node[anchor=north west, code, xshift=15ex] (pic) {\_pic \{ \};};

	\path (pictype.south west) node[anchor=north west, code] (schedtype) {Cpu\_scheduler};
	\path (schedtype.north west) node[anchor=north west, code, xshift=15ex] (scheduler) {\_scheduler;};

	\path (schedtype.south west) node[anchor=north west, code] (arbitrary) {...};

	\path (arbitrary.south west) node[anchor=north west, code, yshift=-2ex] (constructor) {Cpu(unsigned id, ...)};

	\path (constructor.south west) node[anchor=north west, code] (initializer) {:};

	\path (initializer.south east) node[anchor=north west, code] (initid) {\_id(id),};
	\path (initid.south west) node[anchor=north west, code] (arbitrary) {...};

	\path (initializer.west |- arbitrary.south) coordinate (anchor);

	\path (anchor) node[anchor=north west, code] (constopenbrace) { \{ };
	\path (constopenbrace.south east) node[anchor=north west, code] (constcode) {...};

	\path (initializer.west |- constcode.south) coordinate (anchor);
	\path (anchor) node[anchor=north west, code] (constclosebrace) { \} };
	\path (constclosebrace.south west) node[anchor=north west, code, yshift=-2ex] (arbitrary) {...};

	\path (class.west |- arbitrary.south) coordinate (anchor);
	\path (anchor) node[anchor=north west, code] (closebrace) { \}; };

	\path (class.west |- arbitrary.north) coordinate (finish);

	\tikzstyle{controlflow} = [arrow, thick, red!70!black]

	\path[controlflow] (class.north west) .. controls +(1ex, 0ex) and +(-3ex, 3ex) .. (inherit1.north);

	\path[controlflow] (inherit1.east) .. controls +(2ex, -1ex) and +(2ex, 0ex) .. (inherit2.5);

	\path[controlflow] (inherit2.east) .. controls +(2ex, -1ex) and +(2ex, 0ex) .. (inherit3.5);

	\path[controlflow] (inherit3.east) .. controls +(2ex, -3ex) and +(-1ex, 5ex) .. (id);

	\path[controlflow] (id.west) .. controls +(-2ex, -1ex) and +(-2ex, 1ex) .. (pic.170);

	\path[controlflow] (pic.west) .. controls +(-2ex, -1ex) and +(-2ex, 1ex) .. (scheduler.175);

	\path[controlflow] (scheduler.185)+(0,-1ex) .. controls +(-18ex, -1ex) and +(-7ex, 6ex) .. (constopenbrace.north);

	\path[controlflow] (constclosebrace.east) .. controls +(3ex, -1ex) and +(7ex, 0ex) .. (finish);

	\path (scheduler.east)+(5ex,0) coordinate (anchor);

	\path[draw, ->, densely dotted, opacity=0.6] (initid.east)
	      -- (anchor |- initid.east) -- (anchor |- id.east) -- (id.east);

\end{tikzpicture}


code:
\begin{tikzpicture}

	\definecolor{containercolor} {rgb}{0.95,0.95,0.95}
	\definecolor{textcolor}      {rgb}{0.97,0.94,0.90}
	\definecolor{datacolor}      {rgb}{0.9,0.9,0.95}
	\definecolor{physicalcolor}  {rgb}{0.6,0.7,0.9}
	\definecolor{virtualcolor}   {rgb}{0.6,0.8,0.7}

	\tikzstyle{container}   = [compound, fill=containercolor]
	\tikzstyle{textsegment} = [compound, fill=textcolor]
	\tikzstyle{datasegment} = [compound, fill=datacolor]

	\tikzstyle{code} = [minimum height=3ex];
	\tikzstyle{log} = [code, color=green!60!black];

	\coordinate (anchor);

	\path (anchor) node[anchor=north west, code] (class) { class Kernel::Cpu : };

	\path (class.north east) node[anchor=north west, code] (inherit1) { public Genode::Cpu, };
	\path (inherit1.south west) node[anchor=north west, code] (inherit2) { private Irq::Pool, };
	\path (inherit2.south west) node[anchor=north west, code] (inherit3) { private Timout };

	\path (class.west |- inherit3.south) coordinate (anchor);

	\path (anchor) node[anchor=north west, code] (openbrace) { \{ };

	\path (openbrace.south east) coordinate (member);

	\path (member) node[anchor=north west, code] (arbitrary) {...};

	\path (arbitrary.south west) node[log, anchor=north west, code] (log)
	    {bool \_x1 = (Genode::log(\_\_FILE\_\_, ":", \_\_LINE\_\_), true);};

	\path (log.south west)+(0,-3ex) node[anchor=north west, code] (idtype) {unsigned const};
	\path (idtype.north west) node[anchor=north west, code, xshift=15ex] (id) {\_id;};

	\path (idtype.south west) node[anchor=north west, code] (pictype) {Board::Pic};
	\path (pictype.north west) node[anchor=north west, code, xshift=15ex] (pic) {\_pic \{ \};};

	\path (pictype.south west) node[anchor=north west, code] (schedtype) {Cpu\_scheduler};
	\path (schedtype.north west) node[anchor=north west, code, xshift=15ex] (scheduler) {\_scheduler;};

	\path (schedtype.south west) node[anchor=north west, code] (arbitrary) {...};

	\path (arbitrary.south west) node[anchor=north west, code, yshift=-2ex] (constructor) {Cpu(unsigned id, ...)};

	\path (constructor.south west) node[anchor=north west, code] (initializer) {:};

	\path (initializer.south east) node[anchor=north west, code] (initid) {\_id(id),};
	\path (initid.south west) node[anchor=north west, code] (arbitrary) {...};

	\path (initializer.west |- arbitrary.south) coordinate (anchor);

	\path (anchor) node[anchor=north west, code] (constopenbrace) { \{ };
	\path (constopenbrace.south east) node[anchor=north west, code] (constcode) {...};

	\path (initializer.west |- constcode.south) coordinate (anchor);
	\path (anchor) node[anchor=north west, code] (constclosebrace) { \} };
	\path (constclosebrace.south west) node[anchor=north west, code, yshift=-2ex] (arbitrary) {...};

	\path (class.west |- arbitrary.south) coordinate (anchor);
	\path (anchor) node[anchor=north west, code] (closebrace) { \}; };

	\path (class.west |- arbitrary.north) coordinate (finish);

	\tikzstyle{controlflow} = [arrow, thick, red!70!black]

	\path[controlflow] (class.north west) .. controls +(1ex, 0ex) and +(-3ex, 3ex) .. (inherit1.north);

	\path[controlflow] (inherit1.east) .. controls +(2ex, -1ex) and +(2ex, 0ex) .. (inherit2.5);

	\path[controlflow] (inherit2.east) .. controls +(2ex, -1ex) and +(2ex, 0ex) .. (inherit3.5);

	\path[controlflow] (inherit3.east) .. controls +(2ex, -3ex) and +(-1ex, 5ex) .. (log);

	\path[controlflow] (log.south) .. controls +(-2ex, -3ex) and +(1ex, 5ex) .. (id);

	\path[controlflow] (id.west) .. controls +(-2ex, -1ex) and +(-2ex, 1ex) .. (pic.170);

	\path[controlflow] (pic.west) .. controls +(-2ex, -1ex) and +(-2ex, 1ex) .. (scheduler.175);

	\path[controlflow] (scheduler.185)+(0,-1ex) .. controls +(-18ex, -1ex) and +(-7ex, 6ex) .. (constopenbrace.north);

	\path[controlflow] (constclosebrace.east) .. controls +(3ex, -1ex) and +(7ex, 0ex) .. (finish);

	\path (scheduler.east)+(5ex,0) coordinate (anchor);

	\path[draw, ->, densely dotted, opacity=0.6] (initid.east)
	      -- (anchor |- initid.east) -- (anchor |- id.east) -- (id.east);

\end{tikzpicture}


code:
\begin{tikzpicture}

%	\node at (-20ex,5ex) {};

	%
	% Protection domain 1
	%
	\labeledcompoundnode{pdcompound1}
	                    {component,
	                     minimum width=5ex,
	                     minimum height=5ex}
	                    {Protection domain 1}{
		\rpcobjectrnode{rpcobja}{}{3}{RPC object A}
	}

	\labeledcompoundnode{capspacecompound1}
	            {compound, below of=pdcompound1, node distance=17ex}
	            {Cap space 1}{
		\capspacenode{capspace1}{5}{}
	}

	\path [arrow] (rpcobjacap) .. controls +(0,-1) and +(0,1) .. (capspace13);

	\node [kernelobj, below of=capspacecompound1, node distance=12ex,
	       xshift=8ex] (objectidentity)
	      {Object\\identity\\A};

	\path [arrow, *->] (capspace13.center)
	      .. controls +(0,-1) and +(0,1) ..
	      node {} (objectidentity);

	\path [arrow, dashed] (rpcobjaobj.south west)
	      .. controls +(-2,-3) and +(-3,0) ..
	      node [pos=0.7] {owns} (objectidentity.west);

	%
	% Protection domain 2
	%
	\labeledcompoundnode{pdcompound2}
	                    {component, right of=pdcompound1,
	                     node distance=27ex,
	                     minimum width=22ex,
	                     minimum height=10ex}
	                    {Protection domain 2}{
		\node[capability] (delegatedcap) {5};
	}

	\labeledcompoundnode{capspacecompound2}
	            {compound, below of=pdcompound2, node distance=17ex}
	            {Cap space 2}{
		\capspacenode{capspace2}{5}{}
	}

	\path [arrow] (delegatedcap) .. controls +(0,-1) and +(0,1) .. (capspace25);

	\path [arrow, *->] (capspace25.center)
	      .. controls +(0,-1) and +(1,1) ..
	      node {} (objectidentity.north east);

	%
	% Protection domain 3
	%
	\labeledcompoundnode{pdcompound3}
	                    {component, right of=pdcompound2,
	                     node distance=27ex,
	                     minimum width=22ex,
	                     minimum height=10ex}
	                    {Protection domain 3}{
		\node[capability] (furtherdelegatedcap) {2};
	}

	\labeledcompoundnode{capspacecompound3}
	            {compound, below of=pdcompound3, node distance=17ex}
	            {Cap space 3}{
		\capspacenode{capspace3}{5}{}
	}

	\path [arrow] (furtherdelegatedcap) .. controls +(0,-1) and +(0,1) .. (capspace32);

	\path [arrow, *->] (capspace32.center)
	      .. controls +(0,-2) and +(1,0) ..
	      node {} (objectidentity.east);

	\delegationpath
	      (rpcobjacap)
	      .. controls +(0.3,-2.3) and +(-0.3,-2.3) ..
	      node [above=1ex] {delegate} (delegatedcap);

	\delegationpath
	      (delegatedcap)
	      .. controls +(0.3,-2.3) and +(-0.3,-2.3) ..
	      node [above=1ex] {delegate} (furtherdelegatedcap);

	\kernelboundary{fit=(capspacecompound1) (capspacecompound2)
	                    (capspacecompound3) (objectidentity)}

\end{tikzpicture}


code:
\usetikzlibrary{snakes}

\begin{tikzpicture}

	\definecolor{Color1} {rgb} {1.0,1.0,1.0}
	\definecolor{Color2} {rgb} {1,0.9,0.5}
	\definecolor{Color3} {rgb} {0.9,0.9,0.9}
	\definecolor{Color4} {rgb} {0.8,0.9,0.9}

	\def\CanvasHeight {41ex}
	\def\CanvasWidth  {66.5ex}

	\tikzstyle{ComponentStyle} = [
		component,
		rounded corners=0.5ex,
		very thin,
		draw=black,
		bottom color=Color2,
		align=center,
		minimum height=6ex,
		minimum width=14ex
	]

	\tikzstyle{TestStyle} = [
		component,
		rounded corners=0.5ex,
		very thin,
		draw=black,
		bottom color=Color3,
		align=center,
		minimum height=3ex,
		minimum width=4ex
	]

	\tikzstyle{SoftwareStyle} = [
		component,
		rounded corners=0ex,
		very thin,
		draw=black,
		bottom color=Color4,
		fill=Color1,
		align=center,
		minimum height=2.8ex,
		minimum width=13ex
	]

	\tikzstyle{Software1Style} = [
		component,
		rounded corners=0ex,
		very thin,
		draw=black,
		bottom color=Color1,
		fill=Color1,
		align=center,
		minimum height=2.8ex,
		minimum width=10ex
	]

	\tikzstyle{ComponentNameStyle} = [
		opacity=0.5,
		font=\sffamily\textbf\selectfont
	]

	\tikzstyle{Software1NameStyle} = [
		opacity=0.8,
		font=\sffamily\scriptsize\selectfont
	]

	\tikzstyle{ArrowStyle} = [
		arrow
	]

	\tikzstyle{ParentLineStyle} = [
		draw=black,
		opacity=0.2,
		very thick
	]

	%
	% Canvas
	%
	\node[minimum height=\CanvasHeight, minimum width=\CanvasWidth] (N0) {};

	%
	% VFS Server
	%
	\path (N0.north west)+(1ex,-14ex) coordinate (C1);
	\node[ComponentStyle, below right=0ex of C1] (N1) {};
	\node[ComponentNameStyle, below=0ex of N1.north] () {\scriptsize VFS Server};
	\node[Software1Style, above=7ex of N1] (N20) {};
	\node[Software1NameStyle, below=0ex of N20.north] () {depot.tar};
	\path[ArrowStyle] (N20) -- (N1);

	%
	% Depot Query
	%
	\path (N1.north east)+(2ex,0ex) coordinate (C1);
	\node[ComponentStyle, below right=0ex of C1] (N2) {};
	\node[ComponentNameStyle, below=0ex of N2.north] () {\scriptsize Depot Query};
	\path (N2.south)+(-2ex,0ex) coordinate (C1);
	\path (N2.south)+(1ex,0ex) coordinate (C2);
	\path (N1.north)+(4ex,0ex) coordinate (C13);
	\path (N2.north)+(-4ex,0ex) coordinate (C15);
	\path[ArrowStyle] (C15) .. controls ++(-1.5ex,3ex) and ++(1.5ex,3ex) .. (C13)
		node[midway,sloped,above right,inner sep=0.2ex] {\scriptsize\textit{read package}};

	%
	% Depot Query
	%
	\path (N2.north east)+(2ex,0ex) coordinate (C1);
	\node[ComponentStyle, below right=0ex of C1] (N3) {};
	\node[ComponentNameStyle, below=0ex of N3.north] () {\scriptsize Depot Autopilot};
	\path (N3.south)+(-4ex,0ex) coordinate (C1);
	\path (N3.south)+(-5ex,0ex) coordinate (C9);
	\path (N3.south)+(3ex,0ex) coordinate (C3);
	\path (N3.south)+(4ex,0ex) coordinate (C4);

	%
	% Timer
	%
	\path (N1.south west)+(0ex,-2ex) coordinate (C10);
	\node[ComponentStyle, below right=0ex of C10] (N12) {};
	\node[ComponentNameStyle, below=0ex of N12.north] () {\scriptsize Timer};

	\path[ArrowStyle] (C9) .. controls ++(-1ex,-5ex) and ++(1ex,-5ex) .. (C2)
		node[midway,sloped,above] {\scriptsize\textit{query}};
	\path[ArrowStyle] (N2.south) .. controls ++(1ex,-6.20ex) and ++(-1.4ex,-6.20ex) .. (C1)
		node[midway,sloped,below] {\scriptsize\textit{blueprint}};

	\path (N12.south east)+(0ex,1ex) coordinate (C14);
	\path[ArrowStyle] (N3.south) .. controls ++(-2ex,-16ex) and ++(6ex,-2ex) .. (C14)
		node[midway,sloped,below left] {\scriptsize\textit{test timeouts}};

	\path (C3)+(-1ex,0ex) coordinate (C21);
	\path (C3)+(-1.5ex,0ex) coordinate (C31);
	\path (C3)+(-1ex,-13ex) coordinate (C22);

	\path[ArrowStyle](C3) -- ++(0ex,-13ex) coordinate (C6);
	\path[ArrowStyle](C31)+(0ex,-13ex) -- (C31);
	\path(C6)+(-0.3ex,2ex) coordinate (C7);
	\node[above right=0ex of C7] (N11) {\scriptsize\textit{log}};
	\node[Software1Style, below left=0ex of C22, minimum height=7ex, minimum width=8.5ex] (N23) {};
	\node[below right=0ex of N23.north west] (N23) {\scriptsize{package}};
	\path(N23.west)+(0ex,-2ex) coordinate (C23);
	\node[right=0ex of C23] (N23) {\scriptsize{list}};

	\path(C6)+(-0.5ex,0ex) coordinate (C34);
	\node[Software1Style, below right=0ex of C34, minimum height=7ex, minimum width=8.5ex] (N11) {};
	\node[below right=0ex of N11.north west] (N11) {\scriptsize{test logs}};
	\path(N11.west)+(0ex,-2ex) coordinate (C11);
	\node[right=0ex of C11] (N11) {\scriptsize{result list}};
	\path(C11)+(0ex,-2ex) coordinate (C11);
	\node[right=0ex of C11] (N11) {\scriptsize{statistics}};

	%
	% Dynamic
	%
	\path (N3.north east)+(2ex,0ex) coordinate (C1);
	\node[ComponentStyle, below right=0ex of C1] (N4) {};
	\node[ComponentNameStyle, below=0ex of N4.north] () {\scriptsize Dynamic (Init)};

	\path[ArrowStyle] (C4) .. controls ++(1ex,-5ex) and ++(-1ex,-5ex) .. (N4.south)
		node[midway,sloped,below] {\scriptsize\textit{ reconfigure}};

	%
	% Runtime
	%
	\path (N4.north west)+(0.5ex,2ex) coordinate (C1);
	\node[TestStyle, above right=0ex of C1, minimum width=13ex] (N5) {};
	\path[ParentLineStyle] (N4) -- (N5);
	\node[ComponentNameStyle, below=0ex of N5.north] () {\scriptsize Test Runtime};

	%
	% Test components
	%
	\path (N5.north west)+(-0.6ex,1ex) coordinate (C1);
	\node[TestStyle, above right=0ex of C1] (N6) {};
	\path[ParentLineStyle] (N5) -- (N6);
	\node[TestStyle, right=1ex of N6] (N7) {};
	\path[ParentLineStyle] (N5) -- (N7);
	\node[TestStyle, right=1ex of N7] (N8) {};
	\path[ParentLineStyle] (N5) -- (N8);
	\path (N8.north west)+(-2.5ex,1ex) coordinate (C1);
	\node[TestStyle, above right=0ex of C1] (N9) {};
	\path[ParentLineStyle] (N8) -- (N9);
	\node[TestStyle, right=1ex of N9] (N10) {};
	\path[ParentLineStyle] (N8) -- (N10);

	\path (N5.south west)+(-2ex,0ex) coordinate (C1);
	\path (C1)+(0ex,10ex) coordinate (C2);
	\path (C1)+(-2.5ex,4.5ex) coordinate (C3);
	\path (C1)+(-2.5ex,5.5ex) coordinate (C4);

	\path (N1.north)+(2ex,0ex) coordinate (C30);
	\path[ArrowStyle] (C4) .. controls ++(-10ex,0ex) and ++(2ex,9ex) .. (C30)
		node[midway,above] {\scriptsize\textit{read binaries}};

	\path(N3.north)+(2ex,0ex) coordinate (C7);
	\path[ArrowStyle] (C3) .. controls ++(-20ex,0ex) and ++(0ex,6ex) .. (C7)
		node[midway,below] {\scriptsize\textit{logs}};

	\draw [snake=brace] (C1) -- (C2);

%	\path(N6.west)+(-10ex,0ex) coordinate (C1)
%	\path[ArrowStyle] (N9.west) .. controls ++(-5ex,-1ex) and ++(1ex,6ex) .. (N1.south)
%		node[midway,sloped,below] {\scriptsize\textit{read package}};

\end{tikzpicture}


code:
\begin{tikzpicture}

	\node (anchor) {};

	\labeledcompoundnode{driver}{component, below=0 of anchor}{Device driver}{

		\rpcobjectrnode{nicsession}{}{}{NIC session}

		\node[capability, below of=nicsession] (driveriomemcap) {};
		\node[capability, right of=driveriomemcap] (driverirqcap) {};
	}

	\labeledcompoundnode{nicclient}{component, below=0 of anchor, xshift=25ex,
	                                minimum width=10ex}{NIC client}{

		\node[capability] (nicclientcap) {};
	}

	\node[fit=(driver) (nicclient)] (components) {};

	\labeledcompoundnode{core}{component, node distance=18ex,
	                           below of=components}{Core}{

		\rpcobjectlnode{iomemsession}{}{}{IO-MEM session}

		\rpcobjectlnode{irqsession}{node distance=25ex, right of=iomemsession}{}{IRQ session}
	}

	% capability associations
	\path [draw, dashed] (iomemsessioncap) -- (driveriomemcap);
	\path [draw, dashed] (irqsessioncap)   -- (driverirqcap);
	\path [draw, dashed] (nicclientcap)    -- (nicsessioncap);

\end{tikzpicture}


code:
\begin{tikzpicture}

	\labeledcompoundnode{pdcompound}{component}{Protection domain}{
		\node[minimum width=15ex] {};
	}

	\entrypointnode{ep}{}{pdcompound}

\end{tikzpicture}


code:
\begin{tikzpicture}

	\tikzstyle{treenode} = [component, path fading=flow fade, align=center,
	                        rounded corners=1, minimum width=2ex,
	                        minimum height=2ex]

	\tikzstyle{treechildarrow} = [arrow, thick, opacity=0.2]

	\definecolor{dynamiccolor}     {rgb}{0.6,0.7,0.9}

	\tikzstyle{dynamicnode} = [treenode, bottom color=dynamiccolor]

	\node[dynamicnode] (dynamic) {Dynamic\\ Init};
	\node[treenode, left=4ex of dynamic] (manager) {Manager};

	% dynamically started components
	\node[dynamicnode, above=10ex of dynamic, xshift=-8ex] (child1) {Managed\\Child};
	\node[above=11ex of dynamic] (childx) {...};
	\node[dynamicnode, above=10ex of dynamic, xshift=8ex]  (child2) {Managed\\Child};
	\path[treechildarrow] (dynamic) -- (child1);
	\path[treechildarrow] (dynamic) -- (child2);

	% config / state information flow
	\tikzstyle{infoflow} = [opacity=0.3,
	                        decoration={markings,
	                        mark=between positions 0.03 and 1 step 1ex with {\arrow{latex}}},
	                        postaction={decorate}]

	\path[infoflow] (manager.320)
		.. controls +(2ex,-2ex) and +(-2ex,-2ex) .. node[below] {config (2)} (dynamic.south);
	\path[infoflow] (dynamic.120)
		.. controls +(-2ex,2ex) and +(2ex,2ex) .. node[above] {state (1)} (manager.60);

\end{tikzpicture}


code:
\begin{tikzpicture}

	\definecolor{corecolor} {rgb}{0.7,0.8,0.9}
	\definecolor{gdbmoncolor} {rgb}{1,0.8,0.7}

	\tikzstyle{treenode} = [component, path fading=flow fade, align=center,
	                        rounded corners=1]

	\tikzstyle{subsystem} = [minimum width=6ex, minimum height=3ex, align=center,
	                         draw=black!80, fill=white, fill opacity=0.6]

	%
	% Core
	%

	\node[treenode, bottom color=corecolor, minimum width=30ex, minimum height=6ex] (core) {};
	\path (core.east) node[left=1ex] {Core};

	\path (core.west)    node[right=1ex, subsystem] (corerom) {ROM};
	\path (corerom.east) node[right=1ex, subsystem] (corepd)  {PD};
	\path (corepd.east)  node[right=1ex, subsystem] (corecpu) {CPU};

	%
	% GDB monitor
	%
	\node[treenode, bottom color=gdbmoncolor, minimum width=30ex,
	      minimum height=6ex, above=6ex of core] (gdbmon) {};
	\path (gdbmon.east) node[left=1ex, align=right] {GDB\\Monitor};

	\path (gdbmon.west)    node[right=1ex, subsystem] (gdbmonrom) {ROM};
	\path (gdbmonrom.east) node[right=1ex, subsystem] (gdbmonpd)  {PD};
	\path (gdbmonpd.east)  node[right=1ex, subsystem] (gdbmoncpu) {CPU};

	%
	% Component
	%
	\node[treenode, minimum width=30ex, minimum height=6ex, above=4ex of gdbmon] (target) {};
	\path (target.center) node[align=center] {Component\\as Debugging Target};

	\coordinate (componentrom) at (corerom |- target.south);
	\coordinate (componentpd)  at (corepd  |- target.south);
	\coordinate (componentcpu) at (corecpu |- target.south);

	\path (corerom) -- coordinate (midrom) (componentrom);
	\path (corepd)  -- coordinate (midpd)  (componentpd);
	\path (corecpu) -- coordinate (midcpu) (componentcpu);

	\draw[arrow] (componentrom) -- (gdbmonrom);
	\draw[arrow, densely dashed] (gdbmonrom) -- (corerom);

	\draw[arrow] (componentpd) -- (gdbmonpd);
	\draw[arrow, densely dashed] (gdbmonpd) -- (corepd);

	\draw[arrow] (componentcpu) -- (gdbmoncpu);
	\draw[arrow, densely dashed] (gdbmoncpu) -- (corecpu);

	%
	% Service
	%
	\path (gdbmon.east) node[treenode, right=4ex, minimum width=10ex, minimum height=5ex]
		(service) {Service};

	\path (componentcpu)+(7ex,0) coordinate (componentclient) {};

	\tikzstyle{treesessionarrow} = [arrow, thick, densely dashed]

	% target -> service
	\path[treesessionarrow] (componentclient.270)
		.. controls +(270:15ex) and +(250:4ex) .. (service.250);

	%
	% Terminal
	%
	\path (service.east) node[treenode, right=4ex, minimum width=10ex, minimum height=5ex]
		(terminal) {Terminal};

	% GDB monitor -> terminal
	\path[treesessionarrow] (gdbmon.342)
		.. controls +(300:10ex) and +(230:4ex) .. (terminal.230);

	%
	% Connection to remote GDB
	%
	\draw[arrow, dashed] (terminal) -- ++(0,-10ex) node[below,align=center] {GNU\\Debugger};

	%
	% Parent-child relationships
	%

	\tikzstyle{treechildarrow} = [arrow, thick, opacity=0.2]

	\path[treechildarrow] (gdbmon) -- (target);

\end{tikzpicture}


code:
\begin{tikzpicture}
	\rpcobjectrnode{guisession}{align=center}{}{
		GUI session \\

		\begin{tikzpicture}
			\rpcobjectrnode{input}{align=center}{}{Input stream}
		\end{tikzpicture}

		\\

		\begin{tikzpicture}
			\rpcobjectrnode{fb}{align=center}{}{Framebuffer}
		\end{tikzpicture}

		\\

		\begin{tikzpicture}[rounded corners=false]
			\node[draw, fill=white, minimum width=20ex, minimum height=13ex,
			      dropshadow] {};

			\tikzstyle{view} = [draw, dropshadow, draw opacity=0.1, fill=black!5!white]

			\node[view, minimum width=10ex, minimum height=7ex,
			      xshift=-4ex, yshift=2ex] {};
			\node[view, minimum width=14ex, minimum height=5ex,
			      xshift=0ex, yshift=-1ex] {};
			\node[view, minimum width=3ex, minimum height=6ex,
			      xshift=7ex, yshift=1ex] {};
			\node[view, minimum width=2ex, minimum height=3ex,
			      xshift=-3ex, yshift=-4ex] {};
			\node[minimum width=20ex, minimum height=15ex] {Views};
		\end{tikzpicture}
	}

\end{tikzpicture}


code:
\begin{tikzpicture}

	\labeledcompoundnode{app1}{component}{Server}{

		\node[dataspace, inner sep=0, minimum height=10ex, minimum width=10ex] (ds1) {
			Dataspace\\\\
			\begin{memrange}
				\alloc{2ex}{heapalloc1} \remembersouth{ar1}
				\alloc{2ex}{heapalloc1} \remembersouth{ar2}
				\alloc{1ex}{heapalloc1} \remembersouth{ar3}
				\alloc{1ex}{heapempty}
				\alloc{1ex}{heapalloc1} \remembersouth{ar4}
				\alloc{1ex}{heapalloc1} \remembersouth{ar5}
				\alloc{2ex}{heapempty}
			\end{memrange}
		};

		\node[dataspace, inner sep=0, minimum height=10ex, right=6ex of ds1] (ds2) {
			Dataspace\\\\
			\begin{memrange}
				\alloc{1ex}{heapalloc2} \remembersouth{ab1}
				\alloc{4ex}{heapalloc2} \remembersouth{ab2}
				\alloc{5ex}{heapalloc2} \remembersouth{ab3}
			\end{memrange}
		};

		\node[dataspace, inner sep=0, minimum height=10ex, right=4ex of ds2] (ds3) {
			Dataspace\\\\
			\begin{memrange}
				\alloc{5ex}{heapempty}
				\alloc{1ex}{heapalloc2} \remembersouth{ab4}
				\alloc{4ex}{heapempty}
			\end{memrange}
		};

		\draw[arrow] (ds2.east) .. controls +(1ex,0.5ex) and +(-1ex,0.5ex) .. (ds3.west);

		\node[above=1ex of ds1, minimum height=2ex] (heaplabel1) {};
		\node[above=1ex of ds2, minimum height=2ex] (heaplabel2) {};

		% heap partitions
		\node[fit=(ds1) (heaplabel1), fill, fill opacity=0.01, draw, draw opacity=0.2, rounded corners,
		      inner sep=2ex] (heap1) {};
		\path (heap1.north west) node[compoundlabel] {Heap};

		\node[fit=(ds2) (ds3) (heaplabel2), fill, fill opacity=0.01, draw, draw opacity=0.2, rounded corners,
		      inner sep=2ex] (heap2) {};
		\path (heap2.north west) node[compoundlabel] {Heap};

		% session objects
		\rpcobjectrnode{session1}{align=center, below=5ex of heap2, xshift=-20ex}{}{Session}
		\rpcobjectrnode{session2}{align=center, below=5ex of heap2, xshift=0ex}{}{Session}

		% allocations from left (red) session
		\foreach \i in {1,...,5}{
			\draw[arrow, red!70!black] (session1obj)
				.. controls +(0,4ex) and +(0,-8ex) .. (ar\i);
		}

		% allocations from right (blue) session
		\foreach \i in {1,...,4}{
			\draw[arrow, yellow!40!black] (session2obj)
				.. controls +(0,4ex) and +(0,-8ex) .. (ab\i);
		}
	}

\end{tikzpicture}


code:
\begin{tikzpicture}

	\definecolor{responsivecolor}   {rgb}{1,1,0.7}
	\definecolor{unresponsivecolor} {rgb}{0.9,0.5,0.4}

	\tikzstyle{treenode} = [component, path fading=flow fade, align=center,
	                        rounded corners=1, minimum width=12ex]

	\tikzstyle{unresponsivenode} = [treenode, minimum height=6ex, bottom color=unresponsivecolor]
	\tikzstyle{responsivenode}   = [treenode, minimum height=6ex, bottom color=responsivecolor]

	%
	% Components
	%

	% init
	\node[treenode, minimum width=12ex, minimum height=5ex] (init) {Init};

	% monitored components
	\node[responsivenode,   above=12ex of init]       (responsive2)  {Component};
	\node[responsivenode,   left=8ex of responsive2]  (responsive1)  {Component};
	\node[unresponsivenode, right=8ex of responsive2] (unresponsive) {Component};

	%
	% Parent-child relationships
	%

	\tikzstyle{treechildarrow} = [arrow, thick, opacity=0.2]

	\path[treechildarrow] (init.155) -- (responsive1.south);
	\path[treechildarrow] (init)     -- (responsive2.south);
	\path[treechildarrow] (init.25)  -- (unresponsive.south);

	%
	% Heartbeat requests
	%

	\tikzstyle{requestarrow} = [arrow, densely dashed, sloped=false]

	\path[requestarrow] (init.170)
		.. controls +(-5ex,2ex) and +(2ex,-5ex) ..
		   node [xshift=-6ex, pos=0.3, align=center] {How are\\ you?} (responsive1.240);

	\path[requestarrow] (init.120)
		.. controls +(-2ex,4ex) and +(-2ex,-4ex) ..
		   node [xshift=-1ex, pos=0.3, align=center] {How are\\ you?} (responsive2.240);

	\path[requestarrow] (init.35)
		.. controls +(3ex,5ex) and +(-5ex,-2ex) ..
		node [xshift=4ex, pos=0.2, align=center] {How are\\ you?} (unresponsive.220);

	%
	% Heartbeat responses
	%

	\tikzstyle{responsearrow} = [arrow, sloped=false]

	\path[responsearrow] (responsive1.300)
		.. controls +(5ex,-2ex) and +(-3ex,5ex) ..
		   node [xshift=-3ex, pos=0.7, align=center] {I'm\\ fine} (init.150);

	\path[responsearrow] (responsive2.300)
		.. controls +(2ex,-4ex) and +(2ex,4ex) ..
		   node [xshift=0ex, pos=0.7, align=center] {I'm\\ fine} (init.60);

	\node[below=5ex of unresponsive, xshift=-4ex] (question) {\huge ?};

\end{tikzpicture}


code:
\begin{tikzpicture}

	\input{img/base_hw_soc_dirs.inc}

	\node (leftanchor) {};
	\path (leftanchor) coordinate (anchor);
	\path (anchor) node[dirnode] (imx) {imx/};
	\dirstructure{imx8q\_evk}

\end{tikzpicture}