IC221: Systems Programming (SP14)


Home Policy Calendar Syllabus Resources Piazza

Lecture 01: UNIX and You

Table of Contents

unix-plate2.jpg

1 Review the Course Policy

Grading Breakdown:

  • 25% Final Exam
  • 25% 6-/12-week Exam
  • 30% Labs
  • 15% Homework
  • 5% Participation
  • 6-week/12-week: (40% Exams, 35% Lab, 20% Homework, 5% Participation)

Lab Policy:

  • All labs are due Thur. 23:59PM
  • 1-day late: 10%
  • 2-day late: 25%
  • 3-day late: 50%
  • 3 Grace Days can be used to avoid a late penalty
  • Grace days and late days do not mix

Lab Collaboration Policy:

  • You may not work with others on labs, look at other code
  • All work must be your own
  • You may discuss the lab and help each other abstractly

Homework Policy:

  • All homework is due Monday in lecture
  • No late homework will be accepted
  • If you are on MO or SIQ, you must turn in homework at the next, most convenient class

Homework Collaboration Policy:

  • You may collaborate freely on the homework
  • Everyone must turn in there own homework with their own work
  • Copying homework is strictly forbidden

2 What is this class about?

IC221 is about Systems Programming and the UNIX environment

  • User interacting with the OS through the shell and command line tools
  • Programs interaction with the OS through the System Call API
  • Programs interacting with Other Programs through the Operating System
  • Programs interaction with Other Programs on Different Systems

2.1 Goals:

  • You will learn the standard UNIX command line tools
  • You will learn simple shell interaction and scripting
  • You will learn to program in C and use the OS System Call API
  • You will learn the process life cycle
  • You will learn inter-process communication
  • You will learn how to interact with the file system
  • You will learn how to communicate over the network
  • You will learn about process concurrency

2.2 Why is this class important?

  • In IC210 you learned how to think algorithmically without much concern for the system that executes your code
  • In IC221 you pull back the covers and see how the OS supports your program. For example, to print the terminal requires a huge effort from the OS, which you will learn in detail.
  • In IC221 you learn to interact with the OS on multiple levels: user-to-shell, program-to-OS, and system-to-system
  • In IC221 you become competent users of UNIX and the C programming interface, which is vital to understanding systems computing.

3 The 1000 Foot View of the UNIX system

unix-history.png

unix-simple.png

Why UNIX?

  • UNIX is an important OS in the history of computing
  • Two major OS'es variants, UNIX-based and Windows-Based
  • Used in a lot of
  • UNIX derivatives are open source and well known to the community
  • The skills you learn on UNIX are easily translated to other OS platforms.

Unix has a rich history dating back to the development of Multics and then Unic system. First developed at AT&T Bell labs in the early 70's. These early forms have dispersed and integrated into computing, include the Ununtu, Debian Linux Variants variants we use here and the MacOS, BSD variants. Unix is even run on the mobile platforms, both iOS and Android are based on Unix system architecture.

3.1 The Unix Components

The Unix-Computer ecosystem can be divided into three main parts:

  • User Space: Defines the applications, libraries, and standard utilities that are user accesible.
  • Kernel Space: This is the program that is the OS, the cenral part of the OS. A primary job of the OS to pair user applications with the underlying hardware. For example, how does a user input event through keyboard, typing 'a', get translated into 'a' appearing on the screen.
  • Hardware: The underlying physical components of the computer. These include Input/Output devices, like keyboards and monitors, the CPU which does ccalculations, the memory componets, and the network interface.

TheBigPicture.png

The OS'es primary task is to manage services as an interface between the user and the hardware. Examples include:

  • File System: managing files on the user
  • Device I/O: managing input from devices
  • Process: Starting, running, and stopping programs, and allowing multiple programs to run at once, i.e., program multiplexing
  • Memory Management: Allocating runtime memory for process and seperating memory between process and between user-space and the kernel-space

From a user of the OS, you will see these interactions from two perspectives:

  • Shell: You will use the shell to interact with the OS
  • System Call API: You will program in C to interact with the OS

Why C?

  • C is a low level language
  • The OS is written in C
  • Understanding the OS and C together is a natural procces and will make you a better programmer

4 Where we will go in this course

This course consists of 4 major units:

  1. Shell: Becoming proficient at interacting with the OS through the shell
  2. C Programming: Becoming proficient at interacting with OS with C
  3. OS I/O Interfaces: Interacting with the File System and the Network interface
  4. Concurrency: Managing threads competing for a single resource