Projects and Environment Introduction

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

UNIX. The Very 10 Short Howto for beginners. Soon-Hyung Yook. March 27, Soon-Hyung Yook UNIX March 27, / 29

Introduction: What is Unix?

Spring Modern Computer Science in a Unix Like Environment CIS c

Unix to Linux. CS 3113 Fall 2018 Dr. Christan Grant

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

EE516: Embedded Software Project 1. Setting Up Environment for Projects

Overview of Unix / Linux operating systems

*nix Crash Course. Presented by: Virginia Tech Linux / Unix Users Group VTLUUG

Operating System Labs. Yuanbin Wu

Perl and R Scripting for Biologists

Overview LEARN. History of Linux Linux Architecture Linux File System Linux Access Linux Commands File Permission Editors Conclusion and Questions

CISC 220 fall 2011, set 1: Linux basics

Introduction to Cygwin Operating Environment

Brief Linux Presentation. July 10th, 2006 Elan Borenstein

Lab 1 Introduction to UNIX and C

C++ Programming on Linux

CSC209. Software Tools and Systems Programming.

The Unix Family. Linux 101. GNU/Linux distributions. Even more. MULTICS MIT/GE/Bell Labs. UNIX AT&T (Bell Labs) Mach, Carnegie Mellon

Introduction to Linux

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

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

CS 261 Recitation 1 Compiling C on UNIX

Introduction to Linux

Introduction to Linux

Physics REU Unix Tutorial

TNM093 Practical Data Visualization and Virtual Reality Laboratory Platform

Laboratory 1 Semester 1 11/12

Development Environment & Linux Guide

CSE 391 Lecture 1. introduction to Linux/Unix environment

Problem Set 1: Unix Commands 1

Introduction to Linux. Fundamentals of Computer Science

CS Fundamentals of Programming II Fall Very Basic UNIX

CS 300. Data Structures

CS CS Tutorial 2 2 Winter 2018

Setting up my Dev Environment ECS 030

Introduction to Linux

Linux Fundamentals (L-120)

CSC209. Software Tools and Systems Programming.

CSC111 Computer Science II

Exercise 1: Basic Tools

CSE 391 Lecture 1. introduction to Linux/Unix environment

History. Terminology. Opening a Terminal. Introduction to the Unix command line GNOME

Oregon State University School of Electrical Engineering and Computer Science. CS 261 Recitation 1. Spring 2011

CSE 390a Lecture 1. introduction to Linux/Unix environment

CS197U: A Hands on Introduction to Unix

Introduction to the Linux Command Line

Exercise sheet 1 To be corrected in tutorials in the week from 23/10/2017 to 27/10/2017

Introduction To Linux. Rob Thomas - ACRC

Recitation #1 Boot Camp. August 30th, 2016

Recitation #1 Unix Boot Camp. August 29th, 2017

GNU/Linux Course Lesson 1. Puria Nafisi

CSE 391 Editing and Moving Files

Unix Tutorial Haverford Astronomy 2014/2015

CS 215 Fundamentals of Programming II Spring 2019 Very Basic UNIX

Unix. Examples: OS X and Ubuntu

Lab 1 Introduction to UNIX and C

COP4530 Data Structures, Algorithms and Generic Programming Recitation 3 Date: January 20 & 22, 2009

Introduction of Linux

Lecture 1. Course webpage. Syllabus and schedule, textbooks CS Lab, Virtual Box. Handouts, assignments Supplemental resources

Parallel Programming Pre-Assignment. Setting up the Software Environment

Introduction to remote command line Linux. Research Computing Team University of Birmingham

Lab01: Part I. Introduction to Linux. Professional Training Academy Linux Series

The Unix Shell & Shell Scripts

CS 642 Homework #4. Due Date: 11:59 p.m. on Tuesday, May 1, Warning!

Intro to Linux & Command Line

CS354 gdb Tutorial Written by Chris Feilbach

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

Temple University Computer Science Programming Under the Linux Operating System January 2017

Introduction to Linux (Part I) BUPT/QMUL 2018/03/14

Lecture 01: welcome and intro what LSD and Unix have in common

Course Wiki. Today s Topics. Web Resources. Amazon EC2. Linux. Apache PHP. Workflow and Tools. Extensible Networking Platform 1

CMSC 201 Spring 2017 Lab 01 Hello World

Lecture 3. Unix. Question? b. The world s best restaurant. c. Being in the top three happiest countries in the world.

Linux at the Command Line Don Johnson of BU IS&T

COMS 6100 Class Notes 3

Post Ubuntu Install Exercises

LINUX FUNDAMENTALS. Supported Distributions: Red Hat Enterprise Linux 6 SUSE Linux Enterprise 11 Ubuntu LTS. Recommended Class Length: 5 days

LINUX FUNDAMENTALS (5 Day)

Manual Shell Scripting Linux Examples Pdf Tutorial

Operating System Labs. Yuanbin Wu

Unzip command in unix

CpSc 1111 Lab 1 Introduction to Unix Systems, Editors, and C

Linux/Cygwin Practice Computer Architecture

