Courses/Computer Science/CPSC 457.W2013/Lecture Notes/Creation

From wiki.ucalgary.ca
Jump to: navigation, search

Process Creation

In this session, we will continue our examination of how processes come to be. We will start by considering what a process is (see task_struct). We will also briefly trace our understanding of control flow involving invoking parts of the system call interface.

We will also have a multi-perspective look at the routines

  • execve
  • fork / clone / vfork

involved in process creation. We will glance over the source code of the kernel's routines for creating (or cloning) a process and loading an executable (i.e., ELF) image into a process address space. They lead to a chain of procedures in the OS that is a bit deeper and more complex than the system call interface might otherwise imply.

Notes


Last time we saw how we could talk directly to the kernel via the syscall interface

  • now let's write a program using write(2)
  • compare this with our assembly version
  • what is this interface?
  • where are the parts documented?
    • manual pages
    • show locations of syscall number definitions
  • what is the actual mechanism?
    • trace the ``control flow of making a system call
    • phrack article on IDT

Today, we'll look at what a process is

  • what is the purpose of an OS?
    • to support the execution of progams
    • protection
    • multiplex resources
    • what is an OS? (a kernel)
      • a kernel is just a compressed ELF
  • what is a process?
    • a process is ``a program in execution
    • PCB
    • PAS
    • what parts of the syscall API can be used to create a process?
  • we'll deal with an in-depth examination of the process address space later

Readings

  • MOS: Section 2.1: Processes (this should be partly review of what we've talked about in class)
  • MOS: Section 3.2.1: The Notion of an Address Space
  • MOS: Section 3.7 (all except 3.7.2) (this should review some of what we touched on in the previous class and lay some groundwork for talking about memory management)
  • MOS: Section 10.2.5 (Linux kernel structure)
  • MOS: Section 10.3.1 (about processes in Linux) should reinforce some class discussion