8 Pages

Week1-Intro-4up

Course: CSC 209, Fall 2009
School: Toledo
Rating:
 
 
 
 
 

Word Count: 1467

Document Preview

CSC209: Administrivia Software Tools and Systems Programming Richard Krueger Email : krueger@cs.utoronto.ca Office hours: BA 3234 Email: krueger@cs.utoronto.ca Email must include your name. Please set up your mail program to use plain text, not html. Email is a formal method of communication: Use proper English. State your question clearly, with enough context. Sign it. 2 More on email Not helpful I...

Register Now

Unformatted Document Excerpt

Coursehero >> Ohio >> Toledo >> CSC 209

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
CSC209: Administrivia Software Tools and Systems Programming Richard Krueger Email : krueger@cs.utoronto.ca Office hours: BA 3234 Email: krueger@cs.utoronto.ca Email must include your name. Please set up your mail program to use plain text, not html. Email is a formal method of communication: Use proper English. State your question clearly, with enough context. Sign it. 2 More on email Not helpful I used the makefile you gave us, but my program doesn't compile. What could be wrong?" My program gets a seg fault error message, but I don't know why. Course Information Check the course information sheet (handed out and on the course web page) for Office hours Contact information Assignment schedule Much better When I compile my program, I get the following error message. It seems to indicate that there is a problem with the following lines of code. (cut and paste error messages and code.) The debugger tells me that the seg fault I'm getting is on the following line. I don't see what the problem is with this line. (file included below) 3 The course web page is the official source of announcements. http://www.cs.utoronto.ca/~csc209h/ Make sure you have the prerequisites! 4 Assignments A1: Shell programming (Bourne shell) A2: Manipulating files and directories (in C) A3: Processes (in C) A4: Sockets (in C) The assignments are best done over a couple of weeks, a few hours at a time. All code must work on the CDF servers to receive full marks. Don't wait until the last day! 5 Submitting Assignments You will be using CVS to manage and submit your assignments. The repositories will be set up this week. You should start learning how to use it as soon as possible. Do not wait until the last minute to try to commit your assignment for the first time. This week's tutorial will cover using CVS. See web page for tutorial information. 6 Plagiarism "The work you submit must be your own, done without participation by others. It is an academic offense to hand in anything written by someone else without acknowledgement." You are not helping your friend when you give him or her a copy of your assignment. You are hurting your friend when you ask him or her to give you a copy of their assignment. 7 What is cheating? Cheating is copying parts or all of another student's assignment including code from books, web sites, other courses without attribution getting someone else to do substantial parts of your assignment giving someone else your solution Cheating is not helping to find a bug in a friend's code (be careful) helping each other understand man pages or 8 example code. The Big Picture (in Java) Source code file Hw.java FODVV+Z^ SXEOLFVWDWLFYRLG PDLQ6WULQJ>@DUJV^ VRSULQWOQ+HOOR ` ` The Big Picture Source code file hw.c LQFOXGHVWGLRK! YRLG Compile it Object file Hw.class Compile it hw Object file % javac Hw.java PDLQ ^ SULQWI+HOORZRUOG ` % gcc o hw hw.c Run it in VM % java Hw Process Run it % hw 9 Process 90 +Z 10 Source Code Files hw.c LQFOXGHVWGLRK! YRLG PDLQ ^ SULQWI+HOORZRUOG ` Compiling a program % gcc o hw hw.c What is a file? How does the system know where to find hw.c? What is the meaning of #include<stdio.h> ? What does printf really do? 11 A compiler is a program translates source code into object (machine) code. Here we are running the compiler at the command line. A shell is a program that can execute another program. 12 Shells % gcc o hw hw.c Object Files/Executables high address The % is a shell prompt. Shells accept commands (programs) as input finds the executable interprets the arguments starts executing the command stack Typical memory layout of programs. sp (stack pointer) Process control block (PCB) pc (program counter) heap uninit. data init. data text low address ... Shells also have some "built-in" commands. 13 14 Running a program % gcc o hw hw.c % hw Processes A process is an executing instance of a program. The OS keeps track of information about the process. process ID a unique non-negative integer process state "running", "ready", "blocked" program counter which instruction is being executed. a list of open files etc. 15 16 load a program into memory and hand it off to the OS to run the program. A different big picture sh less vi perl gcc nedit grep ddd Course Overview Software Tools Understanding the shell Shell programming libc C Interface to Unix system services Systems Programming Unix system services Unix kernel (in C) computer 17 C files processes concurrency communication 18 Self Study Topics Using CVS - some tutorial coverage Using Unix - some coverage tutorial Learning an editor nedit, vi, emacs Learning a debugger ddd is the easiest Readings 19 Unix History Inspired by Ken Thompson to play Space Travel on his DEC PDP-7 in 1969. Thompson wrote the first version of Unix in assembler in one month. Dennis Ritchie and Ken Thompson ported an enhanced version to a PDP-11/20 in 1970. Ritchie and Rudd Canaday ported a cut down version of the BCPL language to Unix, calling it B. The PDP-11 was purchased for text processing. The first user was Bell's Patent Department. Pipes and C were added in 1971-73 20 More Unix History BTL Lawyers, "License to universities, but no support." This led to extensive sharing. University of Toronto on the first mailing list in 1975. Software Tools User Group formed in 1978. Canadian connection! Bill Reeves, Brian Kernighan, Rob Pike... Why Unix? Available on a number of platforms. Multi-user, multi-programmed. Shares computer resources sensibly. Permits manipulation of files, processes, and programs. Allows inter-process and inter-machine communication. Permits access to its operating features. 22 Berkeley Software Distribution grew out of collecting and distributing bug fixes. (Led to FreeBSD, NetBSD) Bill Joy started at Berkeley but joined the startup Sun Microsystems in 1982. 1991, Linus Torvalds posts a note describing his experimental OS modeled on minix. 21 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. 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 23 24 File System Hierarchy Everything starts in the "root" directory whose name is "/" A directory is a file that contains directory entries. (Ch 4.3) 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. 25 File System Hierarchy / hard link u u1 h u2 bin usr lib u3 csc209h symbolic links krueger F c4reidka Use df to see all the different disk partitions on CDF. IDOO SXE UHSR 26 File Systems and Links One file system per disk partition. A file system can be mounted at any point in the directory tree of another file system. An entry in a directory file which specifies an inode is a hard link. There can be several hard links to a file, but hard links cannot cross file systems. A soft link (symbolic link) is a small file containing t...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Toledo - CSC - 209
CSC209: Software Tools and Systems ProgrammingRichard Krueger Email : krueger@cs.utoronto.ca Office hours: BA 3234Administrivia Email: krueger@cs.utoronto.ca Email must include your name. Please set up your mail program to use plain text, not h
Toledo - CSC - 209
Testtest argumentsControl statements for loopfor color in red green blue pink do echo The sky is $color doneE xis ts as a directory E xis ts as a regular file. E xis ts as a readable file E xis ts as a writable file. E xis ts as an executable f
Toledo - CSC - 209
Strings Strings are not a built-in data type. C provides almost no special means of defining or working with strings. A string is an array of characters terminated with a &quot;null character&quot; ('\0')String literalschar *name = &quot;csc209h&quot;; printf(&quot;Thi
Toledo - CSC - 209
Strings Strings are not a built-in data type. C provides almost no special means of defining or working with strings. A string is an array of characters terminated with a &quot;null character&quot; ('\0')1String literalschar *name = &quot;csc209h&quot;; printf(&quot;
Toledo - CSC - 209
Static Allocation Recall: static allocation happens at compile time based on variable definitions.int x = 2; int a[4]; int *b; int main() {}SYMBOL TABLE: main 0x804837c x 0x8049588 b 0x8049688 a 0x804968c .text .data .bss .bss0x804837cmain0x
Toledo - CSC - 209
External and static variables External variable: declared outside the body of a function File scope: visible from the point of the declaration to the end of the file. Static storage duration: through the duration of the program. External/global v
Toledo - CSC - 209
External and static variables External variable: declared outside the body of a function File scope: visible from the point of the declaration to the end of the file. Static storage duration: through the duration of the program. External/global v
Toledo - CSC - 209
Layers of System SoftwareCompilers, Interpreters, LibrariesComparing compilers and interpreters Shared vs. non-shared libraries.catlessvidategccneditgrepdddcsh (or bash or ksh) libc C Interface to Unix system servicesUnix syst
Toledo - CSC - 209
Compilers, Interpreters, LibrariesComparing compilers and interpreters Shared vs. non-shared libraries.Layers of System Softwarecat less vi date gcc nedit grep ddd csh (or bash or ksh) libc C Interface to Unix system servicesUnix system servic
Toledo - CSC - 209
SignalsSignalsHaviland Ch. 6 Unexpected/unpredictable asynchronous events floating point error death of a child interval timer expired (alarm clock) control-C (termination request) control-Z (suspend request)1 Events are called interru
Toledo - CSC - 209
Pointers to FunctionsFunction PointersKing Chapter 17.7 Since a pointer is just an address, we can have pointers to functions!int cube(int x) { return x*x*x; } int (*f)(int); /*Define a function pointer*/ f = cube; /* Call the function that f
Toledo - CSC - 209
Function PointersKing Chapter 17.71Pointers to Functions Since a pointer is just an address, we can have pointers to functions!int cube(int x) { return x*x*x; } int (*f)(int); /*Define a function pointer*/ f = cube; /* Call the function that
Toledo - CSC - 209
The problemc1 server read(c1) blocked read(c2) writeI/O Multiplexingc2&quot;gone for coffee&quot;Haviland 7.1.6 When reading from multiple sources, blocking on one of the sources could be bad. An example of denial of service. One solution: one pro
Toledo - CSC - 209
I/O MultiplexingHaviland 7.1.61The problemc1 &quot;gone for coffee&quot; server read(c1) blocked read(c2) write c2 When reading from multiple sources, blocking on one of the sources could be bad. An example of denial of service. One solution: one pr
Toledo - CSC - 209
Bit strings Bit Vectors (bit arrays) (bit strings)King: 20.1, 20.2 Signal mask and file descriptor sets are implemented using bit arrays or bit strings. You should always use the supplied functions macros to manipulate these structures. It is use
Toledo - CSC - 209
Bit Vectors (bit arrays) (bit strings)King: 20.1, 20.2Bit strings Signal mask and file descriptor sets are implemented using bit arrays or bit strings. You should always use the supplied functions macros to manipulate these structures. It is us
Toledo - CSC - 209
ConcurrencyHaviland Ch. 8.3.31Concurrency The two key concepts driving computer systems and applications are communication: the conveying of information from one entity to another concurrency: the sharing of resources in the same time frame
Toledo - CSC - 209
CSC209: Software tools .CSC209 ReviewYeah! We made it!1 Unix files and directories permissions utilities/commands Shell programming quoting wild cards files2. and C programming . C basic syntax functions arrays structs stri
Toledo - CSC - 209
CSC209 ReviewYeah! We made it!1CSC209: Software tools . Unix files and directories permissions utilities/commands Shell programming quoting wild cards files2. and C programming . C basic syntax functions arrays structs strin
Berkeley - EE - 105
UNIVERSITY OF CALIFORNIA AT BERKELEY College of Engineering Department of Electrical Engineering and Computer Sciences Homework #2 Due: Tuesday, February 6th REVISED 1/30/07 EE 105 Prof. Wu Spring 20071. Voltage Controlled Oscillator (VCO). Figure
Berkeley - EE - 105
UNIVERSITY OF CALIFORNIA AT BERKELEY College of Engineering Department of Electrical Engineering and Computer Sciences Homework #3 Due: Tuesday, February 13th EE 105 Prof. Wu Spring 20071. MOS Capacitor. Understanding the MOS Capacitor is essential
Berkeley - EE - 105
UNIVERSITY OF CALIFORNIA AT BERKELEY College of Engineering Department of Electrical Engineering and Computer Sciences Homework #5 Due: Tuesday, March 6th EE 105 Prof. Wu Spring 20071. Razavi, Chapter 7, Problem 43 2. Razavi, Chapter 7, Problem 45
Berkeley - EE - 105
UNIVERSITY OF CALIFORNIA AT BERKELEY College of Engineering Department of Electrical Engineering and Computer Sciences Problem Set #6 Due Tuesday, March 13, 2007 EE 105 Prof. Wu Spring 20071. Razavi Chapter 7, Problem 76 Note that this problem requ
Berkeley - EE - 105
UNIVERSITY OF CALIFORNIA AT BERKELEY College of Engineering Department of Electrical Engineering and Computer Sciences Homework #8 Due: Tuesday, April 3rd EE 105 Prof. Wu 1. Razavi Chapter 11, Problem 9 2. Razavi Chapter 11, Problem 20 3. Razavi Chap
Berkeley - EE - 105
UNIVERSITY OF CALIFORNIA AT BERKELEY College of Engineering Department of Electrical Engineering and Computer Sciences Homework #9 Due: Tuesday, April 24th EE 105 Prof. Wu 1. Razavi Chapter 4, Problem 10 2. Razavi Chapter 4, Problem 21 3. Razavi Chap
Berkeley - EE - 105
UNIVERSITY OF CALIFORNIA AT BERKELEY College of Engineering Department of Electrical Engineering and Computer Sciences Homework #11 Due: Tuesday, May 8th EE 105 Prof. Wu 1) Razavi Chapter 7, Problem 44 2) Razavi Chapter 7, Problem 72 3) Razavi Chapte
Texas Tech - ACCT - 3307
Texas Tech University Area of Accounting ACCT 3307/ACCT 5311: Income Tax Accounting Prague- 2009 Dr. John J. Masselli, CPA University of New York Prague Legerova 72 Room A (1-4p.m.)The following course syllabus provides a general plan for the co
Texas Tech - ACCT - 3307
The Honorable David M. Walker Comptroller General of the United States Rotary Club of Birmingham January 9, 2008GAO-08-417CGThe Case for ChangeThe federal government is on a &quot;burning platform,&quot; and the status quo way of doing business is unaccept
Texas Tech - ACCT - 5305
Problem Area 9 Question 1: Part aPartner A B C DGain 0 0 0 10Basis in Basis in Assets Ptshp 10 (Land) 10 (Land) 0 (Land) 0 (Land) 10 0 0 0-G/L determined under Sec. 731(a)(1): gain only recognized if cash distributed in excess of basis. -Basi
Texas Tech - ACCT - 5313
Estate Tax CalculationStep 1: Step 2: Step 3 Step 4 Step 5 Calculate the Taxable Estate (Gross estate less allowable deductions) Add: Taxable Lifetime Gifts (Post 1976) Step 1 + Step 2 = Estate Tax Base Calculate Tax on Step 3 using the Unified Rate
Penn State - CSR - 213
Name: Desk Number: Course &amp; Section Date:Experiment Title: Recrystallization/Melting Point:GRADING FOR RECRYSTALLIZATION/MELTING POINT EXPERIMENTPre-Lab:Date, Name, Desk#, Experiment # &amp; Title (abbreviated after 1st pa), Section Summary Goals Di