Reviewing gcc, make, gdb, and Linux Editors 1

The student will have the essential skills needed to be proficient at the Unix or Linux command line.

Practical Computing-II. Programming in the Linux Environment. 0. An Introduction. B.W.Gore. March 20, 2015

Operating Systems, Spring 2015 Course Syllabus

Introduction to Linux Environment. Yun-Wen Chen

Introduction to Linux

Carnegie Mellon. Linux Boot Camp. Jack, Matthew, Nishad, Stanley 6 Sep 2016

Prerequisites: Students should be comfortable with computers. No familiarity with Linux or other Unix operating systems is required.

CS 378 (Spring 2003) Linux Kernel Programming. Yongguang Zhang. Copyright 2003, Yongguang Zhang

INTRODUCTION TO BIOINFORMATICS

Unix Tutorial. Beginner. CS Help Desk: Marc Jarvis (in spirit), Monica Ung, Corey Antoniuk 2015

Unix and C Program Development SEEM

Getting started with UNIX/Linux for G51PRG and G51CSA

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

CMSC 201 Spring 2018 Lab 01 Hello World

CS 1301 Fall 2008 Lab 2 Introduction to UNIX

Transcription:

Projects and Environment Introduction

A lot to go over today History of Linux Projects Overview Project partners Programming environment Programming language Useful Tools

History of Linux

The Beginning: Unix First implemented in AT&T Bell Labs, 1969. AT&T had to make a choice between using third party OS or developing their own. Chose to implement own OS. Born from ideas and work performed on MULTICS OS. As a result of work on Unix (first implemented in the assembly language), C was born.

Time Line of Feature Introduction B-compiler, UNIX v1 1971 cat, chdir, chmod, chgrp, ed, mkdir, mkfs, mv, rm... C-compiler, Pipes, UNIX v3 1973. UNIX v5, open-sourced 1974. sh, System V v1, UNIX v7. - 1979 UNIX v10 (last edition) - 1989 Somewhere between 1979 and 1989... NFS, TCP/IP, STREAMS...

Standardizing UNIX IEEE and POSIX POSIX Portable Operating System Interface for Computing Environments What does this mean? You can count on any modern operating system to adhere to this standard. As long as you develop your programs by using functions available in the POSIX standard, unistd.h, your program will be portable to POSIX-compliant systems.

What's Included in the Standard? 1003.1 System calls, library routines 1003.2 Shell, basic UNIX (command-line) utilities 1003.3 Test methods to demonstrate conformance 1003.4 Real-time interfaces

Linux Humble Beginnings Shortly after the final version of UNIX was produced, Linus appeared and published the first version of Linux. No OS at the time supported the Intel 80386 32-bit processors Linus wanted to use his PC with that processor. It supported only his hardware AT hard disks, Intel 80386. Since he was working on MINIX, some of the design was based off of MINIX. Started by porting bash(1.08) and gcc(1.40). For more details, refer to wikipedia or the book: Just for Fun.

Linux Today Current kernel version 3.12.6 (as of last week) Supports pretty much any platform and device the average user will interact with. Released to users as distributions, of which there are more than a hundred.

Distributions Ubuntu, Fedora, Slackware, SUSE, Red Hat, Debian, Gentoo, Mint, CentOS all of these are distributions. Differences between distributions: Package manager: aptitude, yum, portage, etc. Used to install programs, libraries, documentation. Kernel version: most are behind a few cycles Windowing Interface: Gnome, KDE, etc. Target audience: power-user, newbie, enterprise, etc. Community

Which Distribution (Distro) to Use? The best advice I can give here is to use what you feel most comfortable using. If you haven't installed Linux on your computer before, maybe this class is the best time to give it a try! Other reasoning to choose one distribution over another: Local standard - Colleagues/coworkers all use same distribution.

Additional References http://www.lwn.net/ Linux news site. Covers distros, conferences, and recent kernel development. Includes many links to free books, documentation, and the like. http://www.kernel.org/ Here's where you can obtain the latest Linux kernel, if you want to get your hands dirty.

Why Use Linux? Linux is open source We actually have access to the kernel code and can change it Much of the Internet runs on UNIX/Linux! Wonderful time to get some experience

Unix/Linux Share Desktop/laptop Linux 1.73% Mobile Devices Android 79.0% Servers Unix-like/Linux 66.8% Supercomputers Linux 96.4-98% Source: http://en.wikipedia.org/wiki/usage_share_of_operatin g_systems#servers

Projects

Four Projects Jump into C and Linux with a small C program Write your own shell Interface to the operating system Compile and modify an operating system kernel Will have team virtual machines Create a program to read raw FAT file system images

Projects: Partners Projects 1-3 will be completed in pairs Choose a partner and send me an email (diesburg@cs.uni.edu) with the name of your partner by 1/22. You need only submit one project per group Post on the elearning forum to find a partner with compatible/complimentary skills and schedule

Turn-Ins Large projects will have half-way submission (antiprocrastination) deadline Make sure you are on track Chance for me to give you pointed help Counts for %20 of project, effort-based grade Final project submission Turn in everything that works 40% of project grade

