Loading…
CppCon 2018 has ended
• Embedded and Systems Programming [clear filter]
Monday, September 24
 

16:45 PDT

Emulating the Nintendo 3DS: Generative & Declarative Programming in Action
Data de-serialization is a surprisingly common task in game console emulation (kernel interfaces, driver communication, and file IO), and to address it we usually use repetitive boilerplate code that is often nothing but error-prone and unmaintainable. How can modern C++ help?

We take a look at the interprocess communication subsystem of the Nintendo 3DS and see how generative programming tools (variadic templates, function reflection, metaprogramming) and a declarative approach give us wins in performance, maintainability, and correctness.

The takeaway of this session is a glimpse at generators, declarative interfaces, and how to use them to solve serialization-like problems with minimal effort and maximum reusability.

Speakers
avatar for Tony Wasserka

Tony Wasserka

Consultant
Low-level anything: Tony is a consultant and long-term C++ enthusiast who has worked on the console emulator projects Dolphin (GameCube/Wii), PPSSPP (PSP), and Mikage (3DS) since 2010. More recently, he has worked on Vulkan graphics drivers for PowerVR graphics processors. His main... Read More →


Monday September 24, 2018 16:45 - 17:45 PDT
Winter Park (406)

16:45 PDT

Unwinding the Stack: Exploring How C++ Exceptions Work on Windows
If you’re writing modern C++ code, then it’s likely that you are using exceptions—whether you’re throwing them yourself or just using library code that might throw (e.g., std::vector). Have you ever stopped to think about how exceptions work under the hood? What actually happens at runtime when you throw an exception? How is the right catch statement found?

In this session, we’ll explore how C++ exceptions actually work in the Visual C++ implementation on Windows. This session will discuss:

* A very, very brief overview of how exceptions work in the C++ language
* The code and data structures the Visual C++ compiler generates to facilitate proper stack unwinding
* Exactly what happens when an exception is thrown, how the right catch statement is found, and how the stack is unwound
* Structured Exception Handling (SEH), the Windows OS feature atop which C++ exceptions are built
* How the Visual C++ runtime library interacts with the OS during stack unwinding
* Interoperation with non-C++ exceptions, like hardware exceptions
* How termination handling works when no matching catch statement is found or when a noexcept boundary is reached
* How things differ on different architectures (x86 is very different from x64 and ARM!)

This information can be very useful when debugging tricky problems—especially during postmortem debugging when you’re trying to figure out what went wrong before a program crashed—and we’ll highlight particular pieces of information that are most useful.

Speakers
avatar for James McNellis

James McNellis

Principal Software Engineer, Microsoft Corporation
James McNellis is a Principal Software Engineer at Microsoft where he works on the Time Travel Debugging (TTD) reverse debugging toolkit. Prior to joining the Windows Debuggers team in 2016, he worked on the Visual C++ team and was responsible for the Microsoft C Runtime (CRT) and... Read More →


Monday September 24, 2018 16:45 - 17:45 PDT
Copper Mountain Theater (2nd Floor)
  • Embedded and Systems Programming
 
Tuesday, September 25
 

20:30 PDT

Embedded C++
C++ has not always been the first language choice to use in embedded environments, but with the advent of modern C++, its use has been on the rise. Developing for embedded environments generally and the Internet of Things (IoT) specifically, presents challenges for which modern C++ offers a unique tool set. Come ask the experts on how they view C++ in this space and how to use modern C++ to get the best performance possible to meet the demands embedded systems such as IoT.

Speakers
avatar for Odin Holmes

Odin Holmes

chaos monkey, Auto-Intern GmbH
Odin was allocated from a pool of hippies in the middle of the forest. He spent most of his career designing electronic circuits and programming micro controllers in assembler. One day after having shot himself in the foot particularly badly a friend introduced him to C++, a seriously... Read More →
avatar for Dan Saks

Dan Saks

President, Saks & Associates
Dan Saks is the president of Saks & Associates, which offers training and consulting in C and C++ and their use in developing embedded systems. Dan used to write the “Programming Pointers” column for embedded.com online. He has also written columns for numerous print publications... Read More →
avatar for Ben Saks

Ben Saks

