SlideShare a Scribd company logo
1 of 64
Download to read offline
#include <os>
From bootloader to REST API with the new C++
1Alfred Bratterud, CppCon 2016
We’re making
this a reality
2Alfred Bratterud, CppCon 2016
Let’s put some operating system
inside your ELF binary
• Coined in 2013 by Madhavapeddy, Mortier et. al.[1]
• Single purpose: lots of servers are anyway
• Library operating system: Link in what you need
• Turns a binary into a bootable disk image
• Mainly targeted at virtual machines and IoT
Unikernels 101
3Alfred Bratterud, CppCon 2016
4Alfred Bratterud, CppCon 2016
IncludeOS: A minimal, resource efficient implementation
from scratch in modern C++ [3].
• 300x smaller disk image
• 100x less memory usage by default
• That much reduction in attack surface
5Alfred Bratterud, CppCon 2016
V.S.
0
75
150
225
300
Disk Memory
• IncludeOS is single threaded by default
• Faster, more efficient for single core VM’s:
• 5-20% less CPU cycles spent for the same binary 

and workload [3]
• IncludeOS boots in ~300ms. Ubuntu boots in minutes.
• Ubuntu is awesome. As a general purpose OS.
6Alfred Bratterud, CppCon 2016
V.S.
You all know what virtual machines are.
…let’s go through it anyway
7Alfred Bratterud, CppCon 2016
8
Popek / Goldberg 1974
Gerald J. Popek, Robert P. Goldberg CACM [4]
«A virtual machine is taken to be an
efficient, isolated duplicate of the real
machine»
Alfred Bratterud, CppCon 2016
All sensitive instructions have
to trap!
9
Hardware
Hypervisor VM1 VM2
Alfred Bratterud, CppCon 2016
10
Hardware
Hypervisor
VM1
add r1 r2
mul r1 r2
mov r1 0x88
VM2
Alfred Bratterud, CppCon 2016
All sensitive instructions have
to trap!
11
Hardware
Hypervisor VM1
VM2
mov ‘a’ r2
mul r1 r2
mul r2 8
out ‘!’ 0x87
All sensitive instructions have
to trap!
Alfred Bratterud, CppCon 2016
12
Hardware
Hypervisor VM1
out ‘!’ 0x87
TRAP!
All sensitive instructions have
to trap!
Alfred Bratterud, CppCon 2016
13
Hardware
Hypervisor
Oh, VM2 wants to write to
a device. let’s pretend.
VM1
out ‘!’ 0x87
TRAP!
All sensitive instructions have
to trap!
Alfred Bratterud, CppCon 2016
14
Hardware
Hypervisor VM1
out ‘!’ 0x87
in 0x87
…result as expected
All sensitive instructions have
to trap!
Alfred Bratterud, CppCon 2016
15
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
0 1 2 3 4 5 6 7 8 9
VMM
VM
If an address translation
results in a physical
address out of VM
bounds: TRAP!
Virtual memory
Alfred Bratterud, CppCon 2016
30 years later
16Alfred Bratterud, CppCon 2016
Oh, good idea.
You run directly on hardware.
The VM-trap is just a glorified context switch.
17Alfred Bratterud, CppCon 2016
Since we’re 100% self contained
we can run on Linux, Windows, Mac unchanged
18Alfred Bratterud, CppCon 2016
It’s like a process. 

It just happens to need some operating system.
19Alfred Bratterud, CppCon 2016
20
Bootable image "MyService.img"
Links into "MyService" ELF binary
Bootloader
Service.o
OS parts
from os.a
_start
IncludeOS
build-system overview
vmbuilder
Attach / prep
bootloader
OS classes
IRQ, PCI, Timers, Net
etc.
i.e. everything in ./src
part_1.o part_n.o
Builds into static library
Compile piecewise as usual
Stdlib
parts
os.a
Can become huge without affecting
VM size
Standard libraries
libc++.a, libc.a, libm.a etc.,
custom built for IncludeOS
Your C++ code
starts in service.cpp
A copy of ./seed,
+ all your service source files
• os.a: static library containing
all OS parts
• Drivers are now separated
• Linker pulls in what the
program needs
• OS library can bloat without
affecting image size
• vmbuild: Attach and modify
bootloader
Alfred Bratterud, CppCon 2016
Why C++?
(Yes, people really ask that)
21Alfred Bratterud, CppCon 2016
C++ is the most evolved
“independent systems language”
Alfred Bratterud, CppCon 2016 22
• You need to write arbitrary bytes to arbitrary addresses
• You need access to the full instruction set
• You can’t write an OS in a 100% type safe language
• But new C++ gets you the best of both worlds
Alfred Bratterud, CppCon 2016
Hello World!
23
#include <os>
void Service::start(const std::string&) {
std::cout << "Hello world - OS included!n";
}
What about
“main”?
No parent
process - where
do you return?
“kernel” params
with multiboot
And where does stdout go?
Delegates everywhere!
A C++11 version of Don Clugstons 

“Fastest possible C++ Delegates” was found
… on Stack Exchange
24Alfred Bratterud, CppCon 2016
http://codereview.stackexchange.com/questions/14730/impossibly-fast-delegate-in-c11
Delegates everywhere!
A C++11 version of Don Clugstons 

“Fastest possible C++ Delegates” was found
… on Stack Exchange
25Alfred Bratterud, CppCon 2016
but we seriously owe
you a … beverage of
your choice
We’ll respect
your privacy
http://codereview.stackexchange.com/questions/14730/impossibly-fast-delegate-in-c11
Alfred Bratterud, CppCon 2016
Routing stdout anywhere
26
// VGA
OS::add_stdout(VGA::get_rsprint_handler());
// Custom
OS::add_stdout([] (const std::string& data) {
// Memory-only (webserver 'logger')
logger_->log(timestamp() + data);
});
27Alfred Bratterud, CppCon 2016
What’s different 

about an OS 