Project Quizzes After the final submission deadline, each project will have a project quiz Tests understanding Keeps partnerships honest Short answer 40% of project grade

Programming Project Start projects when they're assigned. They're often trickier than they look. Especially that synchronization project... Ask questions early. If you're asking questions, be it to yourself or to others, you're thinking about the project. This will make it easier to complete them correctly and on time. Write small programs to test your program or language features you don't understand.

Programming Environment Project 0, Project 1, and Project 3 Remote Linux servers Accessible through ssh and server address diesburg.cs.uni.edu Project 2 Your own team virtual machines

Accessing the Remote Servers 4 Linux Servers at server address diesburg.cs.uni.edu Need usernames and passwords distributed in class If you are unfamiliar accessing remote Linux servers, please watch this video posted on today s webpage

Server Visualization Internet prog1 prog2 prog3 diesburg.cs.uni.edu prog4 23

Logging In Use SSH to connect to diesburg.cs.uni.edu Secure SHell If in Linux or OSX Open up a command-line terminal $> ssh <username>@diesburg.cs.uni.edu If in Windows You will need a terminal emulator PuTTY (download from link on resrouces page) 24

PuTTY 25

Once I am Logged In You will be logged onto the prog1 machine But 3 other machines are at your disposal (prog2, prog3, prog4) Might want to log into those machines if usage is too high Can see the current system load and number of users by issuing the command w at the prompt Going to another machine At the prompt, use the ssh command: $> ssh <username>@prog[2-4] Example: $> ssh diesburg@prog2 Use the same password that you used initially. Your files will be visible on all the machines 26

Next Steps Change your password to something you can remember $> passwd Get familiar with Linux shell commands Look at course Resources page under Shell Resources Know at least the following Maneuvering: cd, ls, pwd Creating/deleting: touch, rm, rmdir, mkdir Reading files: nano Compilation: make, gcc Packaging: zip, unzip Help: man 27

Editing Source Files Two ways Create and edit files on your own computer, then transfer to Linux server Create and edit files directly on Linux server I highly recommend the second way! File encodings from other operating systems can negatively effect compilations and cause very confusing errors It s not too bad, just pick a terminal editor 28

Editors -- Vim The vi editor was created by Bill Joy, the founder of Sun Microsystems when he was a graduate student The vim editor, vi improved, is the Linux version of the vi editor multiple windows, highlighting text, and command history http://www.vim.org/

Editors -- Emacs GNU Emacs is an extensible, customizable text editor Content-sensitive editing modes, including syntax coloring, for a variety of file types including plain text, source code, and HTML http://www.gnu.org/software/emacs/

Editors -- Others Nano and/or pico are also available on most Linux systems If you have never worked in Linux before, this is your editor! Extremely basic $>nano <file name>

Transferring Files In Linux/OSX scp In Windows File transfer client like WinSCP From prog1 wget 32

WinSCP 33

Programming Language C is the programming language of operating systems Kernel, system utilities, and large server programs (like apache and sendmail) Need to understand C to work inside the Linux kernel Will get practice with C in project 0 I will help, but you also need to get yourself up to speed with the basics

Quick C Language Tutorial Look in resources

Compiling Video $> gcc myfile.c o myfile gcc is the compiler myfile.c contains my source code. It could be called anything as long as it ends with.c -o is the output flag the file that follows this flag will be the output executable myfile this is the output executable. Can be called anything

Running your executable $>./myfile./ means here (will make more sense once we start the shell project myfile is the name of the executable that you compiled

Warm Up - Project 0 (Due next Friday) Individual project Log onto the class servers Go through the online C tutorial To test your knowledge, create and compile a C program on the servers

Useful Tools

manpages Extensive documentation that come with almost all Unix-like systems For documentation on C functions or packages Examples $> man bash $> man strncpy Sometimes multiple definitions, so use man section numbers man 1 printf shows bash printf man 3 printf shows C printf For more information on sections, see man man

zip Creating a zip file from folder proj1, which contains your source files: $> zip r proj1.zip proj1 Unzipping a zip file $> unzip proj1.zip Test this out before you submit a project!

Make make: A program for building and maintaining computer programs developed at Bell Labs around 1978 by S. Feldman (now at Google) Instructions stored in a special format file called a makefile. Will be provided for you for the first and second projects

Debuggers Debuggers let you examine the internal workings of your code while the program runs. Debuggers allow you to set breakpoints to stop the program's execution at a particular point of interest and examine variables. To work with a debugger, you first have to recompile the program with the proper debugging options. Use the -g command line parameter to cc, gcc, or g++ Example: gcc -g -c foo.c

GDB, the GNU Debugger Text-based, invoked with: gdb [<programfile> <corefile> <pid>]] Issue man gdb for more info

GDB Quick Start $>./my.x $> Segmentation fault $> gdb./my.x (gdb) run Segmentation fault 0x08048384 in main() at my.c:4 4 *s = 'H'; (gdb) bt #0 0x08048384 in main() at my.c:4