Homework There will be 4 homework assignments There will be 4 homework assignments They will each be graded 0-100+ (There will be bonus) They will each.

Slides:



Advertisements
Similar presentations
Introduction to the Omega Server CSE Overview Intro to Omega Basic Unix Command Files Directories Printing C and C++ compilers GNU Debugger.
Advertisements

Utilizing the GDB debugger to analyze programs Background and application.
Cygwin Linux for Windows Desktop Paul Stuyvesant.
Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
CSCI 1411 FUNDAMENTALS OF COMPUTING LAB Lab Introduction 1 Shane Transue MSCS.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 12 Separate Compilation Namespaces Simple Make Files (Ignore all class references.
CSE 451 Section Autumn 2005 Richard Dunn Office hours: WTh 3:30-4:20 Allen 216 (or lab)
Working Environment - - Linux - -.
Unix Continuum of Tools Do something once: use the command line Do something many times: –Use an alias –Use a shell script Do something that is complex.
Linux+ Guide to Linux Certification, Second Edition
1 Introduction: Unix and C Software Project – Winter 2007 / 2008.
CS1020: Intro Workshop. Topics CS1020Intro Workshop Login to UNIX operating system 2. …………………………………… 3. …………………………………… 4. …………………………………… 5. ……………………………………
1 Introduction: Unix Software Project – Autumn 2008/2009.
Very Quick & Basic Unix Steven Newhouse Unix is user-friendly. It's just very selective about who its friends are.
A crash course in njit’s Afs
Linux Shell. 2 Linux Command-Line Interface ■ Linux shells: A shell is a command interpreter that allows you to type commands from the keyboard to interact.
1 uClinux course Day 3 of 5 The uclinux toolchain, elf format and ripping a “hello world”
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
1 CS 240 Programming in C and UNIX Lecturer: Bob Wilson Office: S Phone:
Computational physics PY2050 Course Details:
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
2INC0 Operating Systems Introduction to Linux
Introduction to Programming Workshop 1 PHYS1101 Discovery Skills in Physics Dr. Nigel Dipper Room 125d
Linux+ Guide to Linux Certification, Second Edition
1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience.
Cygwin Linux for Windows Desktop Paul Stuyvesant.
Scons Writing Solid Code Overview What is scons? scons Basics Other cools scons stuff Resources.
CS 444 Introduction to Operating Systems
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
CPSC 217 T03 Week I Part #1: Unix and HELLO WORLD Hubert (Sathaporn) Hu.
CS 590 Programming Environments with UNIX. Computer Lab Account Course Homepage
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150.
Course Information Andy Wang Operating Systems COP 4610 / CGS 5765.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Introduction to Python Lesson 1 First Program. Learning Outcomes In this lesson the student will: 1.Learn some important facts about PC’s 2.Learn how.
More Unix Naomi Altman. Directories Directory = folder mkdir - makes a new directory rmdir - removes an empty directory cd mydirectory - moves you into.
Object Oriented Programming COP3330 / CGS5409.  Assignment Submission Overview  Compiling with g++  Using Makefiles  Misc. Review.
Linux Programming Schedule Lection Meet and greet Introduction to course Introduction to Linux Virtual machines Terminal Makefiles Lab Setup.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
The Kernel At a high level, the kernel in an operating system serves as the bridge between applications and the actual data processing of the hardware.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
VMware Certified Professional 6-Data Center Virtualization Beta 2V0-621Exam.
Embedded Software Design Week II Linux Intro Linux Kernel.
Learning Unix/Linux Based on slides from: Eric Bishop.
Object Oriented Programming COP3330 / CGS5409.  Assignment Submission Overview  Compiling with g++  Using Makefiles  Misc. Review.
 CSC 215 : Procedural Programming with C C Compilers.
CSE 451 Section Autumn 2004 Alex Moshchuk Office hours: Tue 2-3, Thu 4:30-5:30 Allen 216 (or lab)
August 31, 2010Joris Geurts1 2IN05 Operating Systems Introduction to Linux More information for this course:
1 2INC0 Operating Systems practical (part 1) Joris Geurts.
Precept I : Lab Environment, Unix, Bash, Emacs
OS – Ex 1 Nezer J. Zaidenberg.
Computer System Laboratory
ENEE150 Discussion 01 Section 0101 Adam Wang.
EE516: Embedded Software Project 1
CS1010: Intro Workshop.
Development Environment Basics
Welcome to CSCI 230! Problem Solving using C
Introduction to UNIX.
Intro to UNIX System and Homework 1
C Programming Lecture Series
Operation System Program 4
Andy Wang Operating Systems COP 4610 / CGS 5765
Andy Wang Operating Systems COP 4610 / CGS 5765
Andy Wang Operating Systems COP 4610 / CGS 5765
Andy Wang Operating Systems COP 4610 / CGS 5765
Periodic Processes Chapter 9.
Andy Wang Operating Systems COP 4610 / CGS 5765
Presentation transcript:

Homework There will be 4 homework assignments There will be 4 homework assignments They will each be graded (There will be bonus) They will each be graded (There will be bonus) Total weight = 55% (total weight of test = 55%) Total weight = 55% (total weight of test = 55%) Homework can be done in groups Homework can be done in groups Each group must meet the ex. Checker and defend their work. the grade of the group will be the grade of it’s worst member! Each group must meet the ex. Checker and defend their work. the grade of the group will be the grade of it’s worst member! The kernel homework will be checked on a computer with VMWare that you should download and verify. The User space code will be checked on VMWare The kernel homework will be checked on a computer with VMWare that you should download and verify. The User space code will be checked on VMWare No rechecks for code that doesn’t run!!! No rechecks for code that doesn’t run!!! No points will be deducted on code quality (unless we see real atrocities) but points will be deducted if the ex doesn’t work as supposed to or use the OS incorrectly. No points will be deducted on code quality (unless we see real atrocities) but points will be deducted if the ex doesn’t work as supposed to or use the OS incorrectly.

Defending homework The main reason is policy – since the homework affect grade to such extent it cannot be allowed without oral exam. The main reason is policy – since the homework affect grade to such extent it cannot be allowed without oral exam. This method have proven to be very effective in ensuring students success on the final test. This method have proven to be very effective in ensuring students success on the final test. It cannot be changed not even if you work alone. It cannot be changed not even if you work alone.

What questions do we ask when you defend your code? 50 questions are prepared for each ex. 3 random questions per student. 50 questions are prepared for each ex. 3 random questions per student. Questions type : show me where you, what does line do? Why did you add this check etc. Questions type : show me where you, what does line do? Why did you add this check etc. No student that worked on the ex. Should fail. But it is almost impossible to “fake”. (so please DO your homework) No student that worked on the ex. Should fail. But it is almost impossible to “fake”. (so please DO your homework)

Strict timetable policy In order to minimize hassle for you, we will give oral exam on the homework within 1 week of dead line. In order to minimize hassle for you, we will give oral exam on the homework within 1 week of dead line. That means we need to schedule a room, invite checker and grade everything within very short time! That means we need to schedule a room, invite checker and grade everything within very short time! Since we do all that – we believe students should be ready. By not submitting homework in time you delay our checking and ruin our system. Since we do all that – we believe students should be ready. By not submitting homework in time you delay our checking and ruin our system. We are also firm believers on strict timelines. We are also firm believers on strict timelines.

Using Linux The good but hard way – install on your computer. (Do this if you know what you are doing and at your own risk we cannot and will not provide support if your computer fail) The good but hard way – install on your computer. (Do this if you know what you are doing and at your own risk we cannot and will not provide support if your computer fail) The also possible way – Download VM Player from VMWare.com (free) and use it with our vmware. The also possible way – Download VM Player from VMWare.com (free) and use it with our vmware. We will distribute VMWare machine you can work on. (MTA – via library, TAU – Amir’s door) It will also be available on class on MTA. We will distribute VMWare machine you can work on. (MTA – via library, TAU – Amir’s door) It will also be available on class on MTA. The not recommended ways The not recommended ways Using only user mode linux on TAU. Using only user mode linux on TAU. Using your own different linux distribution Using your own different linux distribution Using another UNIX Using another UNIX ETC… all those methods are at your own risks. Should anything fail, you will be sole responsible due to all incompatibilities. ETC… all those methods are at your own risks. Should anything fail, you will be sole responsible due to all incompatibilities.

Using Linux under VMPlayer Simulates computer inside your computer. Simulates computer inside your computer. Slower then real PC but good enough for us. Slower then real PC but good enough for us. For most practical purposes can be treated as a real computer with real OS. (certainly for this course) For most practical purposes can be treated as a real computer with real OS. (certainly for this course) Root password : password Root password : password User password : user User password : user Download from Download from

User vs Root User – can run programs User – can run programs Root – can run system programs. Administrator of system (usually owner or owner’s employee) Root – can run system programs. Administrator of system (usually owner or owner’s employee) User – can hardly cause damages. User – can hardly cause damages. Root – prune to damages. Root – prune to damages. Root – can use low-level system resources (such as row sockets) and setup kernel modules Root – can use low-level system resources (such as row sockets) and setup kernel modules Most of the time we work as user Most of the time we work as user Sometimes (rarely) we work as root. When coding stuff on the kernel or running administration commands. In Ubunto we login as user and sudo(1) when we need root access Sometimes (rarely) we work as root. When coding stuff on the kernel or running administration commands. In Ubunto we login as user and sudo(1) when we need root access

Assumed knowledge We assume you know how to code in C in KR Level. We assume you know how to code in C in KR Level. We assume you know how to handle strings We assume you know how to handle strings We assume you know how to do basic math We assume you know how to do basic math We assume you know how to allocate and free memory We assume you know how to allocate and free memory We assume you know how to create functions and use recursion, library functions and function pointers We assume you know how to create functions and use recursion, library functions and function pointers We assume you know how to open files and folders We assume you know how to open files and folders We assume you know what editor, compiler, debugger and Make (build) is. We assume you know what editor, compiler, debugger and Make (build) is.

Using Linux There are many manuals on the net. (Try – UNIX is a 4 letter word and vi is 2 letter abbreviation) There are many manuals on the net. (Try – UNIX is a 4 letter word and vi is 2 letter abbreviation) There is also a readme that comes with your VM There is also a readme that comes with your VM Some basic commands Some basic commands mkdir, rmdir, cd – just like MS-DOS mkdir, rmdir, cd – just like MS-DOS ls – list files (dir) ls – list files (dir) vi – Text editor vi – Text editor cp – copy cp – copy rm – remove (delete) rm – remove (delete)

Coding and programming in Linux First thing we need to do is edit a source file. (which is basically a text file) First thing we need to do is edit a source file. (which is basically a text file) Create a source file in your favorite editor (I use vi.) Create a source file in your favorite editor (I use vi.) Compile using gcc –c “source file” –o “object file” Compile using gcc –c “source file” –o “object file” Link using gcc -o Link using gcc -o This process can be automated by using Makefile This process can be automated by using Makefile Run using./ (we don’t have. In the default search path) Run using./ (we don’t have. In the default search path)

Sample program – compile and run Macintosh:~ scipio$ vi hello.c Macintosh:~ scipio$ gcc -c hello.c -o hello.o Macintosh:~ scipio$ gcc hello.o -o hello Macintosh:~ scipio$./hello hello world

Source of hello.c #include #include int main(int argc, char * argv[]) { printf("hello world\n"); return 0; }

Makefile Makefile (same as project file in other environments) is a simple way to automate build process Makefile (same as project file in other environments) is a simple way to automate build process Makefile works like that… Makefile works like that… : : For example for hello world the make can look like For example for hello world the make can look like

Makefile all : hello hello : hello.o gcc hello.o -o hello gcc hello.o -o hello hello.o : hello.c gcc -g -c hello.c -o hello.o gcc -g -c hello.c -o hello.o

Using make Macintosh:~ scipio$ make gcc -g -c hello.c -o hello.o gcc hello.o -o hello

debugging The Linux debugger is gdb The Linux debugger is gdb You must compile with –g switch to include debug info (same as debug/release build in other environments) You must compile with –g switch to include debug info (same as debug/release build in other environments) You can use gdb to trace (step, step into, next) your programs. Gdb has a graphical front end – ddd You can use gdb to trace (step, step into, next) your programs. Gdb has a graphical front end – ddd Usually though you will just examine core dump. (core is what your program leaves when it crashes) Usually though you will just examine core dump. (core is what your program leaves when it crashes)

Crash.c int main() { int i=5; int j=0; int k=i/j; }

Using UNIX to debug… ulimit –c gcc –g crash.c –o crash./crash gdb –c core./crash … Program received signal EXC_ARITHMETIC, Arithmetic exception. 0x00001ff3 in main () at crash.c:5 5int k=i/j;

More options Gcc and gdb has lots more options, while Make is fully programmable environment. Gcc and gdb has lots more options, while Make is fully programmable environment. We don’t teach any of these due to time constraints (and because it’s off topic) but new options may be introduced as we go along. You are welcome to use any option you want and do your own web research. We don’t teach any of these due to time constraints (and because it’s off topic) but new options may be introduced as we go along. You are welcome to use any option you want and do your own web research. You may also use anything you find in your homework. You may also use anything you find in your homework.

Using IDE under Linux There are plenty of IDE that act as a wrapper to the above such as (partial list) There are plenty of IDE that act as a wrapper to the above such as (partial list) Kdevelop Kdevelop Eclipse Eclipse Netbeans Netbeans Codewarrior Codewarrior Slickedit Slickedit We don’t teach or support them, but you may use them for your homework. We don’t teach or support them, but you may use them for your homework.

Ex. 0 We give you ex. 0 as an optional ex. To iron out your C skills and code under Linux. Should you submit it, it will be checked. But it is not obligatory and will not effect your grade. (there is also no defense on that one) We give you ex. 0 as an optional ex. To iron out your C skills and code under Linux. Should you submit it, it will be checked. But it is not obligatory and will not effect your grade. (there is also no defense on that one) You should probably google most of your problems (there are plenty of good guides) you can also Nezer and Tomer if you cannot find the answer in google. You should probably google most of your problems (there are plenty of good guides) you can also Nezer and Tomer if you cannot find the answer in google.

Ex. 0 Create a user shell supporting the following commands: Create a user shell supporting the following commands: DIR = list files DIR = list files CD = change directory (CD.. = usual meaning) CD = change directory (CD.. = usual meaning) Everything else = try to execute something with the same file name in the current directory using system(3) Everything else = try to execute something with the same file name in the current directory using system(3) Submit source and makfile. Submit source and makfile.