CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209

Similar documents
CSC209. Software Tools and Systems Programming.

CSC209: Software Tools and Systems Programming. Richard Krueger Office hours: BA 3234

CSC209H Lecture 1. Dan Zingaro. January 7, 2015

COURSE INTRODUCTION. Software Tools EECS2031 Winter 2018 Manos Papagelis. Thanks to Karen Reid and Alan J Rosenthal for material in these slides

UNIX File Hierarchy: Structure and Commands

1 Installation (briefly)

COSC 2P95. Introduction. Week 1. Brock University. Brock University (Week 1) Introduction 1 / 18

Welcome to Linux. Lecture 1.1

Introduction to Unix: Fundamental Commands

Basic Survival UNIX.

Getting your department account

CS246 Spring14 Programming Paradigm Notes on Linux

commandname flags arguments

Today. An Animated Introduction to Programming. Prerequisites. Computer programming

CS 3030 Scripting Languages Syllabus

Unix File System. Class Meeting 2. * Notes adapted by Joy Mukherjee from previous work by other members of the CS faculty at Virginia Tech

CMSC 201 Spring 2018 Lab 01 Hello World

Course Overview and Introduction to the UNIX Shell

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

CS 300. Data Structures

CS197U: A Hands on Introduction to Unix

Open up a terminal, make sure you are in your home directory, and run the command.

Exploring UNIX: Session 3

DAVE LIDDAMENT INTRODUCTION TO BASH

Assignment 1: Communicating with Programs

This lab exercise is to be submitted at the end of the lab session! passwd [That is the command to change your current password to a new one]

: the User (owner) for this file (your cruzid, when you do it) Position: directory flag. read Group.

Introduction to Linux

Files and Directories

CENG393 Computer Networks Labwork 1

Chapter-3. Introduction to Unix: Fundamental Commands

CMSC 201 Spring 2017 Lab 01 Hello World

Introduction: What is Unix?

CSC UNIX System, Spring 2015

The Unix Shell & Shell Scripts

Exercise Sheet 2. (Classifications of Operating Systems)

Getting started with Hugs on Linux

Hitchhiker s Guide to VLSI Design with Cadence & Synopsys

EECS2301. Lab 1 Winter 2016

24 Writing Your First Script

CS451 - Assignment 8 Faster Naive Bayes? Say it ain t so...

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering

CST8207: GNU/Linux Operating Systems I Lab Ten Boot Process and GRUB. Boot Process and GRUB

Project 1 Balanced binary

Introduction to Unix May 24, 2008

Spring Modern Computer Science in a Unix Like Environment CIS c

1. What statistic did the wc -l command show? (do man wc to get the answer) A. The number of bytes B. The number of lines C. The number of words

Introduction to Linux

A Big Step. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

Getting Started with Linux

Unix Filesystem. January 26 th, 2004 Class Meeting 2

Introduction to Linux for BlueBEAR. January

Table Of Contents. 1. Zoo Information a. Logging in b. Transferring files 2. Unix Basics 3. Homework Commands

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

CS 241 Data Organization. August 21, 2018

Operating Systems, Unix Files and Commands SEEM

CS/CIS 249 SP18 - Intro to Information Security

Problem Set 1: Unix Commands 1

Introduction to Linux. Woo-Yeong Jeong Computer Systems Laboratory Sungkyunkwan University

Introduction to the Linux Command Line

Linux for Beginners. Windows users should download putty or bitvise:

Getting started with Hugs on Linux

Basic File Attributes

GNU/Linux 101. Casey McLaughlin. Research Computing Center Spring Workshop Series 2018

Unix Handouts. Shantanu N Kulkarni

Instructions PLEASE READ (notice bold and underlined phrases)

Introduction to Supercomputing

Linux Essentials. Programming and Data Structures Lab M Tech CS First Year, First Semester

Filesystem and common commands

Linux File System and Basic Commands

27-Sep CSCI 2132 Software Development Lab 4: Exploring bash and C Compilation. Faculty of Computer Science, Dalhousie University

CSE II-Sem)

Using UNIX. -rwxr--r-- 1 root sys Sep 5 14:15 good_program

Introduction. Overview of 201 Lab and Linux Tutorials. Stef Nychka. September 10, Department of Computing Science University of Alberta

ENCM 339 Fall 2017: Editing and Running Programs in the Lab

Introduction to Linux

Lab 1 Introduction to UNIX and C

15-122: Principles of Imperative Computation

INF322 Operating Systems

CS120 Computer Science I. Instructor: Jia Song

Unix. Examples: OS X and Ubuntu

Principles of Bioinformatics. BIO540/STA569/CSI660 Fall 2010

Operating Systems, Spring 2015 Course Syllabus

A Brief Introduction to the Linux Shell for Data Science