Chief Engineer, Saks & Associates
Ben Saks is the chief engineer of Saks & Associates, which offers training and consulting in C and C++ and their use in developing embedded systems. Ben has represented Saks & Associates on the ISO C++ Standards committee as well as two of the committee’s study groups: SG14 (low-latency... Read More →
avatar for Brett Searles

Brett Searles

Principal Architect, Attobotics
avatar for Andrew Sloss

Andrew Sloss

Senior Principal Research Engineer, Arm Holdings
Fellow of the British Computer Society, Part Time Lecturer at the University of Washington Electrical Engineering Department and Senior Principal Research Engineer at Arm Holdings. Andrew has had a long career in the Embedded field spanning both commercial and higher education. His... Read More →


Tuesday September 25, 2018 20:30 - 22:00 PDT
Steamboat (403)
 
Wednesday, September 26
 

09:00 PDT

These Aren't the COM Objects You're Looking For
Windows COM is 25 years old. Yet it is relevant today more than ever, because Microsoft has bet its entire modern WinRT API on it (starting with Windows 8/10). But, if you’re familiar with the “old” COM with its idioms and SDK helper classes, you’re in for a treat. With the advent of modern C++ 17, using COM objects and new Windows APIs in your applications feels like a completely new experience.
In this session, we’ll explore how using modern C++ features can radically transform the shape of your COM code. By eliminating a lot of boilerplate, your code will be much more readable and maintainable. Classic COM idioms around activation and QueryInterface() can feel totally different with modern C++ helpers. A beautiful example of modern COM usage is C++/WinRT (now part of Windows SDK). This is a standard C++ language projection for the new Windows Runtime API.
COM memory management, data marshalling, string handling can all feel quite mechanical in nature and very error prone, so a little help from modern C++ facilities would be more than welcomed. Error handling and debugging can be cumbersome for COM like APIs; we’ll explore some tricks to improve this experience, as well.


Speakers
avatar for Victor Ciura

Victor Ciura

Principal Engineer, CAPHYON
Victor Ciura is a Principal Engineer at CAPHYON, Technical Lead on the Advanced Installer team and a Microsoft MVP (Developer Technologies).He’s a regular guest at Computer Science Department of his Alma Mater, University of Craiova, where he gives student lectures & workshops on using C++ STL Algorithms.Since 2005, he has been designing and implementing several core components and libraries of Advanced Installer. Currently, he spends most of his time working with his team on improving and extending the repackaging... Read More →


Wednesday September 26, 2018 09:00 - 10:00 PDT
Steamboat (403)

12:30 PDT

Lesser known Linux Kernel APIs
This session will present lesser known and recently added Linux Kernel APIs which are beneficial for C/C++ programmers to improve security, performance or just introspectability of their programs.

While the usual API on Unix alike operating systems is defined by the POSIX standard, Linux extends this API and offers additional features which might be worthwhile to know while developing for this platform:

In particular, we will look into how the Linux virtual memory management layer can be influenced and queried for more fine granular information. This additional insight can be used to improve performance while iterating over large memory regions using custom C++ iterators.

Making best use of CPU caches is becoming more important to improve performance. New features in the Linux kernel allow to influence how the CPU caches are utilized by applications.

As a lookout the session will conclude with notable new features, like anonymous and sealed file descriptors and new primitives offered by Linux to construct faster concurrency control algorithms.

Speakers
HS

Hannes Sowa

Backtrace


Wednesday September 26, 2018 12:30 - 13:30 PDT
Telluride (407)

15:15 PDT

The Embedded Device Under Your Desk: UEFI Applications With Modern C++
Inside of every PC, there is an environment capable of running arbitrary software without an operating system: The Unified Extensible Firmware Interface, or UEFI. Introduced to replace BIOS as a high-level interface between hardware and the kernel, it features many advanced features such as networking right after pressing the power button of your mainboard with a relatively simple C API.
In this session, we explore how we can apply modern C++ idioms to a bare metal environment like UEFI. Armed with a working modern C++ compiler, we'll wrap the C API with some metaprogramming tricks. This grants us better type safety and a cleaner API with no runtime overhead. Along the way we'll introduce a clean exceptionless error-handling method, and finally write a small demo application.
Finally, we look at the some of the proposals for the next C++ standard and how it helps us writing more concise yet efficient code that is sill conformant.

Speakers
avatar for Morris Hafner

Morris Hafner

Software Engineer, Codeplay Software
Morris is a Computer Science undergrad interested in computer graphics, the evolution of C++ and everything low level. He tries to (ab)use the language and its tooling to prevent mistakes in software while keeping the code as general as possible. On the GPU, he likes to play with... Read More →


Wednesday September 26, 2018 15:15 - 15:45 PDT
Telluride (407)

16:45 PDT

C++ in Elvenland

On Linux systems, compiled C++ code is generally bundled in the ELF binary
format. This talk walks through several details of the format that can help a
C++ developper to better understand the whole compilation chain, from classical
text and data sections through symbol tables down to init_array, eh_frame.

The talk walks though all the sections of a binary compiled from a simple C++
code and explain the links between c++ concepts like constant global variables,
exceptions, global constructors, ODR, symbol visibility, thread local variables
and related binary artefacts.

All these aspects will be demonstrated on a live demo using the output of the
venerable objdump and readelf commands.

Speakers
SG

Serge Guelton

Software Engineer, Quarkslab
Serge « sans paille » Guelton is a compiler engineer at QuarksLab where he builds an LLVM-based code obfuscator. He's also the maintainer of the Pythran compiler that turns scientific Python kernels into efficient C++ code.


Wednesday September 26, 2018 16:45 - 17:45 PDT
Telluride (407)

16:45 PDT

Modern C++ in Embedded Systems - The Saga Continues
For nearly 35 years I have been working with small processors and there has always been deep divides between practitioners of languages. When writing assembly we ridiculed those using C and when I spent years microcoding we scoffed at everyone. However, nearly all groups continue to wag their heads at the shameful C++ programmers attempting to twist their tools toward the small.

Recent language developments have made C++ the obvious choice for many embedded projects; nevertheless, the toxic environment extends past reddit roasts into poor vendor support of tools and nearly obstructionist chip manufacturers.

At C++Now I introduced a bare-metal project started in 2018 for a Ciere client as a case study. The goal was to extract useful lessons ranging from tooling acrobatics to idioms, language features, and libraries for producing high quality embedded results. Like an Athenian youth navigating Minos’ labyrinth we were thwarted at every bend and could merely report on the first half of the quest. In this session we will complete the saga with a discussion of the recent language features that enable goals of size, speed, and expressiveness, the libraries employed, and debugging techniques to stave off the minotaur.

While the examples will be based on a concrete project, the extracted lessons-learned should be applicable to many embedded projects (bare-metal and small-OS). Attendees will walk away with motivations to use C++ in embedded projects, hints and tips to making tools work, and a sampling of language features and idioms that improve the quality of a final product.

Speakers
avatar for Michael Caisse

Michael Caisse

Ciere, Inc.
Michael Caisse started using C++ with embedded systems over 30 years ago. He continues to be passionate about combining his degree in Electrical Engineering with elegant software solutions and is always excited to share his discoveries with others.Michael works for Ciere Consulting... Read More →


Wednesday September 26, 2018 16:45 - 17:45 PDT
Steamboat (403)
  • Embedded and Systems Programming
 
Friday, September 28
 

10:30 PDT

Concurrency Challenges of Interrupt Service Routines
With the advent of IoT and industry 4.0 there has been a lot of hype
lately around bare metal and low level embedded software development.
Many make a distinction between C++ developers with and without
embedded experience, but what is really the difference when developing
in this domain and why is C still widely considered the pragmatic
choice. One of the crucial factors which is not well understood
outside of this domain are Interrupt Sercive Routines (ISRs). In order
to create a better understanding, this talk is a deep dive from no
previous experience all the way to an expert level understanding of
this feature. In this talk we will cover topics like jitter, latency,
priority inversion, starvation as well as the fundamental problems
ISRs cause in many mainstream C++ design patterns and even core
language features. I will also argue that ISRs change the basic
interface with regard to library abstractions and we will explore what
the alternate basic interface should look like.

Speakers
avatar for Odin Holmes

Odin Holmes

chaos monkey, Auto-Intern GmbH
Odin was allocated from a pool of hippies in the middle of the forest. He spent most of his career designing electronic circuits and programming micro controllers in assembler. One day after having shot himself in the foot particularly badly a friend introduced him to C++, a seriously... Read More →


Friday September 28, 2018 10:30 - 11:30 PDT
Steamboat (403)

10:30 PDT

The Bits Between the Bits: How We Get to main()
When you run your C++ code, have you ever considered how the linker, loader, operating system, C and C++ runtime all work so hard to get everything set up for you to start running your code in main()?

In this Linux-focused talk, Matt will talk about how the linker stitches together your code and how that fits in with dynamic linking. He'll touch on debugging issues with the loader, and how ODR violations can manifest themselves. Then he'll take a look at what's going on behind the scenes to get the C runtime up, and then the C++ runtime, along with all the global object constructors - showing more reasons why you shouldn't be using them!

By the end of the talk you should have an understanding of how a bundle of object files are brought together by the linker, along with the relevant runtimes, and then loaded and executed by the operating system.

Speakers
avatar for Matt Godbolt

Matt Godbolt

Development Engineer, Aquatic Capital Management, LLC
Matt Godbolt is the creator of the Compiler Explorer website. He is passionate about writing efficient code. He has previously worked at a trading firm, on mobile apps at Google, run his own C++ tools company and spent more than a decade making console games. When he's not hacking... Read More →


Friday September 28, 2018 10:30 - 11:30 PDT
Breckenridge Hall (1st Floor)
  • Embedded and Systems Programming
 
Filter sessions
Apply filters to sessions.