Syllabus Outline for Computer Systems and Programming | CS 367, Study notes of Computer Science

Material Type: Notes; Class: Computer Systems and Programm; Subject: Computer Science; University: George Mason University; Term: Unknown 1989;

Typology: Study notes

Pre 2010

Uploaded on 02/12/2009

koofers-user-vfh
koofers-user-vfh 🇺🇸

10 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Computer Systems &
Programming (CS 367)
Section 001: Prof. Pearl Wang
Section 002: Prof. Elizabeth White
Spring 2009
1-2
Course Goals
Previous courses (CS 112, CS 211): high-level
programming in Java/C++
This course: exposes you to C and assembly
programming
C is a procedural language (not object-oriented)
Commonly used for “low-level” systems programming and
embedded systems
Theme of the course: strip away abstractions provided by
high-level languages such as Java and let you
understand what goes on “under the hood”
1-3
Course Goals cont’d
Abstractions have limits
Especially in the presence of bugs
Need to understand underlying implementations
Useful outcomes
Become more effective programmers
Able to find and eliminate bugs efficiently
Able to tune program performance
Prepare for later “systems” classes in CS & ECE
Compilers, Operating Systems, Networks, Computer
Architecture
1-4
Great Reality #1
Int’s are not Integers, Float’s are not Reals
Examples
Is x2 0?
Float’s: Yes!
Int’s:
40000 * 40000 --> 1600000000
50000 * 50000 --> ??
Is (x + y) + z = x + (y + z)?
Unsigned & Signed Int’s: Yes!
Float’s:
(1e20 + -1e20) + 3.14 --> 3.14
1e20 + (-1e20 + 3.14) --> ??
pf3
pf4
pf5

Partial preview of the text

Download Syllabus Outline for Computer Systems and Programming | CS 367 and more Study notes Computer Science in PDF only on Docsity!

Computer Systems &

Programming (CS 367)

Section 001: Prof. Pearl Wang

Section 002: Prof. Elizabeth White

Spring 2009

1-

Previous courses (CS 112, CS 211): high-level Course Goals

programming in Java/C++

This course: exposes you to C and assembly

programming

C is a procedural language (not object-oriented)

Commonly used for “low-level” systems programming and embedded systems

Theme of the course: strip away abstractions provided by

understand what goes on “under the hood”high-level languages such as Java and let you

Abstractions have limits Course Goals cont’d

Especially in the presence of bugs

Need to understand underlying implementations

Useful outcomes

Become more effective programmers

 Able to find and eliminate bugs efficiently

 Able to tune program performance

Prepare for later “systems” classes in CS & ECE

 Compilers, Operating Systems, Networks, Computer Architecture

Examples Int’s are not Integers, Float’s are not Reals Great Reality

Is x

2 

 Float’s:

Yes!

 Int’s:

 40000 * 40000 --> 1600000000

 50000 * 50000 --> ??

Is (x + y) + z = x + (y + z)?

 Unsigned & Signed Int’s:

Yes!

 Float’s:

 (1e20 + -1e20) + 3.14 --> 3.

 1e20 + (-1e20 + 3.14) --> ??

1-

Does not generate random values Computer Arithmetic

Arithmetic operations have important mathematical properties

Cannot assume “usual” properties

Due to finiteness of representations

Integer operations satisfy “ring” properties

 Commutativity, associativity, distributivity

Floating point operations satisfy “ordering” properties

 Monotonicity, values of signs

Observation

Need to understand which abstractions apply in which contexts

Important issues for compiler writers and serious application programmers

1-

Great Reality #

Great Reality # Memory Referencing Bug Example

{ main ()

exit(0);printf("d = %.15g\n", d);a[2] = 1073741824; /* Out of bounds reference */double d = 3.14;long int a[2];

}

A

lph

a

M

I PS

Linux

-g

5.30498947741318e-

-O

(Linux version gives correct result, but segmentation fault.)implementing as separate function gives

1-

Randal E. Bryant and David R. O’Hallaron, Textbooks

“Computer Systems: A Programmer’s Perspective”, Prentice Hall 2003.

csapp.cs.cmu.edu

Brian Kernighan and Dennis Ritchie,

“The C Programming Language, Second Edition”, Prentice Hall, 1988

You can use any book on C

1-

Exceptional Control Flow & Virtual Memory (3 weeks)Linking (1 week)Program Representation (5 weeks)Data Representation (2 weeks)Programming in C (2 weeks) Course Outline

Assumption: You are comfortable programming in Java Programming in C

and/or C++

TopicsC is a procedural (imperative) programming language

C Standard I/O library for input/output

Bit-level operators

Pointers & Structures

Memory allocation and deallocation

Assignment

HW1: Write a non-trivial program in C

Machine-level Representation of Data and Programs

Topics

Bits operations, arithmetic, assembly language programs, representation of C control and data structures

Includes aspects of of architecture and compilers

Assignments

Lab1: Manipulating bits

Lab2: Defusing a binary bomb

Lab3: Hacking a buffer bomb

1-

Topics Linking and Exceptional Control Flow

Object files, static and dynamic linking, libraries, loading

Hardware exceptions, processes, process control, Unix signals, nonlocal jumps

Virtual Memory

Includes aspects of compilers, OS, and architecture

Assignments

Lab4 (optional): Writing your own shell with job control

1-

Each assignment should have a well-defined goal such as Rationale for Assignments

  • solving a puzzle or winning a contest.  Defusing a binary bomb.

Doing an assignment should result in new skills and

  • concepts  Lab1: computer arithmetic, digital logic.

Lab2,3: assembly language, using a debugger, understanding the stack

Lab4: understanding Unix process control and signals

Logistics

Grading



Homeworks (15 %) and Lab Assignments (35%) 

 can work in groups of two for homeworks



 will be able to work in groups of two for later programming assignments



 gradingAll programs will be submitted and tested on a Linux platform for

 You need to obtain an IT&E Unix Cluster account (See syllabus)



Midterm (25%) & Final (25%)

What is cheating? Cheating

Sharing code: either by copying, retyping, looking at, or supplying a copy of a file.

What is NOT cheating?

Helping others use systems or tools.

Helping others with high-level design issues.

Helping others debug their code.

Penalty for cheating:

Removal from course with failing grade.