for virtual machines?
In principle: nothing
CPU
28Alfred Bratterud, CppCon 2016
VirtIO Net
LAPIC
PIT
Timer
Hardware overview
PCI BusAPIC
timer
IDTR
GDTR
IDE /
SCSI
VirtIO Block
VirtIO xyz
Serial
CR0-x
0 1 2 3 … n
ALL of memory
“Virtual“ devices
“Physical” interface
OS doesn’t know if
they’re physical or
virtual
PIC
Alfred Bratterud, CppCon 2016
How to include only the drivers you need -
without having to mention them in code?
29
Alfred Bratterud, CppCon 2016
Solution: link in
self registering drivers
30
// From IncludeOS v0.9, src/drivers/virtionet.cpp
// ...VirtioNet implementation
/** Register VirtioNet's driver factory at the PCI_manager */
struct Autoreg_virtionet {
Autoreg_virtionet() {
PCI_manager::register_driver<hw::Nic>(hw::PCI_Device::VENDOR_VIRTIO,
0x1000, &VirtioNet::new_instance);
}
} autoreg_virtionet;
1) Global constructor registers a
delegate to driver initialization.
2) OS probes PCI bus and applies any
registered driver
Service Makefile:
DRIVERS = virtionet …
Deployment tools /
sysadmins can apply
appropriate drivers
Alfred Bratterud, CppCon 2016
Kernel overview
31
Call any delegates
subscribing to IRQ’s,
then “hlt”
// 1. Initialize stack, heap, .bss etc.
// 2. Call global constructors
// 3. Initialize hardware
// 4. Call Service::start()
void OS::event_loop() {

while (power_) {
IRQ_manager::get().notify();
}
// Cleanup
Service::stop();
// ACPI shutdown sequence
hw::ACPI::shutdown();
}
// From src/kernel/os.cpp
Note: All subscribed
IRQ’s are deferred
// Actual code from src/drivers/virtionet.cpp
auto del(delegate<void()>
::from<VirtioNet,
&VirtioNet::irq_handler>(this));
IRQ_manager::get().subscribe(10, del);
Alfred Bratterud, CppCon 2016
Subscribing to interrupts
32
Create delegate to
member function of
“this”
Subscribe to a given
IRQ number

called by event loopFor most use cases don’t to worry
about IRQ (this is driver code). 

Abstractions coming up
!
Alfred Bratterud, CppCon 2016
• Each “box” is a class instance
• All connections are delegates
• The wiring happens in the “Inet”
wrapper class
• Rewiring during runtime is easy
• e.g. for activating and deactivating an IP-filter
• Can be done from the application
Wiring the IP stack
Prot.
Prot.
Prot.
Eth.Type
Eth.Type
Pong
Req.
Resp.
Ping 1
n 2^16
1
n
2^16
Downstream - Transmit
Upstream
TX RX
Ethernet
IP6IP4
ARP
TCPICMPUDP
Driver - VirtioNet
Device (Virtio)
53
DNS
reply
Eth.Type
33
Alfred Bratterud, CppCon 2016
• Each “box” is a class instance
• All connections are delegates
• The wiring happens in the “Inet”
wrapper class
• Rewiring during runtime is easy
• e.g. for activating and deactivating an IP-filter
• Can be done from the application
Wiring the IP stack
Prot.
Prot.
Prot.
Eth.Type
Eth.Type
Pong
Req.
Resp.
Ping 1
n 2^16
1
n
2^16
Downstream - Transmit
Upstream
TX RX
Ethernet
IP6IP4
ARP
TCPICMPUDP
Driver - VirtioNet
Device (Virtio)
53
DNS
reply
My IP-filter
34
• Single threaded by default: “no overhead principle”
• In a VM, threading is more expensive [5]
• 100% async: cheapest way to get performance
• No blocking POSIX calls (yet)
• You’ll get it. It’s your “constitutional right…”
Unikernels:

The default should be minimal
35Alfred Bratterud, CppCon 2016
Alfred Bratterud, CppCon 2016
Writing a TCP server
36
#include <os>
#include <net/inet4>
void Service::start(const std::string&) {
auto& server = net::Inet4::stack().tcp().bind(80);
server.on_connect([] (auto conn) {
conn->on_read(1024, [conn] (auto buf, size_t n) {
conn->write("My first unikernel!n"s);
});
});
}
Attach any delegate
to TCP events
• We don’t know
• If you get in, you’re in a hardware protected sandbox
• No shell or other “ad-hoc” code access
• Minimal attack surface: no tools left for the thieves
• Everything inside can be randomized
How do you break in?
37Alfred Bratterud, CppCon 2016
Alfred Bratterud, CppCon 2016 38
“Leave no room for a lower-level language below C++
(except assembler)”
- Bjarne Stroustrup
You made it!
Alfred Bratterud, CppCon 2016 39
But do we need another language above C++?
The new C++ is awesome for high-level abstractions
Introducing “Acorn”
IncludeOS web server
with C++ framework for REST APIs
40Alfred Bratterud, CppCon 2016
Alfred Bratterud, CppCon 2016 41
Static content
served from 

FAT file system
Replace with your
own content
Can serve from
memdisk inside ELF
or VirtioBlock device
Demo of POST’ing
data over REST
42
– Bjarne Stroustrup earlier today
“C++ is not the language for putting
up a simple web page”
Alfred Bratterud, CppCon 2016
43Alfred Bratterud, CppCon 2016
How about a fancy web page?
44Alfred Bratterud, CppCon 2016
Let’s do a dashboard with live CPU stats and live profiling.
It’s surprisingly easy with C++
Alfred Bratterud, CppCon 2016 45
10k http
requests
Mostly heap for the
application
TCP connection
status
Alfred Bratterud, CppCon 2016 46
Timer IRQ-based live
stack sampling
statman: Centrally
located stats for
everything, including
your service
Alfred Bratterud, CppCon 2016 47
Logs: stdout routed
to in-memory ring-
buffer
Alfred Bratterud, CppCon 2016 48
Individual REST
endpoints for each
component. 

