Precept I : Lab Environment, Unix, Bash, Emacs

Slides:



Advertisements
Similar presentations
LIS651 lecture 5 direct use of wotan Thomas Krichel
Advertisements

Linux, it's not Windows A short introduction to the sub-department's computer systems Gareth Thomas.
1 Introduction to UNIX Ke Liu
1 Introduction to UNIX 2 Ke Liu
COP 3275 COMPUTER PROGRAMMING USING C Instructor: Diego Rivera-Gutierrez
1 Basics of Linux On linux machine: Login at your home directory Open a “shell” or “terminal” or “xterm” workspace (4) On windows machine Intall linux.
Unix Workshop Aug What is Unix Multitasking, multiuser operating system Often the OS of choice for large servers, large clusters.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction What is Unix? An operation system (OS), similar to Windows, MacOS X Why learn Unix? Greatest Software.
The Unix Environment and Compiling. Getting Set Up Your programs will be compiled and tested on the Departmental server ‘linprog’ The linprog servers.
Eucalyptus Virtual Machines Running Maven, Tomcat, and Mysql.
N ETWORKED & D ISTRIBUTED COMPUTING S YSTEMS L AB Programming Assignments EE323 Computer Networks.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
1 SEEM3460 Tutorial Unix Introduction. 2 Introduction Unix-like system is everywhere Linux Android for smartphones Google Chrome OS for Chromebook Web.
Computing Fundamenatls CMSC 201 Computer Science I Penny Rheingans University of Maryland Baltimore County (with inspiration from previous 201 instructors.
1 N305 C Programming. 2 Objectives for the Lab ä Learn problem solving strategies ä Achieve intermediate knowledge of C Programming Language ä Gain experience.
LINUX Tuesday, 5 July :00 pm. Remote Login l Use Secure Shell (ssh) l Machine name/IP address E.g. ssh hydra.sma.nus.edu.sg Or ssh
TAMU CSCE 313 (the basics). Basic Unix/Linux programming Accessing CS systems  PuTTY (putty.exe) – a Telnet and SSH client  Common hosts: unix.cs.tamu.edu.
PROGRAMMING PROJECT POLICIES AND UNIX INTRO Sal LaMarca CSCI 1302, Fall 2009.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
1 Lab 2 “Hello world” in Unix/Linux #include "std_lib_facilities_4.h" int main(){ cout
ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150.
UNIX Introduction CSCE 221H Texas A&M University.
Getting started: Basics Outline: I.Connecting to cluster: ssh II.Connecting outside UCF firewall: VPN client III.Introduction to Linux IV.Intoduction to.
CGS 3460 Why we choose UNIX n Powerful lMulti-user operating system lGood programming tools Most heavy-duty database management systems started out on.
C programming and compilers. At least 3 ways to compile C Using gcc in UNIX environment via chaos.cs.auckland.ac.nz Using gcc in Cygwin in Windows Using.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
City Cluster Quickstart Lien-Chi Lai, COLA Lab, Department of Mathematics, NTU 2010/05/11.
More on Using onyx 8/28/13. Program 1 Due a week from today. See website for details.
Unix Servers Used in This Class  Two Unix servers set up in CS department will be used for some programming projects  Machine name: eustis.eecs.ucf.edu.
Department of Electronic & Electrical Engineering Introduction to C - The Development cycle. Why C? The development cycle. Using Visual Studio ? A simple.
ENEE150: Discussion 1 Section 0104/0105 Please Sit Down at a Computer and Login!
Basic Unix Commands & GCC Saurav Karmakar Spring 2007.
AN INTRO TO UNIX/LINUX COMMANDS BY: JIAYANG WANG.
Linux A practical introduction. 1)Background and Getting Started Linux is an operating system with multiple providers Red Hat/CentOS (our version) Ubuntu.
First Compilation Rudra Dutta CSC Spring 2007, Section 001.
CS 120 Extra: The CS1 Server Tarik Booker CS 120.
General Computer Science for Engineers CISC 106 Lecture 03 James Atlas Computer and Information Sciences 9/9/2009.
 CSC 215 : Procedural Programming with C C Compilers.
