unix unit 1- architecture of unix - by pratima. 2 unix architecture typical computer system consists...

15
UNIX Unit 1- Architecture of Unix - By Pratima

Upload: branden-freeman

Post on 20-Jan-2016

228 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: UNIX Unit 1- Architecture of Unix - By Pratima. 2 Unix Architecture Typical computer system consists of: Hardware Operating system Applications and utilities

UNIX

Unit 1- Architecture of Unix

- By Pratima

Page 2: UNIX Unit 1- Architecture of Unix - By Pratima. 2 Unix Architecture Typical computer system consists of: Hardware Operating system Applications and utilities

2

Unix Architecture

Typical computer system consists of:HardwareOperating systemApplications and utilities

Typical OS includes a user interface or command interpreter

Page 3: UNIX Unit 1- Architecture of Unix - By Pratima. 2 Unix Architecture Typical computer system consists of: Hardware Operating system Applications and utilities

3

Unix Architecture

Page 4: UNIX Unit 1- Architecture of Unix - By Pratima. 2 Unix Architecture Typical computer system consists of: Hardware Operating system Applications and utilities

4

Unix Architecture

UNIX is no longer a small system but it certainly is a powerful one.

Layered approach is basis for Unix security

1. Division of Labor: Kernel n Shell

2.The File Process

3.The System Calls

Page 5: UNIX Unit 1- Architecture of Unix - By Pratima. 2 Unix Architecture Typical computer system consists of: Hardware Operating system Applications and utilities
Page 6: UNIX Unit 1- Architecture of Unix - By Pratima. 2 Unix Architecture Typical computer system consists of: Hardware Operating system Applications and utilities

6

Levels of Unix Software

Unix uses a layer approach of defining softwareLayered approach is basis for Unix security

At the lowest level, the level closest to the hardware, are the basic hardware interface modulesProcess schedulingMemory management Interrupt handlingLow level device controlDisk system management and data bufferingProcess synchronization and inter-process

communication (IPC)

Page 7: UNIX Unit 1- Architecture of Unix - By Pratima. 2 Unix Architecture Typical computer system consists of: Hardware Operating system Applications and utilities

7

Unix Functional Layer Model

Page 8: UNIX Unit 1- Architecture of Unix - By Pratima. 2 Unix Architecture Typical computer system consists of: Hardware Operating system Applications and utilities

8

1. Division of Labor: Kernel & Shell “Filter ideas” is division of labor between two agencies- The Kernel

and Shell– The Kernel interacts with the machine's hardware & the Shell with

the user (Mapping between user requests and device driver actions)

– The Kernel is the core of the operating system

1. Its a collections of routines mostly written in c

2. Its loaded into memory when its booted n communicates with hardware directly

3. Programs access the Kernel through set of System calls

It actually also performs the requested service Process creation and termination (Schedules the process)

I/O services

File/disk access services (manages sys memory)

Terminal handling services

Decides the Priorities n perform other tasks.

Page 9: UNIX Unit 1- Architecture of Unix - By Pratima. 2 Unix Architecture Typical computer system consists of: Hardware Operating system Applications and utilities

9

Shell

The uppermost layer consists of user processes running:ShellsUnix commandsUtility programsUser application programs

User processes:Protected from from other usersHave no access to Unix kernel routines except

through the system call interfaceCannot directly access kernel memory space

Page 10: UNIX Unit 1- Architecture of Unix - By Pratima. 2 Unix Architecture Typical computer system consists of: Hardware Operating system Applications and utilities

10

Shell

Command Interpreter is a job that is handled by the outer part of the OS called as Shell

OR

Unix command interface is a separate program referred to as the shell• The Shell actually acts as an interface between user & the Kernel

There could be several Shells in action-one for each user who logged in.

After using commands, shell communicates with Kernel to see that command is executed.

It is represented by sh(Bourne shell), csh(C shell),

ksh(Korn shell) or bash(Bash shell)

Page 11: UNIX Unit 1- Architecture of Unix - By Pratima. 2 Unix Architecture Typical computer system consists of: Hardware Operating system Applications and utilities

11

Kernel Space

Kernel space is the region of memory where all kernel services are provided via kernel processes

Any process executing in kernel space is said to be executing in kernel mode

Kernel space is a privileged area; the user has access to it only through the system call interface

A user does not have direct access to either all machine instructions or devices

A kernel process does have direct access to both

Page 12: UNIX Unit 1- Architecture of Unix - By Pratima. 2 Unix Architecture Typical computer system consists of: Hardware Operating system Applications and utilities

12

2. The File and Process

“File have places and Process have Life”– A File is a an array of bytes n also a part of

single hierarchical structure.– Can be moved from one place to another– It considers even directories and devices as a

single file systemThe Process is an entity, name given to a file

wen its executed as a program – IT also belongs to a separate hierarchical

tree structure

Page 13: UNIX Unit 1- Architecture of Unix - By Pratima. 2 Unix Architecture Typical computer system consists of: Hardware Operating system Applications and utilities

13

3. The System Calls

System calls provide a programming interface that allows user programs to access kernel functions

There are a large number of system calls that perform functions to manage system resources such as memory, disk storage, and peripherals

System calls are defined in a run-time library that provides a mapping of the system call interface to the kernel routine(s) that perform the system functions

The shell also provides functionality equivalent to many of the system calls

System call arguments are passed in the u area (user area) of the calling process

Page 14: UNIX Unit 1- Architecture of Unix - By Pratima. 2 Unix Architecture Typical computer system consists of: Hardware Operating system Applications and utilities

14

System Usage Accounting Services

Unix provides some general accounting services

As each process terminates, an accounting record is made available describing the resources used by the processName of the processAmount of user and system CPU time usedElapsed (wall clock) timeAverage amount of memory usedNumber of disk I/O operations doneUID and GID of the processTerminal from which the process was started

Page 15: UNIX Unit 1- Architecture of Unix - By Pratima. 2 Unix Architecture Typical computer system consists of: Hardware Operating system Applications and utilities

15

Features

A Multiuser SystemA Multitasking SystemThe Building-Block ApproachThe Unix ToolkitPattern MatchingProgramming FacilityDocumentation