100% done in
application.
The OS exposes
nothing 

except an API to
access STL data
structures from App
Routes!
RESTful endpoints for anything in IncludeOS
49Alfred Bratterud, CppCon 2016
Alfred Bratterud, CppCon 2016
“Node/Express.js”-style routes
50
Router router;
// Assume data structure with "user"
// GET /api/users/:id where 'id' is a numeral
router.on_get("/api/users/:id(d+)", [users] (auto req, auto res) {
try {
// Try to retrieve param "id"
auto& params = req->params();
std::string id = params.get("id");
// Look for the user inside the bucket
auto& user = users->pick_up(std::stol(id));
} catch (const std::exception& e) {
res->send_code(http::Not_Found);
}
});
Regex-based mini-language for
expressing routes.
ported to C++ from express.js
The “:id” part is made
accessible to the app as key to
a value.
http://my_domain/api/users/42
matches regex and captures “id”, “42”
Alfred Bratterud, CppCon 2016
Default route: serve from FAT fs
51
Router router;
// Serve index.html from root URL
router.on_get("/", [](auto, auto res) {
// Stat disk for index.html
disk->fs().cstat("/public/index.html", [res] (auto err, const auto& entry) {
if(err)
res->send_code(http::Not_Found);
else
// Serve index.html
res->send_file({disk, entry});
}
});
});
Middleware
Applying a stack of functions to all requests
52Alfred Bratterud, CppCon 2016
Alfred Bratterud, CppCon 2016
“Node/Express.js”-style middleware
53
Check for JSON
content type
Expect parsed JSON
server.use([](auto req, auto res, auto next) {
if(has_content_type_json(req)) {
auto json = std::make_shared<Json_doc>();
json->doc().Parse(req->get_body().c_str());
req->set_attribute(json);
}
(*next)();
});
router.on_post("/users", [](auto req, auto res) {
auto json = req->get_attribute<Json_doc>();
if(json) {
auto& doc = json->doc();
// Register user based on parsed JSON data
}
});
Parse and attach to
requestCall next middleware
(or exit to hang up)
Alfred Bratterud, CppCon 2016
Readymade middleware
54
// Director: Provide an auto-generated HTML directory listing
auto director = std::make_shared<middleware::Director>(disk, "/public/static");
server.use("/static", director);
// Cookie parser: parse all cookies on incoming requests
auto cookie_parser = std::make_shared<middleware::CookieParser>();
server.use(cookie_parser);
// Butler: Serve static files on root route with disk root on /public
auto opt = {"index.html", "index.htm"};
auto butler = std::make_shared<middleware::Butler>(disk, "/public", opt);
server.use(butler);
Performance:
Virtual machines aren’t faster than bare metal
55Alfred Bratterud, CppCon 2016
The goal is to have thousands of self-
contained, secure micro services
56Alfred Bratterud, CppCon 2016
• All services run in single core VM
• Apache / Node on Ubuntu 16.10
• “Acorn” on IncludeOS
• 11% faster than Apache
• 79% faster than Node.js
• 10k http req. with httperf
• Average over 66 samples
• Intel i7 desktop PC w. Ubuntu 16.04
“Acorn” preliminary
performance data
Alfred Bratterud, CppCon 2016 57
Req./sec.
0
2250
4500
6750
9000
Acorn Apache Node.js
Deploy in the cloud!
58Alfred Bratterud, CppCon 2016
CppCon 2016
Deploy in OpenStack
59
$ make
$ glance --image-create --file <My_image.img> …
$ nova boot --image …
Get an IP,
Fire up a browser!
Literally three
commands
We’ll be adding support for
AWS, Google compute,

Azure, you name it.
• 1.0 “Stable API” depends on your feedback!
• Production ready core by years end
• “Acorn”: open source alpha today (!)
• TLS, POSIX and multi-arch are priorities
• Tooling improvements:
• project unik for deployment / management
• Package manager (3rd party)
• CMake builds
• IncludeOS specific CLI tool
Project status
60Alfred Bratterud, CppCon 2016
• Virtual machines aren’t heavy - OS’es are
• IncludeOS is faster, more efficient, 

more secure for single purpose
• C++ is great at both high- and low level.
• Definitely the best language for the job
Recap
61Alfred Bratterud, CppCon 2016
• Pull Requests
• Ideas for cool use cases
• Expert advice!
Please contribute!
62Alfred Bratterud, CppCon 2016
alfred@includeos.org
Demo!
Open Content session
showing the implementation
of an IRC server on
IncludeOS on Thursday
Fork: Chat:
Questions?
63Alfred Bratterud, CppCon 2016
1. “Unikernels: Library operating systems for the cloud”, 

Anil Madhavapeddy, Richard Mortier et. al, ASPLOS 2013
2. “Unikernels: Rise of the Virtual Library Operating System”,

Anil Madhavapeddy, Dave Scott, ACM Queue, 2013
3. “IncludeOS: A minimal, Resource efficient Unikernel for Cloud Systems,

A. Bratterud, A. A. Walla et. al, IEEE CloudCom 2015
4. “Formal requirements for Virtualizable Third Generation Architectures”,
G. Popek, R.P. Goldberg, Communications of the ACM Vol. 17, 1974
5. “APLE: Addressing Lock Holder Preemption Problem with High
Efficiency”, J. Shan, X. Ding and N. Gehani, IEEE CloudCom 2015
References
64CppCon 2016

More Related Content

What's hot

LF_OVS_17_OVS-DPDK Installation and Gotchas
LF_OVS_17_OVS-DPDK Installation and GotchasLF_OVS_17_OVS-DPDK Installation and Gotchas
LF_OVS_17_OVS-DPDK Installation and GotchasLF_OpenvSwitch
 
Zn task - defcon russia 20
Zn task  - defcon russia 20Zn task  - defcon russia 20
Zn task - defcon russia 20DefconRussia
 
Davide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruptionDavide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruptionlinuxlab_conf
 
LF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecases
LF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecasesLF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecases
LF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecasesLF_OpenvSwitch
 
Specializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network StackSpecializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network StackKernel TLV
 
The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014Jian-Hong Pan
 
Bypassing ASLR Exploiting CVE 2015-7545
Bypassing ASLR Exploiting CVE 2015-7545Bypassing ASLR Exploiting CVE 2015-7545
Bypassing ASLR Exploiting CVE 2015-7545Kernel TLV
 
The n00bs guide to ovs dpdk
The n00bs guide to ovs dpdkThe n00bs guide to ovs dpdk
The n00bs guide to ovs dpdkmarkdgray
 
Make Your Own Developement Board @ 2014.4.21 JuluOSDev
Make Your Own Developement Board @ 2014.4.21 JuluOSDevMake Your Own Developement Board @ 2014.4.21 JuluOSDev
Make Your Own Developement Board @ 2014.4.21 JuluOSDevJian-Hong Pan
 
Writing an Ostinato Protocol Builder [FOSDEM 2021]
Writing an Ostinato Protocol Builder [FOSDEM 2021]Writing an Ostinato Protocol Builder [FOSDEM 2021]
Writing an Ostinato Protocol Builder [FOSDEM 2021]pstavirs
 
Introduction to eBPF and XDP
Introduction to eBPF and XDPIntroduction to eBPF and XDP
Introduction to eBPF and XDPlcplcp1
 
Secure coding for developers
Secure coding for developersSecure coding for developers
Secure coding for developerssluge
 
Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)Giovanni Bechis
 
Linux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudAndrea Righi
 
Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23DefconRussia
 

What's hot (20)

LF_OVS_17_OVS-DPDK Installation and Gotchas
LF_OVS_17_OVS-DPDK Installation and GotchasLF_OVS_17_OVS-DPDK Installation and Gotchas
LF_OVS_17_OVS-DPDK Installation and Gotchas
 
Zn task - defcon russia 20
Zn task  - defcon russia 20Zn task  - defcon russia 20
Zn task - defcon russia 20
 
Davide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruptionDavide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruption
 
LF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecases
LF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecasesLF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecases
LF_OVS_17_OVS/OVS-DPDK connection tracking for Mobile usecases
 
Specializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network StackSpecializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network Stack
 
The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014The Simple Scheduler in Embedded System @ OSDC.TW 2014
The Simple Scheduler in Embedded System @ OSDC.TW 2014
 
Pledge in OpenBSD
Pledge in OpenBSDPledge in OpenBSD
Pledge in OpenBSD
 
Wdt Test
Wdt TestWdt Test
Wdt Test
 
Bypassing ASLR Exploiting CVE 2015-7545
Bypassing ASLR Exploiting CVE 2015-7545Bypassing ASLR Exploiting CVE 2015-7545
Bypassing ASLR Exploiting CVE 2015-7545
 
The n00bs guide to ovs dpdk
The n00bs guide to ovs dpdkThe n00bs guide to ovs dpdk
The n00bs guide to ovs dpdk
 
Make Your Own Developement Board @ 2014.4.21 JuluOSDev
Make Your Own Developement Board @ 2014.4.21 JuluOSDevMake Your Own Developement Board @ 2014.4.21 JuluOSDev
Make Your Own Developement Board @ 2014.4.21 JuluOSDev
 
Writing an Ostinato Protocol Builder [FOSDEM 2021]
Writing an Ostinato Protocol Builder [FOSDEM 2021]Writing an Ostinato Protocol Builder [FOSDEM 2021]
Writing an Ostinato Protocol Builder [FOSDEM 2021]
 
Introduction to eBPF and XDP
Introduction to eBPF and XDPIntroduction to eBPF and XDP
Introduction to eBPF and XDP
 
Secure coding for developers
Secure coding for developersSecure coding for developers
Secure coding for developers
 
Staging driver sins
Staging driver sinsStaging driver sins
Staging driver sins
 
Quic illustrated
Quic illustratedQuic illustrated
Quic illustrated
 
Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)
 
Hacking the swisscom modem
Hacking the swisscom modemHacking the swisscom modem
Hacking the swisscom modem
 
Linux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloud
 
Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23Advanced cfg bypass on adobe flash player 18 defcon russia 23
Advanced cfg bypass on adobe flash player 18 defcon russia 23
 

Viewers also liked

DcATL 2013: Git-Flow for Daily Use
DcATL 2013: Git-Flow for Daily UseDcATL 2013: Git-Flow for Daily Use
DcATL 2013: Git-Flow for Daily UseMediacurrent
 
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)   A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig) David Salz
 
Community live #1 - Gitflow Workflow
Community live #1 - Gitflow WorkflowCommunity live #1 - Gitflow Workflow
Community live #1 - Gitflow WorkflowLiora Milbaum
 
Next Generation Debugging
Next Generation DebuggingNext Generation Debugging
Next Generation DebuggingUndo
 
XPDS13: Enabling Fast, Dynamic Network Processing with ClickOS - Joao Martins...
XPDS13: Enabling Fast, Dynamic Network Processing with ClickOS - Joao Martins...XPDS13: Enabling Fast, Dynamic Network Processing with ClickOS - Joao Martins...
XPDS13: Enabling Fast, Dynamic Network Processing with ClickOS - Joao Martins...The Linux Foundation
 
Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)
Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)
Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)David Salz
 
Deterministic Simulation - What modern online games can learn from the Game B...
Deterministic Simulation - What modern online games can learn from the Game B...Deterministic Simulation - What modern online games can learn from the Game B...
Deterministic Simulation - What modern online games can learn from the Game B...David Salz
 

Viewers also liked (7)

DcATL 2013: Git-Flow for Daily Use
DcATL 2013: Git-Flow for Daily UseDcATL 2013: Git-Flow for Daily Use
DcATL 2013: Git-Flow for Daily Use
 
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)   A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
A simple and powerful property system for C++ (talk at GCDC 2008, Leipzig)
 