Review Why do we use protection levels? Why do we use constructors?
Precept 7: Introduction to IA-32 Assembly Language Programming
Tutorial Six Linux Basics CompSci Semester Two 2016.
By Jonathan Rinfret UNIX/LINUX By Jonathan Rinfret
CSC 215 : Procedural Programming with C
How to Program.
ENEE150 Discussion 01 Section 0101 Adam Wang.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
SEEM3460 Tutorial Unix Introduction.
EE516: Embedded Software Project 1
CS1010: Intro Workshop.
How to Start Programming in Linux Environment
Getting started with CentOS Linux
Tutorial Six Recap & Linux Basics CompSci Semester Two 2016.
CSCI 2400/ ECE 3217: Computer Architecture
Andy Wang Object Oriented Programming in C++ COP 3330
Computing Fundamenatls CMSC 201 Computer Science I Penny Rheingans University of Maryland Baltimore County (with inspiration from previous 201 instructors.
Software Tools Recitation 1
C Programming Lecture Series
CSCE 206 Lab Structured Programming in C
SEEM3460 Tutorial Unix Introduction Xinshi Lin & Zihao Fu
Web Programming Essentials:
Assembly Language Programming II: C Compiler Calling Sequences
Getting started with CentOS Linux
Andy Wang Object Oriented Programming in C++ COP 3330
UNIX/LINUX Commands Using BASH Copyright © 2017 – Curt Hill.
CS 240 Programming in C Lecturer: Ramin Dehghanpoor Office: S-3-134
Using emacs and G++ at U. W.
Software Setup & Validation
Yung-Hsiang Lu Purdue University
CSCE 206 Lab Structured Programming in C
Compile and run c files.
Presentation transcript:

Precept I : Lab Environment, Unix, Bash, Emacs 2012.09.05.

Lab Environment (Linux) Lab machines are administered by TA IP address range (12 machines) 143.248.141.52 ~ 143.248.141.63 Use SSH protocol to communicate with the lab machine PuTTY (Windows) Terminal (Mac OS) ID Your student number Password

Cygwin Provide Linux-like environment in Windows Install Cygwin http://cygwin.com/install.html Install Cygwin Download & run setup.exe Choose any URL to download files

VMware Player Run another OS (Linux, Windows, etc.) on top of main OS https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/5_0 Install VMware Download VMware Player for Windows 32-bit and 64-bit Run downloaded file

VMware Player Download Linux (Ubuntu) image file http://www.ubuntu.com/download/desktop Install Linux on VMware Click on “Create a New Virtual Machine” Click on “Browse…” button Add image file downloaded from website Insert information : username, password, etc. Press “Play virtual machine” button

Accessing from Outside KAIST Require virtual private network (VPN) program At first run, use Internet Explorer! kvpn.kaist.ac.kr Log in Press Start

Change Password on All Machines! Connect to the machine with default ID & PASSWORD Type “passwd” In response to “(current) UNIX password:”, type current password In response to “New password:”, type new password. In response to “Retype new password:”, type new password again. Reminder Each machine does not share files It is your responsibility to back up your files Keep the code locally Use the lab machines only for testing and debugging

Unix and Bash

Bash Commands For details, read the handout Most useful commands Description man <function name> open manual page cd <directory name> change directory ls [-al] list files in the directory mkdir <directory name> make directory rmdir <directory name> remove directory less/cat/more <file name> print file content cp <source> <target> copy source file to target mv <source> <target> rename source file to target

Emacs Popular editor Already installed in lab machines Integrated with GCC compiler driver & GDB debugger Already installed in lab machines emacs test.c

Emacs Hotkey Hotkey Description Ctrl-k cut line Ctrl/alt-w cut/copy region Ctrl-y paste copied/cut region Ctrl-x Ctrl-s save file Ctrl-s/r <string> search/recursive string Ctrl-x Ctrl-f <file> open file Ctrl-x 2/3 Split window vertically/horizontally Ctrl-x o move to different window Ctrl-x 1/0 close other/this window Ctrl-x u undo Ctrl-g abort command Ctrl-x Ctrl-c close emacs

gcc209 –E hello.c > hello.i Building C Programs hello.c Source code C language Contains preprocessor directives hello.i Contains declaration of printf() Missing definition of printf() #include <stdio.h> int main(void) { printf("hello, world\n"); return 0; } Preprocess gcc209 –E hello.c > hello.i C Preprocessor … int printf(char *format, …) int main(void) { printf("hello, world\n"); return 0; }

Building C Programs hello.s Source code Assembly language Missing definition of printf() Compile gcc209 –S hello.i C Compiler .section .rodata cGreeting: .asciz “hello, world\n” .section .text .global main .type main, @function main: puchl %ebp movl %esp, %ebp pushl %cGreeting call printf addl $4, $esp movl $0, %eax movl %ebp, %esp popl %ebp ret

Building C Programs hello.o hello Object code Machine language Missing definition of printf() hello Assemble gcc209 –c hello.s Assembler .100101000110100… 11110010000010100… Link gcc209 hello.o –lc -o hello Linker 001010000101000000111110… gcc209 is an abbreviation for gcc –Wall –ansi –pedantic –m32 –march=i386 Shortcut: gcc209 hello.c –o hello