36
System Software Roman Prykhodchenko [email protected] Unix basics Tuesday, February 8, 2011

1 Unix basics. Part 1

Embed Size (px)

DESCRIPTION

History, terminology, FSH and FS navigation commands.

Citation preview

Page 1: 1 Unix basics. Part 1

System Software

Roman [email protected]

Unix basics

Tuesday, February 8, 2011

Page 2: 1 Unix basics. Part 1

Agenda

• History

• Terminology

• Unix commons

Tuesday, February 8, 2011

Page 3: 1 Unix basics. Part 1

History

Tuesday, February 8, 2011

Page 4: 1 Unix basics. Part 1

UNIX

• UNIX is a computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs.

• Today UNIX is a family of the operating systems that correspond to the Single Unix Specification.

Tuesday, February 8, 2011

Page 5: 1 Unix basics. Part 1

Main events

• 1969 – MULTICS, the first implementation of the UNIX operating system for General Electric GE-645 computer.

• 1976 – UNIX Timesharing System 6

• 1977 – Berkley Software Distribution (BSD)

• 1979 – UNIX Timesharing System 7

• 1982 – BSD 4.1 implements TCP/IP

Tuesday, February 8, 2011

Page 6: 1 Unix basics. Part 1

PeopleDenis Ritchie Brian Kernighan Ken Thompson

Tuesday, February 8, 2011

Page 7: 1 Unix basics. Part 1

Main events

• 1988 – First edition of POSIX standard

• 1989 – The ANSI C standard is published

• 1983 – Richard Stallman initiated the GNU project

• 1992 – The GNU is using the Linux kernel

• 1994 – 386 BSD is released

Tuesday, February 8, 2011

Page 8: 1 Unix basics. Part 1

PeopleLinus Torvalds Richard Stallman

Tuesday, February 8, 2011

Page 9: 1 Unix basics. Part 1

People

William Jolitz Lynne Jolitz

Tuesday, February 8, 2011

Page 10: 1 Unix basics. Part 1

Terminology

Tuesday, February 8, 2011

Page 11: 1 Unix basics. Part 1

*nix

• UNIX-like operating system (or just *nix) is an operating system that behaves similar to UNIX but does not correspond to the Single Unix Specification.

Tuesday, February 8, 2011

Page 12: 1 Unix basics. Part 1

SUS

• Single UNIX specification is the collective name of a family of standards for computer operating systems to qualify for the name "Unix"

Tuesday, February 8, 2011

Page 13: 1 Unix basics. Part 1

POSIX

• POSIX (Portable Operating System Interface for uniX)is the standard for the UNIX operating system published by IEEE Computer Society.

• Includes:

• System API

• Shell interface

• API of the system utilities

Tuesday, February 8, 2011

Page 14: 1 Unix basics. Part 1

Time-sharing

• Time-sharing operating system shares a computing resource among many users by means of multiprogramming and multi-tasking.

Tuesday, February 8, 2011

Page 15: 1 Unix basics. Part 1

Unix commons

Tuesday, February 8, 2011

Page 16: 1 Unix basics. Part 1

Key properties

• Portability

• Preemptive multitasking

• Virtual memory

• Multilevel architecture

• Support of asynchronous processes

• Device-independent I/O

Tuesday, February 8, 2011

Page 17: 1 Unix basics. Part 1

Software conception

• Do only one thing and do it well.For each task the system can perform there is a separate program.

• Examples:cp – copies a filecat – prints a file’s contents

• Benefits:- Simplicity- Number of errors is relatively small.

Tuesday, February 8, 2011

Page 18: 1 Unix basics. Part 1

Everything is a file

• Every computer’s resource is represented by a file.

• Examples:/home/john/text.txt – John’s text file/dev/sda – first hard drive/proc/scsi – information about any devices connected via a SCSI or RAID controller

• Benefits:Device-independent I/O operations.

Tuesday, February 8, 2011

Page 19: 1 Unix basics. Part 1

Multilevel architecture

• Each software type runs on an appropriate level

• Memory is not shared between different levels

• System calls for inter-level communications

Tuesday, February 8, 2011

Page 20: 1 Unix basics. Part 1

Multilevel architecture

Application software, network services, utilities

System software (command interpreters, protocols...)

System calls

Kernel

Tuesday, February 8, 2011

Page 21: 1 Unix basics. Part 1

Kernel

• Scheduling

• Memory management

• Interruptions processing

• Inter-process communication

• Low-level device support

Tuesday, February 8, 2011

Page 22: 1 Unix basics. Part 1

Kernel

• Monolithic kernel

• Microkernel

• Nanokernel

• Exokernel

• Hybrid kernel

Tuesday, February 8, 2011

Page 23: 1 Unix basics. Part 1

Kernel

Tuesday, February 8, 2011

Page 24: 1 Unix basics. Part 1

Kernel“Exokernel”

based Operating System

Tuesday, February 8, 2011

Page 25: 1 Unix basics. Part 1

System calls

• Process management

• Implementation of I/O operations

• Bind user actions to drivers

Tuesday, February 8, 2011

Page 26: 1 Unix basics. Part 1

Signals

• Signals are an approach of inter-process communication (IPC)

• Signal is an asynchronous message sent to signal

• Operating system interrupts the process when it is sent a signal

Tuesday, February 8, 2011

Page 27: 1 Unix basics. Part 1

Signals

• A process can implement a handler for different kind of signals

• Default handler kills the process

• Some signals can not be handled

Tuesday, February 8, 2011

Page 28: 1 Unix basics. Part 1

Signals

• Sources of signals:

• Keyboard shortcuts

• Kernel

• Hardware exception

• Wrong system call

• I/O operations

• A process

Tuesday, February 8, 2011

Page 29: 1 Unix basics. Part 1

ShellShell is a command-line interpreter that provides a traditional user interface for the Unix operating system and for Unix-like systems.

Most popular are: bash, sh, csh, zsh

We will mostly use bash.

Tuesday, February 8, 2011

Page 30: 1 Unix basics. Part 1

Common syntax$ app_name [options] [parameters]

Options begin with - or --

-o1 [value] -o2 -o3 [value]

or-o1o2o3

Examples:$ tar -x -j -v -f archive.tar.gz$ tar -xjvf archive.tar.gz

Parameters are usually required.$ rdesktop -f -u UserName 192.168.0.124

Tuesday, February 8, 2011

Page 31: 1 Unix basics. Part 1

Manual pagesMan application shows a manual page for specified application:

$ man {app_name}

Or you can use option -h to see a short help:$ tar -h

Tuesday, February 8, 2011

Page 32: 1 Unix basics. Part 1

File system hierarchy standard/ Rood directory

/bin/ Essential command binaries

/boot/ Static bootloader

/dev/ Devices represented by files

/etc/ Host-specific configuration data

/lib/ Basic shared libraries and kernel modules

/mnt/ Temporary mount point

/opt/ Optional software

/sbin/ Basic system software

/tmp/ Temporary data

/usr/ Secondary hierarchy

/var/ Variable data

Tuesday, February 8, 2011

Page 33: 1 Unix basics. Part 1

PATHPATH is an environment variable used by shells for searching for applications.

Applications located in directories that are included to PATH can be launched without specifying full path.

$ echo $PATH/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin

You can modify PATH$ PATH=$PATH:~/bin

Tuesday, February 8, 2011

Page 34: 1 Unix basics. Part 1

Navigationcd Navigates to specified directory

ls Shows current directory’s contents

pwd Shows current directory

mkdir Creates a directory

rmdir Removes a directory

touch Modifies last change date

rm Deletes a file

Tuesday, February 8, 2011

Page 35: 1 Unix basics. Part 1

InodesInode is an index descriptor of a filesystem resource.

- Every resource has own inode number.- File name is a link to inode.

Example:$ ls -dl /usr/localdrwxr-xr-x 8 root root 240 Dec 22

/usr/local/usr/local/./usr/local/bin/../usr/local/games/../usr/local/lib/../usr/local/sbin/../usr/local/share/../usr/local/src/..

Tuesday, February 8, 2011

Page 36: 1 Unix basics. Part 1

Questions?

Tuesday, February 8, 2011