Community live #1 - Gitflow Workflow
Community live #1 - Gitflow WorkflowCommunity live #1 - Gitflow Workflow
Community live #1 - Gitflow Workflow
 
Next Generation Debugging
Next Generation DebuggingNext Generation Debugging
Next Generation Debugging
 
XPDS13: Enabling Fast, Dynamic Network Processing with ClickOS - Joao Martins...
XPDS13: Enabling Fast, Dynamic Network Processing with ClickOS - Joao Martins...XPDS13: Enabling Fast, Dynamic Network Processing with ClickOS - Joao Martins...
XPDS13: Enabling Fast, Dynamic Network Processing with ClickOS - Joao Martins...
 
Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)
Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)
Albion Online - A Cross-Platform MMO (Unite Europe 2016, Amsterdam)
 
Deterministic Simulation - What modern online games can learn from the Game B...
Deterministic Simulation - What modern online games can learn from the Game B...Deterministic Simulation - What modern online games can learn from the Game B...
Deterministic Simulation - What modern online games can learn from the Game B...
 

Similar to #Include os - From bootloader to REST API with the new C++

IoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3BIoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3BJingfeng Liu
 
不深不淺,帶你認識 LLVM (Found LLVM in your life)
不深不淺,帶你認識 LLVM (Found LLVM in your life)不深不淺,帶你認識 LLVM (Found LLVM in your life)
不深不淺,帶你認識 LLVM (Found LLVM in your life)Douglas Chen
 
OSCON: System software goes weird
OSCON: System software goes weirdOSCON: System software goes weird
OSCON: System software goes weirdDocker, Inc.
 
A Kernel of Truth: Intrusion Detection and Attestation with eBPF
A Kernel of Truth: Intrusion Detection and Attestation with eBPFA Kernel of Truth: Intrusion Detection and Attestation with eBPF
A Kernel of Truth: Intrusion Detection and Attestation with eBPFoholiab
 
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...DevSecCon
 
Code Red Security
Code Red SecurityCode Red Security
Code Red SecurityAmr Ali
 
Legacy of Void*
Legacy of Void*Legacy of Void*
Legacy of Void*Adam Crain
 
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -evechiportal
 
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan BalazsHacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan BalazsShakacon
 
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ Builder
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ BuilderA Check of the Open-Source Project WinSCP Developed in Embarcadero C++ Builder
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ BuilderAndrey Karpov
 
Build 2016 - B880 - Top 6 Reasons to Move Your C++ Code to Visual Studio 2015
Build 2016 - B880 - Top 6 Reasons to Move Your C++ Code to Visual Studio 2015Build 2016 - B880 - Top 6 Reasons to Move Your C++ Code to Visual Studio 2015
Build 2016 - B880 - Top 6 Reasons to Move Your C++ Code to Visual Studio 2015Windows Developer
 
HKG15-300: Art's Quick Compiler: An unofficial overview
HKG15-300: Art's Quick Compiler: An unofficial overviewHKG15-300: Art's Quick Compiler: An unofficial overview
HKG15-300: Art's Quick Compiler: An unofficial overviewLinaro
 
sshuttle VPN (2011-04)
sshuttle VPN (2011-04)sshuttle VPN (2011-04)
sshuttle VPN (2011-04)apenwarr
 
Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...inside-BigData.com
 
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...Zoltan Balazs
 
Buffer overflow – Smashing The Stack
Buffer overflow – Smashing The StackBuffer overflow – Smashing The Stack
Buffer overflow – Smashing The StackTomer Zait
 
Internet Technology for the Commodore 64
Internet Technology for the Commodore 64Internet Technology for the Commodore 64
Internet Technology for the Commodore 64Leif Bloomquist
 
Raising the Bar on Robotics Code Quality
Raising the Bar on Robotics Code QualityRaising the Bar on Robotics Code Quality
Raising the Bar on Robotics Code QualityThomas Moulard
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Docker, Inc.
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013dotCloud
 

Similar to #Include os - From bootloader to REST API with the new C++ (20)

IoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3BIoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3B
 
不深不淺,帶你認識 LLVM (Found LLVM in your life)
不深不淺,帶你認識 LLVM (Found LLVM in your life)不深不淺,帶你認識 LLVM (Found LLVM in your life)
不深不淺,帶你認識 LLVM (Found LLVM in your life)
 
OSCON: System software goes weird
OSCON: System software goes weirdOSCON: System software goes weird
OSCON: System software goes weird
 
A Kernel of Truth: Intrusion Detection and Attestation with eBPF
A Kernel of Truth: Intrusion Detection and Attestation with eBPFA Kernel of Truth: Intrusion Detection and Attestation with eBPF
A Kernel of Truth: Intrusion Detection and Attestation with eBPF
 
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
DevSecCon London 2019: A Kernel of Truth: Intrusion Detection and Attestation...
 
Code Red Security
Code Red SecurityCode Red Security
Code Red Security
 
Legacy of Void*
Legacy of Void*Legacy of Void*
Legacy of Void*
 
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
 
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan BalazsHacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
 
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ Builder
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ BuilderA Check of the Open-Source Project WinSCP Developed in Embarcadero C++ Builder
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ Builder
 
Build 2016 - B880 - Top 6 Reasons to Move Your C++ Code to Visual Studio 2015
Build 2016 - B880 - Top 6 Reasons to Move Your C++ Code to Visual Studio 2015Build 2016 - B880 - Top 6 Reasons to Move Your C++ Code to Visual Studio 2015
Build 2016 - B880 - Top 6 Reasons to Move Your C++ Code to Visual Studio 2015
 
HKG15-300: Art's Quick Compiler: An unofficial overview
HKG15-300: Art's Quick Compiler: An unofficial overviewHKG15-300: Art's Quick Compiler: An unofficial overview
HKG15-300: Art's Quick Compiler: An unofficial overview
 
sshuttle VPN (2011-04)
sshuttle VPN (2011-04)sshuttle VPN (2011-04)
sshuttle VPN (2011-04)
 
Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...Preparing to program Aurora at Exascale - Early experiences and future direct...
Preparing to program Aurora at Exascale - Early experiences and future direct...
 
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...
DEFCON 22: Bypass firewalls, application white lists, secure remote desktops ...
 
