Docsity

CSE 333 Lecture 1: Systems Programming Introduction, Lecture notes of Software Engineering

Partial preview of the text

Download CSE 333 Lecture 1: Systems Programming Introduction and more Lecture notes Software Engineering in PDF only on Docsity!

CSE 333

Lecture 1 - Systems programming

Hal Perkins

Department of Computer Science & Engineering

University of Washington

Welcome!

Today’s goals:

- (^) introductions - (^) big picture - (^) course syllabus - (^) setting some expectations

Welcome!

Today’s goals:

- (^) introductions - (^) big picture - (^) course syllabus - (^) setting some expectations

Course map: 100,000 foot view

hardware

operating system

HW/SW interface (x86 + devices) CPU memory^ storage^ network GPU clock audio radio peripherals OS / app interface (system calls) C standard library (glibc) C application C++ STL / boost / standard library C++ application JRE Java application

A layered view layer below

your system

client layer below client client

- • •

understands

and relies on

layers below

provides

service to

layers above

A layered view layer below

your system

client layer below client client

- • • constrained by performance, footprint, behavior of the layers below

more useful,

portable, reliable

abstractions

Another example system

Web server framework

  • (^) a software layer that abstracts away the messy details of OSs, HTTP protocols, and storage systems to simplify building powerful, scalable Web services
  • (^) modules: ‣ (^) HTTP server, HTML template system, database storage, user authentication system, ...
  • (^) also has many, many tradeoffs ‣ (^) programmer convenience vs. performance ‣ (^) simplicity vs. extensibility

Systems programming

The programming skills, engineering discipline, and

knowledge you need to build a system

  • (^) programming : C / C++
  • (^) discipline : testing, debugging, performance analysis
  • (^) knowledge : long list of interesting topics ‣ (^) concurrency, OS interfaces and semantics, techniques for consistent data management, algorithms, distributed systems, ... ‣ (^) most important: deep understanding of the “layer below” - (^) quiz: how many copies of your data are made when you use the read( ) system call to read from a file?

Programming languages

Structured but low-level languages (C, C++)

  • (^) hides some architectural details, is mostly portable, has a few useful abstractions like types, arrays, procedures, objects
  • (^) permits (forces?) programmer to handle low-level details like memory management, locks, threads
  • (^) low-level enough to be fast and to give the programmer control over resources ‣ (^) double-edged sword: low-level enough to be complex, error-prone ‣ (^) a useful shield: engineering discipline

Programming languages

High-level languages (Python, Ruby, JavaScript, ...)

  • (^) focus on productivity and usability over performance
  • (^) powerful abstractions shield you from low-level gritty details (bounded arrays, garbage collection, rich libraries, ...)
  • (^) usually interpreted, translated, or compiled via an intermediate representation
  • (^) slower (by 1.2x-10x), less control

Knowledge

Tools

  • (^) gcc, gdb, g++, objdump, nm, gcov/lcov, valgrind, IDEs, race detectors, model checkers, ...

Lower-level systems

  • (^) UNIX system call API, relational databases, map/reduce, Django, jQuery, ...

Systems foundations

  • (^) transactions, two-phase commit, consensus, RPC, virtualization, cache coherence, applied crypto, ...

Welcome!

Today’s goals:

- (^) introductions - (^) big picture - (^) course syllabus - (^) setting some expectations

Interacting with UNIX and standard libraries

The “layers below” we will be relying on

  • (^) learn C’s standard library and some of C++’s STL ‣ (^) including memory management (malloc/new, free/delete) ‣ (^) we’ll look at some of C++11 and boost
  • (^) learn aspects of the UNIX system call API ‣ (^) I/O: storage, networking ‣ (^) process management, signals

Potential additional topics

Concurrency

  • (^) threads
  • (^) perhaps asynchronous I/O and event-driven programming

Security

  • (^) will be mindful of security topics as they come up
  • (^) e.g., how to avoid buffer overflow issues in C/C++