9 and 11-Jan CSCI 4152/6509 Natural Language Processing Lab 1: FCS Computing Environment, SVN Tutorial. FCS Computing Environment, SVN Tutorial

CS354 gdb Tutorial Written by Chris Feilbach

University of Maryland at College Park Department of Geographical Sciences GEOG 477/ GEOG777: Mobile GIS Development

LAB 0: LINUX COMMAND LINE AND SVN

Scripting. Shell Scripts, I/O Redirection, Ownership and Permission Concepts, and Binary Numbers

CISC 220 fall 2011, set 1: Linux basics

Scripting Languages Course 1. Diana Trandabăț

CS240: Programming in C

Lab 4: Shell Scripting

The Linux Command Line: A Complete Introduction, 1 st ed., by William E. Shotts, Jr., No Starch Press, 2012.

9.2 Linux Essentials Exam Objectives

Operating Systems. Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) alphapeeler.sf.net/pubkeys/pkey.htm

AIMS FREQUENTLY ASKED QUESTIONS: STUDENTS

Linux Systems Administration Getting Started with Linux

Mills HPC Tutorial Series. Linux Basics I

TECH 4272 Operating Systems

Transcription:

CSC209 Software Tools and Systems Programming https://mcs.utm.utoronto.ca/~209

What is this Course About? Software Tools Using them Building them Systems Programming Quirks of C The file system System calls Processes Communication

Marking Scheme Type of Work Probable Topics Weight Due date Lecture Preparation 5% 10:00 pm on Sundays Lab Exercises 10% 10:00 pm on Fridays Assignment 1 Basic C 5% Monday, Jan 29 @ 10:00 pm Assignment 2 C (Strings, Memory, Pointers) 10% Wednesday, Feb 14, 10:00 pm Midterm Shell and C 10% Monday, Mar 5, 5:00 pm Assignment 3 Processes 10% Mon, Mar 12, 10:00 pm Assignment 4 Communication 10% Monday, Apr 2, 10:00 pm Final Exam 40% TBD, 40% required to pass the course

In a Typical Week Prep (Online) Practice (Lecture) Perform (Labs and Assignments)

Prep / Labs on PCRS Almost all of the prep work and some of the lab work is hosted online, on PCRS: https://pcrs.teach.cs.toronto.edu/utm209 Students are added to the system twice a day (at around 1:30). If you can t log in more than 24 hours after you add the course, please let us know.

Missed the first PCRS? The first prepare was originally due last night, at 10. If you joined the class late (or if you just missed our emails), complete it ASAP. We ve extended the deadline to the end of the add period, to accommodate students who are joining the class late.

About Assignments

Submission Submission will be performed via git You will receive a git repository to use for this course. We will place starter code into that repository and will extract your submissions from the repository. Much of what we do with your repository will be automated. So Please be very careful with required filenames, directory structures, and output format Make sure that your code compiles without warnings or errors and can be run without crashing on a lab machine

This is important, so we ll repeat it in red If your submission does not compile or crashes when run, it will receive a 0. Please be sure to check your code on a lab machine before submitting it!

Resubmission To encourage you to look at the test output and to fix errors, we re offering resubmissions. We ll send you some test results within a day of submission. You may resubmit (correcting errors) or submit late up to 48 hours after the original deadline.

Resubmission Notes We ll mark the original submission (with no deduction) and the resubmission (with a 10% deduction) and take the higher score. The test results sent to you within a day or submission are test results, not marks. Some tests will be worth more than others. Some tests are included simply to point out an issue: they will be worth no marks. Just do your best to fix the errors we ve identified

Academic Integrity The work you submit must be your own, done without participation by others. It is an academic offence to hand in anything written by someone else without acknowledgement. You are not helping your friend when you give them a copy of your assignment. You are hurting your friend when you ask them to give you a copy of their assignment.

In Particular Do not Look at another student s assignment Discuss the design or implementation of assignments Include code from anywhere without attribution Get someone else to write your code You may Discuss ideas and topics from lecture or lab Help each other understand man pages or example code Help each other understand error messages

Preparing for 209

Linux This course assumes familiarity with linux. Get used to using a text editor on linux. Become familiar with the basic commands that will allow you to use the shell. You can ssh into the lab machines to work remotely. You may also wish to install your own linux virtual machine.

C This isn t really a programming course. We will use C, and we will cover key topics. However, we assume you have learned a few languages already (Python, Java, ) You may need to pick up some material on your own (conditionals, basic control flow, )

Coming Up This week: shell programming and compiling C Next week: Arrays and Pointers Prep is due on Sunday (well, Wednesday), on PCRS Labs are running as normal and are due on Friday Assignment 1 will be posted next week

Okay, let s take a quick break and then start as if we were beginning class

