CS 410/510 Languages and Low-Level Programming

Credit Hours: 4/3
Course Coordinator: Mark Jones
Course Description: This course is about the development of low-level, bare-metal systems—with particular focus on microkernels—and about the role and design of programming languages in this application domain—from low-level assembly, to high-level functional and domain specific languages. The course material is organized in to three parts:
  1. An overview of conventional, low-level programming techniques. This will include an introduction to some of the programmable hardware components of a typical PC system (such as the memory management unit, interrupt controller, and timer) and their use in the implementation of fundamental operating system abstractions.

  2. Case studies of practical microkernel implementations. These case studies will be used to develop a more detailed understanding of the requirements for the programming languages that are used in their construction. The two specific microkernels that we plan to study are "pork", which is an implementation of L4 developed at PSU, and "seL4", which is a "security-enhanced" version of L4, developed by a team in Australia, that uses a capability abstraction for access control and resource management. The seL4 system, in particular, has gained some fame in recent years as "the world's first operating system kernel with an end-to-end proof of implementation correctness and security enforcement."

  3. Reflections on the design of programming languages for use in this application domain. This part of the course will build on and be informed by the examples that we have seen in earlier sections. In particular, we will look at some of the distinguishing features of Habit, a functional programming language with some specific language features and a broad adoption of abstract datatypes, that has been specifically designed to target the development of low-level systems.

Prerequisites: There are no formal prerequisites for this class, but students are expected to have some background in operating systems (as a result of taking a class like CS333 at the undergraduate level or CS533 at the graduate level) and programming languages (as a result of taking classes like CS321/322 at the undergraduate level or CS558 at the graduate level). As a practical consideration, this class will involve substantial programming exercises using C and assembly language in a IA32 Linux environment. Prior experience with the Linux command line and standard toolset will be expected, together with significant programming experience.

Course Objectives:

Upon the successful completion of this course, students will be able to:

  1. Write simple programs that can run in a bare-metal environment using low-level programming languages.
  2. Discuss common challenges in low-level systems software development, including debugging in a bare-metal environment.
  3. Explain how conventional operating system features (multiple address spaces, context switching, protection, etc.) motivate the desire for (and benefit from) hardware support.
  4. Develop code to configure and use programmable hardware components such as a memory management unit (MMU), interrupt controller (PIC), and interval timer (PIT).
  5. Describe the key steps in a typical boot process, including the role of a bootloader.
  6. Describe the motivation, implementation, and application of microkernel abstractions for managing address spaces, threads, and interprocess communication (IPC).
  7. Explain the use and implementation of capabilities in access control and resource management.
  8. Develop programs using the capability abstraction provided by the seL4 microkernel.
  9. Illustrate the use of a range of domain specific languages in the development of systems software.
  10. Use practical case studies to evaluate and compare language design proposals.
  11. Describe features of modern, high-level programming languages---including abstract datatypes and higher-order functions---and show how they can be leveraged in the construction of low-level software.
  12. Explain how the requirements of low-level systems programming motivate the desire for (and benefit from) language-based support.

Masters Tracks:

For students taking the CS 510 version of this course as part of a Masters Degree program, it is intended that this class can be used as a contribution towards the "Languages" track of the masters program. It may also be possible for this class to be counted towards the systems track, or perhaps the security track instead, subject to department, instructor, and advisor approval. Please see the instructor if you wish to pursue this possibility.

Textbooks: There is no required textbook, but there are lots of useful resources that are available on the web; we will provide links to appropriate materials as the course progresses
References: None.
Major Topics:

1. Low-level, bare-metal systems

2. Microkernels

3. Programmable hardware

4. Memory management

5. Interrupts

6. Operating system abstractions

7. Capabilities

8. Programming language design

9. Assembly, imperative, functional, and domain-specific languages.

Laboratory Exercises:

Supporting software:

The primary working environment for this class will be a Linux virtual machine, which can be hosted on Linux, Windows, and Mac OS X computers using VirtualBox. Use of the Unix command line, as well as assembly language and C programming tools is expected.