Software Project. Lecturers: Ran Caneti, Gideon Dror Teaching assistants: Nathan Manor, Ben Riva

Similar documents
CS240: Programming in C

EL2310 Scientific Programming

Lectures 5-6: Introduction to C

Lectures 5-6: Introduction to C

CS133 C Programming. Instructor: Jialiang Lu Office: Information Center 703

EL2310 Scientific Programming

CS Prof J.P.Morrison

Spring 2018 NENG 202 Introduction to Computer Programming

introduction week 1 Ritsumeikan University College of Information Science and Engineering Ian Piumarta 1 / 20 imperative programming about the course

CSCI 2132 Software Development. Lecture 2: Introduction to UNIX and Unix-like Operating Systems

CS 261 Fall C Introduction. Variables, Memory Model, Pointers, and Debugging. Mike Lam, Professor

CSE 303 Lecture 8. Intro to C programming

ITC213: STRUCTURED PROGRAMMING. Bhaskar Shrestha National College of Computer Studies Tribhuvan University

Programming in C and C++

COMP1917: Computing 1 1. Introduction

Features of C. Portable Procedural / Modular Structured Language Statically typed Middle level language

Programming Fundamentals (CS 302 ) Dr. Ihsan Ullah. Lecturer Department of Computer Science & IT University of Balochistan

Structure of this course. C and C++ Past Exam Questions. Text books

C Compilation Model. Comp-206 : Introduction to Software Systems Lecture 9. Alexandre Denault Computer Science McGill University Fall 2006

C Introduction. Comparison w/ Java, Memory Model, and Pointers

1. Introduction. Course Web Site. COMP1917: Computing 1. Textbook. Occupational Health and Safety (OHS)

Programming in C. What is C?... What is C?

Programming in C UVic SEng 265

Introduction to Computer Systems

Programming in C. What is C?... What is C?

COMP1917: Computing 1 1. Introduction

PROGRAMMAZIONE I A.A. 2017/2018

Programming in C and C++

Lecture 1: Preliminaries

CMPT 115. C tutorial for students who took 111 in Java. University of Saskatchewan. Mark G. Eramian, Ian McQuillan CMPT 115 1/32

(heavily based on last year s notes (Andrew Moore) with thanks to Alastair R. Beresford. 1. Types Variables Expressions & Statements 2/23

Chris Riesbeck, Fall Introduction to Computer Systems

Motivation was to facilitate development of systems software, especially OS development.

EE 209: Programming Structures for Electrical Engineering

CMSC 246 Systems Programming

Introduction to Computer Systems

CSC231 C Tutorial Fall 2018 Introduction to C

Motivation was to facilitate development of systems software, especially OS development.

Your Instructor. CSE Content. Notes. Notes. Notes. Summer May 4, 2010

EECS2031 Software Tools

by Pearson Education, Inc. All Rights Reserved.

CMPE-013/L. Introduction to C Programming

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

Introduction to C CMSC 104 Spring 2014, Section 02, Lecture 6 Jason Tang

Two s Complement Review. Two s Complement Review. Agenda. Agenda 6/21/2011

CIS* Programming

CS 220: Introduction to Parallel Computing. Beginning C. Lecture 2

Computer Programming

EE 209: Programming Structures for Electrical Engineering. (Many Slides Borrowed from Princeton COS 217)

Introduction to Linux

Programming. Data Structure

EECS 388 C Introduction. Gary J. Minden August 29, 2016

9/5/17. The Design and Implementation of Programming Languages. Compilation. Interpretation. Compilation vs. Interpretation. Hybrid Implementation

CS Basics 15) Compiling a C prog.

Berner Fachhochschule Haute cole spcialise bernoise Berne University of Applied Sciences 2

Class Information ANNOUCEMENTS

LECTURE/ STUDY NOTES ON C

Introduction to Computer Systems

Overview of Unix / Linux operating systems

Chapter 1. Preliminaries

CS 61C: Great Ideas in Computer Architecture Introduction to C

CS 326 Operating Systems C Programming. Greg Benson Department of Computer Science University of San Francisco

CS201 - Lecture 1 The C Programming Language