Coming Up This week: shell programming and compiling C Next week: Arrays and Pointers Prep is due on Sunday (well, Wednesday), on PCRS Labs are running as normal and are due on Friday Assignment 1 will be posted next week

Anonymous Seems a bit odd that our first PCRs has a ton of bash guides for the bash multiple choice questions which is fine, but no guides or tutorials whatsoever for the C coding questions, making it very difficult Below the Week 1 Preparation Quest, there s a C Basics Quest with videos and exercises. You may want to watch a few videos in there for next week s Preparation Quest, as well.

Anonymous I really didn t understand a single thing in the introductory PCRS assignment I just completed. It felt like I was supposed to have some prior knowledge that I definitely did not have. The command line might be quite new to you, if you haven t been using the linux labs in 108/148/207. If that s the case, then yes, you re missing something we re expecting. The labs this week and next should help, but you may need to put in some extra time to get up to speed. Please drop by office hours if you re stuck after lab!

Anonymous PCRS is extremely boring and never teaches me anything well. Please change it. It s such an extremely outdated and lazy way of teaching complex topics. Also, the readings are ridiculously hard to follow. I m sorry you re finding it boring. However, we ve seen success with this format in 209 downtown, where it has been used longer. CSC369 used to run an assignment 0 to get people up to speed on C, and we ve found we no longer need it. Performance on a quiz about pointers at the end of 209 has improved since we started using an inverted course with videos. The course (and PCRS) can certainly be improved, but based on the evidence we have, the inverted course is an improvement. I d love to talk to you in person about what you d prefer, if you re comfortable doing so.

Questions before we start?

The Unix Philosophy Write programs that do one thing and do it well. Write programs to work together. Write programs that handle text streams, because that is a universal interface.

Unix, Linux, Unix-like Unix is a propriety operating system developed by AT&T in 1969. Almost immediately, there were spin-offs. Minix Solaris Linux OS X I ll use the word unix to refer to a lot of operating systems that aren t actually Unix. You ll generally end up using a flavour of linux in this course.

Unix Principles Do one basic thing well Support simple input formats Plain text Don t require interactive input Provide output in a simple format Expect that it will be input to another tool (piping)

Unix Tools Examples ls cat sort grep standard input / standard output pipes

How Do You Learn Linux? Use it. Linux has a manual Don t memorize what you need to do Be task oriented and look up the things you need, as you need them: man < topic...> Common tasks will become familiar very quickly

Shells $ gcc o hello hello.c The $ above is a prompt, asking for user input. Shells accept commands (programs) as input find the executable interpret the arguments start executing the command Shells also have some built-in commands.

Running a program $ gcc o hello hello.c $./hello This loads a program into memory and hands it off to the OS to run the program.

A Program in Memory Memory is divided into segments. The program itself is loaded into the bottom segments: Read/write data Read only code and data

Paths $ gcc o hello hello.c $./hello Why did I need a./ in front of hello? Why was there nothing in front of gcc?

File System Hierarchy / res nfs usr peters43 res stud bin lib local chatur18 www bin lib Use df to see all the different disk partitions on a linux machine.

File System Hierarchy Everything starts in the root directory whose name is / A directory is a file that contains directory entries. A directory entry maps a file name to an inode. An inode is the data structure that contains information about a file, including which disk blocks contain the file data. you ll learn way more about inodes than you ll want to in CSC369.

Files and Directories Everything is a file. Unix provides a file interface for all Input/Output. regular files directories devices video (block) keyboard (character) sound (audio) network (block) Try ls l /dev and look at the permissions string. crw------- brw------- c = character, b = block File interface = open, read, write, close

Directories and Links directory file 2. 2.. 14 u 46505 home 139412 cdrom 201345 lib % ls l / drwxr-xr-x 2 root root 4096 Nov 8 17:56 bin/ drwxr-xr-x 2 root root 4096 Aug 10 14:46 cdrom/ drwxrwsr-x 2 root staff 4096 Feb 8 2002 home/ drwxr-xr-x 6 root root 4096 Sep 2 15:26 lib/ lrwx------ 1 root root 6 Sep 2 15:32 u -> /mcs/u/

-rwxr-xr-x Permissions File permissions read, write, execute pretty much what you think Directory permissions read you can run ls on the directory write you can create and delete files in the directory execute you can pass through the directory when searching subdirectories.

-rwxr-xr-x chmod chmod 755 <filename> 3 numbers between 0 and 7, the octal value for that category of user Quiz what is the command to set the permissions of the file classlist to be world readable but writeable only by the file owner and members of the group. Another approach chmod u+rwx chmod go-x adds or removes permissions for those categories of users

Helpful Trick: Globbing A little like regular expressions but different syntax * matches any number of any character? matches any one character [list of characters] [1-5] or [a-z] or [a-xz]