Address spaces and kernel organizaton

Required reading: Exokernel paper.

Intro

  • Draw picture with multiple applications, OS, and hardware. OS provides a virtual computer to each application. The virtual computer's interface is the processor's instruction set and the OS interface. The OS interface is the API for system services (e.g., fork, exec, pipe, signal, open, read, etc.).
  • Goal of OS: fault isolation between applications in picture

    Method: give each applications its own virtual processor using threads (L9) and address spaces.

    Address spaces

    Address spaces provide each application with the ideas that it has a complete memory for itself. all the addresses it issues are its addresses (e.g., each application has an address 0).

  • Why does this work? load/stores/jmps cannot touch/enter another application's data/text
  • How do you give each application its own address space?
  • What if two applications want to share real memory? Map the physical address twice, once in each address space
  • How do you give an application access to a memory-mapped-IO device? Map the physical address for the device into the applications address space.
  • How to manage address spaces? That is, switching, creating, deleting, growing, mapping devices in, etc. Reuse the address ideas: have one address space that includes all others. This special address spaces can manage all address spaces then. This special address space is called the kernel address space. How to protect the kernel?
  • How do you get off the ground?

    Operating system organizations

    A central theme in operating system design is how to organize the operating system. It is helpful to define a couple of terms:

    Example: trace a call to printf made by an application

    There are roughly 4 operating system designs:

    Although monolithic operating systems are the dominant operating system architecture for desktop and server machines, it is worthwhile to consider alternative architectures, even it is just to understand operating systems better. This lecture looks at exokernels, because that is what you will building in the lab. Later in the term we look at microkernels and virtual machines.

    Exokernels

    The exokernel architecture takes an end-to-end approach to operating system design. In this design, the kernel just securely multiplexes physical resources; any programmer can decide what the operating system interface and its implementation are for his application. One would expect a couple of popular APIs (e.g., UNIX) that most applications will link against, but a programmer is always free to replace that API, partially or completely. (Draw picture of JOS.)

    Compare UNIX interface (v6 or OSX), JOS kernel interface, and exokernel interface.

    To illustrate the differences between these interfaces in more detail consider implementing the following:

    How well can each kernel interface implement the above examples? (Start with UNIX interface and see where you run into problems.) (The JOS kernel interface is not flexible enough: for example, ipc_receive is blocking.)

    Exokernel paper discussion

    The central challenge in an exokernel design it to provide flexibility, but provide fault isolation. This challenge breaks down into three problems: