ECE 471 Embedded Systems Lecture 10

Similar documents
ECE 471 Embedded Systems Lecture 4

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

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

Linux Systems Administration Getting Started with Linux

Computer Systems and Architecture

Perl and R Scripting for Biologists

Filesystem Hierarchy Operating systems I800 Edmund Laugasson

Computer Systems and Architecture

Introduction to Linux

INTRODUCTION TO LINUX

Table of contents. Our goal. Notes. Notes. Notes. Summer June 29, Our goal is to see how we can use Unix as a tool for developing programs

Linux Command Line Primer. By: Scott Marshall

Linux Essentials Objectives Topics:

Chapter-3. Introduction to Unix: Fundamental Commands

Linux Kung Fu. Stephen James UBNetDef, Spring 2017

UNIX System Programming Lecture 3: BASH Programming

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

CSE 390a Lecture 2. Exploring Shell Commands, Streams, Redirection, and Processes

File System Hierarchy Standard (FHS)

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

Linux Command Line Interface. December 27, 2017

Welcome to getting started with Ubuntu Server. This System Administrator Manual. guide to be simple to follow, with step by step instructions

CSE 303 Lecture 2. Introduction to bash shell. read Linux Pocket Guide pp , 58-59, 60, 65-70, 71-72, 77-80

Introduction. What is Linux? What is the difference between a client and a server?

Introduction to the shell Part II

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Exercise 1: Basic Tools

List of Linux Commands in an IPm

client X11 Linux workstation

CS197U: A Hands on Introduction to Unix

Linux crash lecture by Andrey Lukyanenko

5/20/2007. Touring Essential Programs

CSE 391 Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

Crash Course in Unix. For more info check out the Unix man pages -orhttp:// -or- Unix in a Nutshell (an O Reilly book).

More Raspian. An editor Configuration files Shell scripts Shell variables System admin

Basic Linux Command Line Interface Guide

CSE 390a Lecture 2. Exploring Shell Commands, Streams, and Redirection

CS197U: A Hands on Introduction to Unix

TestOut Linux Pro - English 4.0.x OBJECTIVE MAPPING: CompTIA Linux+ LX0-103

Basic Linux Command Line Interface Guide

Research. We make it happen. Unix Basics. User Support Group help-line: personal:

UNIX Quick Reference

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Mauro Ceccanti e Alberto Paoluzzi

Introduction to Unix: Fundamental Commands

Introduction to the Linux for HPC. Basic Linux for Beginner HPC Users

Introduction to UNIX Command Line

Chapter Two. Lesson A. Objectives. Exploring the UNIX File System and File Security. Understanding Files and Directories

Introduction to Linux

Linux Kung Fu. Ross Ventresca UBNetDef, Fall 2017

Outline. Structure of a UNIX command

Prerequisites: General computing knowledge and experience. No prior knowledge with Linux is required. Supported Distributions:

Lezione 8. Shell command language Introduction. Sommario. Bioinformatica. Esercitazione Introduzione al linguaggio di shell

Stop all processes and then reboot - same as above startx. Log in as superuser from current login exit

3/8/2017. Unix/Linux Introduction. In this part, we introduce. What does an OS do? Examples

D, E I, J, K. Generalized Regular Expression Parser (GREP), 110 Generic 105 key (Intl) PC, 29 git command, 242

XSEDE Scholars Program Introduction to the Linux Environment. Tips and Tricks for Linux Users John Lockman III June 5 th, 2012

Read the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal.

Introduction to UNIX/Linux

Linux Kung-Fu. James Droste UBNetDef Fall 2016

Topics. Installation Basics of Using GNU/ Linux Administration Tools

INF322 Operating Systems

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

GNU/Linux: An Essential Guide for Students Undertaking BLOSSOM

LPIC-1 System Administrator

Introduction to UNIX command-line

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

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

First of all, these notes will cover only a small subset of the available commands and utilities, and will cover most of those in a shallow fashion.

Lecture # 2 Introduction to UNIX (Part 2)

Lab 2: Linux/Unix shell

Command-line interpreters

EECS 2031E. Software Tools Prof. Mokhtar Aboelaze

Introduction to Supercomputing

Some useful UNIX Commands written down by Razor for newbies to get a start in UNIX

Essential Unix and Linux! Perl for Bioinformatics, ! F. Pineda

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

Introduction in Unix. Linus Torvalds Ken Thompson & Dennis Ritchie

National University of Computer and Emerging Sciences Operating System Lab - 02 Lab Manual

Embedded System Design

Introduction: What is Unix?

Introduction to Linux. Roman Cheplyaka

Introduction to UNIX I: Command Line 1 / 21

Processes. Shell Commands. a Command Line Interface accepts typed (textual) inputs and provides textual outputs. Synonyms:

Unix System Architecture, File System, and Shell Commands

Virtual Machine. Linux flavor : Debian. Everything (except slides) preinstalled for you.

Unix Tools / Command Line

Unix Introduction to UNIX

Presented by Bill Genske Gary Jackson

Introduction to Linux. Fundamentals of Computer Science

Unzip command in unix

CSE 390a Lecture 3. bash shell continued: processes; multi-user systems; remote login; editors

Unix File System. Learning command-line navigation of the file system is essential for efficient system usage

Operating Systems Lab 1 (Users, Groups, and Security)

Introduction to Linux

Introduction to Linux Organizing Files

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

Commands are in black

Introduction to Linux Command-Line for Beginners

Shells. A shell is a command line interpreter that is the interface between the user and the OS. The shell:

The Unix Shell & Shell Scripts

Transcription:

ECE 471 Embedded Systems Lecture 10 Vince Weaver http://www.eece.maine.edu/ vweaver vincent.weaver@maine.edu 3 October 2013

Announcements Homework #2 has been assigned. extended until the 10th. The due date is Midterm due date will also be pushed forward, likely to the 22nd. 1

Gumstix/Linux Followup Gumstix Board costs $200, so be careful. Not like a Rasp-pi or STM32 Discovery 2

SD Card Digression Why so slow? How did I make it half the size. SD and flash are sort of their own embedded systems 3

Connecting to Gumstix with Windows This info also available on the class website. Download Teraterm http://ttssh2.sourceforge. jp/. It s free. Get the.exe, run it, install Start it up. If your gumstix is plugged in you should be able to select serial/com port, and one should be listed as USB serial. If not, you may need to download a FTDI usb/serial driver. You can get one from http://www.ftdichip. 4

com/drivers/vcp.htm You will need to go to setup/serial port menu and set the baud rate from 9600 to 115200 otherwise you will just get garbage. To send a file from gumstix to your machine, at prompt type sz file to send. Then go to File/Transfer/zmodem/receive and it should get it. To send a file from your machine to gumstix, at prompt type rz then File/Transfer/zmodem/send and pick the file. 5

Brief history of serial ports? 6

Command-Line Linux The way we did things in the old days. Some of us still prefer the command line. You come up in the shell. Default is bash, the Bourne Againe Shell (more computer person humor). There are various shells available (bash, sh, zsh, csh, tcsh, ksh) and you can select via chfn. 7

Root Filesystem Layout Executables in /bin, /usr/bin System executables under /sbin, /usr/sbin Device nodes under /dev Config files under /etc Home directories under /home, also /root Temp Files under /tmp. Often wiped at reboot. 8

Magic dirs under /proc, /sys Libraries under /lib, /usr/lib, sometimes lib64 too Boot files under /boot /usr historically only files needed for boot in /, stuff that can be shared over network (or stored on a second drive if your first drive was too small) would be under /usr /opt often commercial software installed there 9

/srv, /run, /var these are where server programs store data /media, /mnt places to mount external disks like memory keys and CD roms /lost+found where the disk checker may store lost files it finds when fixing a disk after unclean shutdown 10

Interesting Config Files /etc/fstab the filesystems to mount at boot time /etc/passwd list of all users, world readable /etc/shadow passwords stored here for security reasons /etc/hostname name of the machine /etc/hosts list of local machines, usually searched before resorting to DNS lookup over network 11

/etc/resolv.conf where your nameserver address is put /etc/sudoers list of users allowed to use sudo /etc/network/interfaces on debian the network settings are stored here 12

Devices Block vs Char devices /dev/sd* SCSI (hard disks) /dev/tty* tty (teletype, logins, serial ports) /dev/zero /dev/full /dev/random, /dev/urandom 13

/dev/loop Network devices are an exception. 14

Interesting /proc Files These files are not on disk, but virtual and created onthe-fly by the operating system when you request them. /proc/cpuinfo info on cpu /proc/meminfo memory info Each process (running program) has its own directory that has info about it 15

Processes Each program assigned its own number, a process id, often called a pid Can list processes with ps -efa Also can get real-time view of what s going on in a system with top 16

Common Commands ls : list files ls -la : list long output, show all (hidden) files. on Linux any file starting with. is hidden ls -la /etc : list all in /etc directory ls *.gz : show all ending in gz. * and? are wildcards and can be used as regular expressions. cd DIR : change directories (folders) cd.. : go to parent directory cd. : go to current directory 17

cd / : go to root directory cd : go to home directory cat FILE dump file to screen (originall used to concatenate files together but more commonly used to list files) more / less list contents of file but lets you scroll through them. less more advanced version of more exit / logout / control-d log out of the machine df / du show disk space 18

df -h pretty-prints it man command show documentation (manual) for a command. For example man ls rm remove file. CAREFUL! Especially famous rm -rf. In general on Linux you cannot undo a remove. cp copy file. CAREFUL! By default will overwrite the destination without prompting you. mv move file. CAREFUL! Can overwite! mv -i will prompt before overwrite 19

tar create archvie file tar cvf output.tar dir tar xzvf output.tar.gz uncompresses a.tar.gz file gzip / gunzip / bzip2 / bunzip2 compress/uncompre a file. gzip and bzip2 are two common formats, many more exist 20

Compiler / Devel Commands make build a file based on list of dependencies in Makefile gcc C compiler. Simplest something like this: gcc -O2 -Wall -o hello hello.c g++ C++ gfortran Fortran as, ld assembler and linker gdb debugger 21

strace list system calls git source code management 22

Other Commands shutdown used to shutdown / reboot last list last people to log in su / sudo switch to root, run command as root uptime how long machine has been up date show the date as root you can use date -s to set the date 23

whoami who are you write / wall / talk write to other users finger get info on other users w / who see who is logged in wc count words/bytes/lines in a file dmesg print system and boot messages ln link files together, sort of like a shortcut 24

ln -s goodbye.c hello.c symbolic link. also hard links dd move disk blocks around, often used for creating disk images mount / umount mount or unmount filesystems mkfs.ext3 make new filesystem e2fsck filesystem check ifconfig / route show and setup network config 25

dpkg / apt-get update/upgrade/install debian only package management ssh / scp log into other machines, copy files remotely lynx text-based web browser reset clear the screen and reset settings (useful if you accidentally cat a binary file and end up with a screenful of garbage). Control-L also refreshes the screen linux logo my program 26

Editing files Linux and UNIX have many, many editors available. Most famous are vi and emacs. On our board using nano might be easiest. nano a simple text editor. nano FILENAME edit a filename It shows the commands you can do at the bottom. ^O means press control-o control-o : writes control-x : exits 27

control-w : searches control-\: search and replace control-c : prints line number 28

Redirection and Pipes redirect to a file : ls > output redirect from a file : wc < output pipe from one command to another : ls wc, dmesg less re-direct stderr : strace 2> output 29

Suspend/Resume Press control-c to kill a job Press control-z to suspend a job Type bg to continue it in the background Type fg to resume it (bring to foreground) Run with & to put in background to start with. mpg123 music.mp3 &). (ie, 30

user, group use chgrp Permissions read/write/execute use chmod 31

Shell Scripts Create a list of files in a dir Start with the shell, #/bin/sh (or perl, etc) Make executable chmod +x myfile 32

Command Line History Can press tab to auto-complete a command Can press up arrow to re-use previous commands Can use control-r to search for previous commands 33

Environment Variables env Varies from shell to shell. export TERM=vt102 PATH, and why. isn t in it. This is why you have to run self-compiled binaries as./blah 34