Introduction CS 351: Systems Programming Michael Saelee - - PowerPoint PPT Presentation

introduction
SMART_READER_LITE
LIVE PREVIEW

Introduction CS 351: Systems Programming Michael Saelee - - PowerPoint PPT Presentation

Introduction CS 351: Systems Programming Michael Saelee <lee@iit.edu> Computer Science Science Michael (Sae) Lee - lee@iit.edu - http://moss.cs.iit.edu - Office: SB 226C - Hours: Wed & Fri 3:15PM-5:15PM Computer Science Science


slide-1
SLIDE 1

Introduction

CS 351: Systems Programming Michael Saelee <lee@iit.edu>

slide-2
SLIDE 2

Computer Science Science

  • lee@iit.edu
  • http://moss.cs.iit.edu
  • Office: SB 226C
  • Hours: Wed & Fri 3:15PM-5:15PM

Michael (Sae) Lee

slide-3
SLIDE 3

Computer Science Science

  • Syllabus & Administrivia
  • Course overview (“Systems Programming”)

Agenda

slide-4
SLIDE 4

Computer Science Science

§Syllabus

slide-5
SLIDE 5

Computer Science Science

  • “substantial” programming experience
  • data structures: concepts & implementation
  • basic run-time analysis (big O)
  • knowledge of (any) assembly language
  • computer organization essentials

Prerequisites

slide-6
SLIDE 6

Computer Science Science

  • computer organization essentials:
  • data representation (binary, two’s comp,

f.p. inaccuracy, etc.)

  • von Neumann model
  • CPU, memory, I/O
  • stack usage / conventions
slide-7
SLIDE 7

Computer Science Science

1.Course website moss.cs.iit.edu/cs351

  • static information
  • lecture calendar, assignment writeups,

slides, screencasts, links, etc.

Online resources

slide-8
SLIDE 8

Computer Science Science

2.Blackboard

  • only for grade reporting!

Online resources

slide-9
SLIDE 9

Computer Science Science

3.Vimeo channel: screencasts

  • vimeo.com/channels/cs351
  • walkthroughs & tutorials

(check before starting labs!)

Online resources

slide-10
SLIDE 10

Computer Science Science

4.Piazza: discussion forum

  • all class-related questions
  • monitored by TAs
  • scales way better than e-mail

Online resources

slide-11
SLIDE 11

Computer Science Science

Textbooks

slide-12
SLIDE 12

Computer Science Science

Grading

  • 40% Labs
  • 30% Midterm exam
  • 30% Final exam
  • exam scores may be normalized to 70%
slide-13
SLIDE 13

Computer Science Science

Labs

  • 5-6 fairly substantial machine problems
  • 100-1000 LOC
  • real-world application of concepts covered in

lecture & textbook

slide-14
SLIDE 14

Computer Science Science

§Course Overview

slide-15
SLIDE 15

Computer Science Science

“Systems Programming”

system |ˈsistəm|

noun 1 a set of connected things or parts forming a complex whole

(New Oxford American Dictionary)

slide-16
SLIDE 16

Computer Science Science

“Systems Programming”

  • Programming the operating system
  • What does that mean?
slide-17
SLIDE 17

Computer Science Science

OS vs. OS kernel

  • OS kernel ≈ smallest subset of OS code

needed to bootstrap system and provide basic services to user programs

  • “smallest” is debatable
slide-18
SLIDE 18

Computer Science Science

How to “program” it?

  • Require some API
  • Application Programming Interface
  • A collection of (documented) functions
  • e.g., get/put/del for a hashtable
slide-19
SLIDE 19

Computer Science Science

OS API

  • a.k.a. “system call” interface
  • OS as a very low-level library
  • common purpose: provide services to user

level programs

  • def: program in execution = process
slide-20
SLIDE 20

Computer Science Science

The Process

  • A program in execution
  • Code + Data { global, local, dynamic }

+OS kernel data

  • OS hides complexity of machine from

processes by creating abstractions

slide-21
SLIDE 21

Computer Science Science

http://xkcd.com/

“Abstraction”

slide-22
SLIDE 22

Computer Science Science

Primary Abstractions

  • Logical control flow
  • Exceptional (extra-process) control flow
  • Logical address space
  • Uniform I/O
  • Interprocess Communication
slide-23
SLIDE 23

Computer Science Science

  • … every program had to include its own

implementation of all the above!

  • Now, OS simplifies life for all of us.
  • Only need to know how to use them, not

how they’re implemented.

In the old days …

slide-24
SLIDE 24

Computer Science Science

But!

  • In this class we dig a bit deeper
  • What facilities are encapsulated by syscalls?
  • What limitations/restrictions do they have?
  • Why are they designed the way they are?
  • How do they work behind the scenes?
slide-25
SLIDE 25

Computer Science Science

But why should I care?

slide-26
SLIDE 26

Computer Science Science

  • efficiency: know how to use tools optimally;

reuse existing features and design/layer new

  • nes appropriately
  • robustness: avoid bugs/failures & know how to

diagnose and fix them

slide-27
SLIDE 27

Computer Science Science

the real reason: it’s fun to take things apart!

slide-28
SLIDE 28

Computer Science Science

goal: turn you into a hacker

slide-29
SLIDE 29

Computer Science Science

(or: make you a better hacker)

slide-30
SLIDE 30

Computer Science Science

The Jargon File, version 4.4.7

hacker |ˈhakər|

noun 1 A person who enjoys exploring the details of programmable systems and how to stretch their capabilities, as opposed to most users, who prefer to learn only the minimum necessary.

slide-31
SLIDE 31

Computer Science Science

Our tools (& approach)

  • C & Linux
  • C: low-level language
  • GNU Linux: open source kernel & tools
  • GNU gdb & gcc; debugger & compiler
slide-32
SLIDE 32

Computer Science Science

Fourier

  • All labs must be tested and submitted on the

class Linux server: fourier.cs.iit.edu

  • You should’ve received an e-mail with

account info already — let me know if not!

  • Log in via SSH client, submit work via Git
  • BitBucket invitations are coming