Buffer overflow – Smashing The Stack
Buffer overflow – Smashing The StackBuffer overflow – Smashing The Stack
Buffer overflow – Smashing The Stack
 
Internet Technology for the Commodore 64
Internet Technology for the Commodore 64Internet Technology for the Commodore 64
Internet Technology for the Commodore 64
 
Raising the Bar on Robotics Code Quality
Raising the Bar on Robotics Code QualityRaising the Bar on Robotics Code Quality
Raising the Bar on Robotics Code Quality
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
 

Recently uploaded

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 

Recently uploaded (20)

Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 

#Include os - From bootloader to REST API with the new C++

  • 1. #include <os> From bootloader to REST API with the new C++ 1Alfred Bratterud, CppCon 2016 We’re making this a reality
  • 2. 2Alfred Bratterud, CppCon 2016 Let’s put some operating system inside your ELF binary
  • 3. • Coined in 2013 by Madhavapeddy, Mortier et. al.[1] • Single purpose: lots of servers are anyway • Library operating system: Link in what you need • Turns a binary into a bootable disk image • Mainly targeted at virtual machines and IoT Unikernels 101 3Alfred Bratterud, CppCon 2016
  • 4. 4Alfred Bratterud, CppCon 2016 IncludeOS: A minimal, resource efficient implementation from scratch in modern C++ [3].
  • 5. • 300x smaller disk image • 100x less memory usage by default • That much reduction in attack surface 5Alfred Bratterud, CppCon 2016 V.S. 0 75 150 225 300 Disk Memory
  • 6. • IncludeOS is single threaded by default • Faster, more efficient for single core VM’s: • 5-20% less CPU cycles spent for the same binary 
 and workload [3] • IncludeOS boots in ~300ms. Ubuntu boots in minutes. • Ubuntu is awesome. As a general purpose OS. 6Alfred Bratterud, CppCon 2016 V.S.
  • 7. You all know what virtual machines are. …let’s go through it anyway 7Alfred Bratterud, CppCon 2016
  • 8. 8 Popek / Goldberg 1974 Gerald J. Popek, Robert P. Goldberg CACM [4] «A virtual machine is taken to be an efficient, isolated duplicate of the real machine» Alfred Bratterud, CppCon 2016
  • 9. All sensitive instructions have to trap! 9 Hardware Hypervisor VM1 VM2 Alfred Bratterud, CppCon 2016
  • 10. 10 Hardware Hypervisor VM1 add r1 r2 mul r1 r2 mov r1 0x88 VM2 Alfred Bratterud, CppCon 2016 All sensitive instructions have to trap!
  • 11. 11 Hardware Hypervisor VM1 VM2 mov ‘a’ r2 mul r1 r2 mul r2 8 out ‘!’ 0x87 All sensitive instructions have to trap! Alfred Bratterud, CppCon 2016
  • 12. 12 Hardware Hypervisor VM1 out ‘!’ 0x87 TRAP! All sensitive instructions have to trap! Alfred Bratterud, CppCon 2016
  • 13. 13 Hardware Hypervisor Oh, VM2 wants to write to a device. let’s pretend. VM1 out ‘!’ 0x87 TRAP! All sensitive instructions have to trap! Alfred Bratterud, CppCon 2016
  • 14. 14 Hardware Hypervisor VM1 out ‘!’ 0x87 in 0x87 …result as expected All sensitive instructions have to trap! Alfred Bratterud, CppCon 2016
  • 15. 15 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 0 1 2 3 4 5 6 7 8 9 VMM VM If an address translation results in a physical address out of VM bounds: TRAP! Virtual memory Alfred Bratterud, CppCon 2016
  • 16. 30 years later 16Alfred Bratterud, CppCon 2016 Oh, good idea.
  • 17. You run directly on hardware. The VM-trap is just a glorified context switch. 17Alfred Bratterud, CppCon 2016
  • 18. Since we’re 100% self contained we can run on Linux, Windows, Mac unchanged 18Alfred Bratterud, CppCon 2016
  • 19. It’s like a process. 
 It just happens to need some operating system. 19Alfred Bratterud, CppCon 2016
  • 20. 20 Bootable image "MyService.img" Links into "MyService" ELF binary Bootloader Service.o OS parts from os.a _start IncludeOS build-system overview vmbuilder Attach / prep bootloader OS classes IRQ, PCI, Timers, Net etc. i.e. everything in ./src part_1.o part_n.o Builds into static library Compile piecewise as usual Stdlib parts os.a Can become huge without affecting VM size Standard libraries libc++.a, libc.a, libm.a etc., custom built for IncludeOS Your C++ code starts in service.cpp A copy of ./seed, + all your service source files • os.a: static library containing all OS parts • Drivers are now separated • Linker pulls in what the program needs • OS library can bloat without affecting image size • vmbuild: Attach and modify bootloader Alfred Bratterud, CppCon 2016
  • 21. Why C++? (Yes, people really ask that) 21Alfred Bratterud, CppCon 2016
  • 22. C++ is the most evolved “independent systems language” Alfred Bratterud, CppCon 2016 22 • You need to write arbitrary bytes to arbitrary addresses • You need access to the full instruction set • You can’t write an OS in a 100% type safe language • But new C++ gets you the best of both worlds
  • 23. Alfred Bratterud, CppCon 2016 Hello World! 23 #include <os> void Service::start(const std::string&) { std::cout << "Hello world - OS included!n"; } What about “main”? No parent process - where do you return? “kernel” params with multiboot And where does stdout go?
  • 24. Delegates everywhere! A C++11 version of Don Clugstons 
 “Fastest possible C++ Delegates” was found … on Stack Exchange 24Alfred Bratterud, CppCon 2016 http://codereview.stackexchange.com/questions/14730/impossibly-fast-delegate-in-c11
  • 25. Delegates everywhere! A C++11 version of Don Clugstons 
 “Fastest possible C++ Delegates” was found … on Stack Exchange 25Alfred Bratterud, CppCon 2016 but we seriously owe you a … beverage of your choice We’ll respect your privacy http://codereview.stackexchange.com/questions/14730/impossibly-fast-delegate-in-c11
  • 26. Alfred Bratterud, CppCon 2016 Routing stdout anywhere 26 // VGA OS::add_stdout(VGA::get_rsprint_handler()); // Custom OS::add_stdout([] (const std::string& data) { // Memory-only (webserver 'logger') logger_->log(timestamp() + data); });
  • 27. 27Alfred Bratterud, CppCon 2016 What’s different 
 about an OS 
 for virtual machines? In principle: nothing
  • 28. CPU 28Alfred Bratterud, CppCon 2016 VirtIO Net LAPIC PIT Timer Hardware overview PCI BusAPIC timer IDTR GDTR IDE / SCSI VirtIO Block VirtIO xyz Serial CR0-x 0 1 2 3 … n ALL of memory “Virtual“ devices “Physical” interface OS doesn’t know if they’re physical or virtual PIC
  • 29. Alfred Bratterud, CppCon 2016 How to include only the drivers you need - without having to mention them in code? 29
  • 30. Alfred Bratterud, CppCon 2016 Solution: link in self registering drivers 30 // From IncludeOS v0.9, src/drivers/virtionet.cpp // ...VirtioNet implementation /** Register VirtioNet's driver factory at the PCI_manager */ struct Autoreg_virtionet { Autoreg_virtionet() { PCI_manager::register_driver<hw::Nic>(hw::PCI_Device::VENDOR_VIRTIO, 0x1000, &VirtioNet::new_instance); } } autoreg_virtionet; 1) Global constructor registers a delegate to driver initialization. 2) OS probes PCI bus and applies any registered driver Service Makefile: DRIVERS = virtionet … Deployment tools / sysadmins can apply appropriate drivers
  • 31. Alfred Bratterud, CppCon 2016 Kernel overview 31 Call any delegates subscribing to IRQ’s, then “hlt” // 1. Initialize stack, heap, .bss etc. // 2. Call global constructors // 3. Initialize hardware // 4. Call Service::start() void OS::event_loop() {
 while (power_) { IRQ_manager::get().notify(); } // Cleanup Service::stop(); // ACPI shutdown sequence hw::ACPI::shutdown(); } // From src/kernel/os.cpp Note: All subscribed IRQ’s are deferred
  • 32. // Actual code from src/drivers/virtionet.cpp auto del(delegate<void()> ::from<VirtioNet, &VirtioNet::irq_handler>(this)); IRQ_manager::get().subscribe(10, del); Alfred Bratterud, CppCon 2016 Subscribing to interrupts 32 Create delegate to member function of “this” Subscribe to a given IRQ number
 called by event loopFor most use cases don’t to worry about IRQ (this is driver code). 
 Abstractions coming up !
  • 33. Alfred Bratterud, CppCon 2016 • Each “box” is a class instance • All connections are delegates • The wiring happens in the “Inet” wrapper class • Rewiring during runtime is easy • e.g. for activating and deactivating an IP-filter • Can be done from the application Wiring the IP stack Prot. Prot. Prot. Eth.Type Eth.Type Pong Req. Resp. Ping 1 n 2^16 1 n 2^16 Downstream - Transmit Upstream TX RX Ethernet IP6IP4 ARP TCPICMPUDP Driver - VirtioNet Device (Virtio) 53 DNS reply Eth.Type 33
  • 34. Alfred Bratterud, CppCon 2016 • Each “box” is a class instance • All connections are delegates • The wiring happens in the “Inet” wrapper class • Rewiring during runtime is easy • e.g. for activating and deactivating an IP-filter • Can be done from the application Wiring the IP stack Prot. Prot. Prot. Eth.Type Eth.Type Pong Req. Resp. Ping 1 n 2^16 1 n 2^16 Downstream - Transmit Upstream TX RX Ethernet IP6IP4 ARP TCPICMPUDP Driver - VirtioNet Device (Virtio) 53 DNS reply My IP-filter 34
  • 35. • Single threaded by default: “no overhead principle” • In a VM, threading is more expensive [5] • 100% async: cheapest way to get performance • No blocking POSIX calls (yet) • You’ll get it. It’s your “constitutional right…” Unikernels:
 The default should be minimal 35Alfred Bratterud, CppCon 2016
  • 36. Alfred Bratterud, CppCon 2016 Writing a TCP server 36 #include <os> #include <net/inet4> void Service::start(const std::string&) { auto& server = net::Inet4::stack().tcp().bind(80); server.on_connect([] (auto conn) { conn->on_read(1024, [conn] (auto buf, size_t n) { conn->write("My first unikernel!n"s); }); }); } Attach any delegate to TCP events
  • 37. • We don’t know • If you get in, you’re in a hardware protected sandbox • No shell or other “ad-hoc” code access • Minimal attack surface: no tools left for the thieves • Everything inside can be randomized How do you break in? 37Alfred Bratterud, CppCon 2016
  • 38. Alfred Bratterud, CppCon 2016 38 “Leave no room for a lower-level language below C++ (except assembler)” - Bjarne Stroustrup You made it!
  • 39. Alfred Bratterud, CppCon 2016 39 But do we need another language above C++? The new C++ is awesome for high-level abstractions
  • 40. Introducing “Acorn” IncludeOS web server with C++ framework for REST APIs 40Alfred Bratterud, CppCon 2016
  • 41. Alfred Bratterud, CppCon 2016 41 Static content served from 
 FAT file system Replace with your own content Can serve from memdisk inside ELF or VirtioBlock device Demo of POST’ing data over REST
  • 42. 42 – Bjarne Stroustrup earlier today “C++ is not the language for putting up a simple web page” Alfred Bratterud, CppCon 2016
  • 43. 43Alfred Bratterud, CppCon 2016 How about a fancy web page?
  • 44. 44Alfred Bratterud, CppCon 2016 Let’s do a dashboard with live CPU stats and live profiling. It’s surprisingly easy with C++
  • 45. Alfred Bratterud, CppCon 2016 45 10k http requests Mostly heap for the application TCP connection status
  • 46. Alfred Bratterud, CppCon 2016 46 Timer IRQ-based live stack sampling statman: Centrally located stats for everything, including your service
  • 47. Alfred Bratterud, CppCon 2016 47 Logs: stdout routed to in-memory ring- buffer
  • 48. Alfred Bratterud, CppCon 2016 48 Individual REST endpoints for each component. 
 100% done in application. The OS exposes nothing 
 except an API to access STL data structures from App
  • 49. Routes! RESTful endpoints for anything in IncludeOS 49Alfred Bratterud, CppCon 2016
  • 50. Alfred Bratterud, CppCon 2016 “Node/Express.js”-style routes 50 Router router; // Assume data structure with "user" // GET /api/users/:id where 'id' is a numeral router.on_get("/api/users/:id(d+)", [users] (auto req, auto res) { try { // Try to retrieve param "id" auto& params = req->params(); std::string id = params.get("id"); // Look for the user inside the bucket auto& user = users->pick_up(std::stol(id)); } catch (const std::exception& e) { res->send_code(http::Not_Found); } }); Regex-based mini-language for expressing routes. ported to C++ from express.js The “:id” part is made accessible to the app as key to a value. http://my_domain/api/users/42 matches regex and captures “id”, “42”
  • 51. Alfred Bratterud, CppCon 2016 Default route: serve from FAT fs 51 Router router; // Serve index.html from root URL router.on_get("/", [](auto, auto res) { // Stat disk for index.html disk->fs().cstat("/public/index.html", [res] (auto err, const auto& entry) { if(err) res->send_code(http::Not_Found); else // Serve index.html res->send_file({disk, entry}); } }); });
  • 52. Middleware Applying a stack of functions to all requests 52Alfred Bratterud, CppCon 2016
  • 53. Alfred Bratterud, CppCon 2016 “Node/Express.js”-style middleware 53 Check for JSON content type Expect parsed JSON server.use([](auto req, auto res, auto next) { if(has_content_type_json(req)) { auto json = std::make_shared<Json_doc>(); json->doc().Parse(req->get_body().c_str()); req->set_attribute(json); } (*next)(); }); router.on_post("/users", [](auto req, auto res) { auto json = req->get_attribute<Json_doc>(); if(json) { auto& doc = json->doc(); // Register user based on parsed JSON data } }); Parse and attach to requestCall next middleware (or exit to hang up)
  • 54. Alfred Bratterud, CppCon 2016 Readymade middleware 54 // Director: Provide an auto-generated HTML directory listing auto director = std::make_shared<middleware::Director>(disk, "/public/static"); server.use("/static", director); // Cookie parser: parse all cookies on incoming requests auto cookie_parser = std::make_shared<middleware::CookieParser>(); server.use(cookie_parser); // Butler: Serve static files on root route with disk root on /public auto opt = {"index.html", "index.htm"}; auto butler = std::make_shared<middleware::Butler>(disk, "/public", opt); server.use(butler);
  • 55. Performance: Virtual machines aren’t faster than bare metal 55Alfred Bratterud, CppCon 2016
  • 56. The goal is to have thousands of self- contained, secure micro services 56Alfred Bratterud, CppCon 2016
  • 57. • All services run in single core VM • Apache / Node on Ubuntu 16.10 • “Acorn” on IncludeOS • 11% faster than Apache • 79% faster than Node.js • 10k http req. with httperf • Average over 66 samples • Intel i7 desktop PC w. Ubuntu 16.04 “Acorn” preliminary performance data Alfred Bratterud, CppCon 2016 57 Req./sec. 0 2250 4500 6750 9000 Acorn Apache Node.js
  • 58. Deploy in the cloud! 58Alfred Bratterud, CppCon 2016
  • 59. CppCon 2016 Deploy in OpenStack 59 $ make $ glance --image-create --file <My_image.img> … $ nova boot --image … Get an IP, Fire up a browser! Literally three commands We’ll be adding support for AWS, Google compute,
 Azure, you name it.
  • 60. • 1.0 “Stable API” depends on your feedback! • Production ready core by years end • “Acorn”: open source alpha today (!) • TLS, POSIX and multi-arch are priorities • Tooling improvements: • project unik for deployment / management • Package manager (3rd party) • CMake builds • IncludeOS specific CLI tool Project status 60Alfred Bratterud, CppCon 2016
  • 61. • Virtual machines aren’t heavy - OS’es are • IncludeOS is faster, more efficient, 
 more secure for single purpose • C++ is great at both high- and low level. • Definitely the best language for the job Recap 61Alfred Bratterud, CppCon 2016
  • 62. • Pull Requests • Ideas for cool use cases • Expert advice! Please contribute! 62Alfred Bratterud, CppCon 2016 alfred@includeos.org Demo! Open Content session showing the implementation of an IRC server on IncludeOS on Thursday Fork: Chat:
  • 64. 1. “Unikernels: Library operating systems for the cloud”, 
 Anil Madhavapeddy, Richard Mortier et. al, ASPLOS 2013 2. “Unikernels: Rise of the Virtual Library Operating System”,
 Anil Madhavapeddy, Dave Scott, ACM Queue, 2013 3. “IncludeOS: A minimal, Resource efficient Unikernel for Cloud Systems,
 A. Bratterud, A. A. Walla et. al, IEEE CloudCom 2015 4. “Formal requirements for Virtualizable Third Generation Architectures”, G. Popek, R.P. Goldberg, Communications of the ACM Vol. 17, 1974 5. “APLE: Addressing Lock Holder Preemption Problem with High Efficiency”, J. Shan, X. Ding and N. Gehani, IEEE CloudCom 2015 References 64CppCon 2016