Lecture Topics. Announcements. Today: Operating System Overview (Stallings, chapter , ) Next: Processes (Stallings, chapter

Presented By : Gaurav Juneja

The C language. Introductory course #1

PRINCIPLES OF OPERATING SYSTEMS

Is it ever useful to be confident that a problem is hard?

Work relative to other classes

CS 211 Programming I for Engineers

TDDB68 Concurrent Programming and Operating Systems. Lecture 2: Introduction to C programming

Index. Course Outline. Grading Policy. Lab Time Distribution. Important Instructions

Introduction to C. Robert Escriva. Cornell CS 4411, August 30, Geared toward programmers

Unit 1: Introduction to C Language. Saurabh Khatri Lecturer Department of Computer Technology VIT, Pune

Part 1: Introduction to the C Language

CSE 307: Principles of Programming Languages

COP4020 Programming Languages. Compilers and Interpreters Robert van Engelen & Chris Lacher

COS 217: Introduction to Programming Systems!

Draft. Chapter 1 Program Structure. 1.1 Introduction. 1.2 The 0s and the 1s. 1.3 Bits and Bytes. 1.4 Representation of Numbers in Memory

CHAPTER 1 Introduction to Computers and Java

BLM2031 Structured Programming. Zeyneb KURT

C - Basics, Bitwise Operator. Zhaoguo Wang

EL2310 Scientific Programming

COS 217: Introduction to Programming Systems!

Compiling and Running a C Program in Unix

Saint Louis University. Intro to Linux and C. CSCI 2400/ ECE 3217: Computer Architecture. Instructors: David Ferry

Recap: Pointers. int* int& *p &i &*&* ** * * * * IFMP 18, M. Schwerhoff

CSCI 2132 Software Development. Lecture 8: Introduction to C

CS 110 Computer Architecture. Lecture 2: Introduction to C, Part I. Instructor: Sören Schwertfeger.

Fundamentals of Programming. Lecture 1: Introduction to C Programming

Principles of Programming Languages. Lecture Outline

CS 110 Computer Architecture. Lecture 2: Introduction to C, Part I. Instructor: Sören Schwertfeger.

CS 113: Introduction to

Introduction to Cygwin Operating Environment

Introduction to C. Sean Ogden. Cornell CS 4411, August 30, Geared toward programmers

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

Chapter 1: Introduction to Computers and Java

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java

EP241 Computer Programming

Princeton University Computer Science 217: Introduction to Programming Systems. Agenda. COS 217: Introduction to Programming Systems.

Transcription:

Software Project Lecturers: Ran Caneti, Gideon Dror Teaching assistants: Nathan Manor, Ben Riva Emails: (canetti/benriva)@post.tau.ac.il nathan.manor@gmail.com gideon@mta.ac.il http://www.cs.tau.ac.il/~roded/courses/soft-project10.html These slides: http://www2.mta.ac.il/~gideon/courses/c/slides/ A Book on on C - ABC Kelley/Pohl, Addison-Wesley Fourth Edition

Course Structure The C programming language: 8-9 classes including 3 exercises (20%). Large project, in pairs (50%). 2 classes will be devoted to its presentation. Final exam (30%).

The C programming language B, initial versions of UNIX, 1970 C, Dennis Ritchie, Bell Labs, 1972; overcomes B s typeless representation; used for developing UNIX. Early 80 s - traditional C 1990 the ANSI-C standard C++ (1980) and Java (1990 s)

Why C? C is powerful and efficient: direct memory management, some operators directly modify machine registers, manipulation of memory addresses. Efficient compiler. C is compact: few reserved words, concise commands, powerful set of operators. C is portable: code written on one machine can be easily moved to another. C is modular and typed. C is the native language of UNIX. Basis of C++ (and Java).

C vs. Java Java C++ C Assembly Language Abstraction, machine independence

C vs. Java Java was developed based on C and inherited most of its syntax. Main difference: C is procedural and not objectoriented. Thus, no classes/interfaces; methods are called functions and do not belong to any object. Similar primitive types as in Java, but no boolean and string types; C is much less structured. It is easier to make mistakes and harder to recover

C vs. Java (cont.) Pointers instead of references. Allow direct access to memory and dereferencing (but less elegant). No garbage collection need to manage memory explicitly. Preprocessor. Compilation to machine code faster but some platform dependency; java is processed via an interpreter (JVM).

C vs. Java small differences No for/in (iterating within a set) No function overloading Arrays are not objects cannot apply methods to them (e.g. no cloning). Global variables. Variable declarations only in the beginning of a block. Composite types such as union and bitfield; typedef. Function pointers.

Lexical elements (Ch. 2) C Topics Fundamental data types (Ch. 3) Flow of control (Ch. 4) Functions (Ch. 5); Runtime environment Arrays, pointers and strings (Ch. 6); Dynamic matrix allocation (Ch. 12.6) Bitwise operators (Ch. 7) Preprocessor (Ch. 8) Structures and enumeration types (Chs. 9 & 7.5) Linked lists (Ch. 10) Input/output and files (Ch. 11)

Programming Environment Unix Make

Operating System Operating system: Manages the available hardware (CPU, memory ) and software (editors, development tools ) resources. Provides interface for using them by multiple users. Shell: command-line interpreter to interface the OS.

The Unix OS Unix: multi-user, multi-process OS; open source. History: 1969 Initial version by Thompson & Ritchie at Bell Labs (assembly and later B). 70 s Rewritten in C. 80 s System-V (AT&T) and BSD (Berkeley) versions. 90 s Linux by Linus Torvalds. For basic introduction and commands see web-page.

Programming Project Goals: Build software system. Memory management. Fit spec & understand complex requirements. Basic file & disc handling. Receive & interface with external code. Testing and debug purpose functions.

Project story WindowsME had a serious weakness in password authentication method - trust one-way function that is actually easy to invert. Breaking using rainbow-table Preprocessing all possible passwords, and save it efficiently. Disc-space vs. Access-time tradeoff.

Assignments Ex1 (5%) : Break RSA on 32bit keys. Flow-control, smart use of variables. Ex2 (5%) : Legal password generation. String manipulation, simplest memory management. Ex3(10%): Implementing hash-table Lists, correct memory management. Project (50%): Passwords authentication, and its retrieving using rainbow tables. Large system, accessing to disc, files. Huge runs (debug with small runs)

From source code to Three main steps: executable Preprocessing: First pass on the file that substitutes human-friendly text with machine firendly representation Compilation: Generation of object code Linking: Combining several object code files into a single executable set of instructions

Example 1 #include <stdio.h> int main(void) { printf("hello, world!\n"); return 0; } Source -> preprocssing -> compiling -> linking -> executable hello.c "gcc c hello.c" "gcc hello.o" hello.exe