• No results found

Unit - 7 OS.pptx

N/A
N/A
Protected

Academic year: 2020

Share "Unit - 7 OS.pptx"

Copied!
31
0
0

Loading.... (view fulltext now)

Full text

(1)
(2)

The Unix file system is a hierarchical structure that allows users

to store information by name. At the top of the hierarchy is

the root directory, which always has the name /. A typical Unix

file system might look like:

The location of a file in the file system is called its path. Since

the root directory is at the top of the hierarchy, all paths start

from /. Using the sample file system illustrated above, let us

determine the path for quiz1.txt:

All paths start from the root directory, so the path begins with /

We need to go to the home subdirectory, and the path

becomes /home

In the home directory, we go into the ian subdirectory. The path

is now /home/ian

In the ian directory, we go into the cpsc124 subdirectory. The

path is now /home/ian/cpsc124

The file quiz1.txt is in the cpsc124 directory. Appending the

filename

to

the

path,

the

path

becomes /home/ian/cpsc124/quiz1.txt

(3)
(4)

Files and Directories

There are 3 kinds of files: ordinary files (files), directory files (directories), and special files.

(5)

Directories: Each directory contains a number of files. A directory can contain other directories, be contained in another directory, or both. A directory that contains a file is called that file's parent directory. Similarly, if directory A contains directory B, then directory A is directory B's parent directory. A directory that is contained in another directory is called a subdirectory.

(6)
(7)

UNIX System Overview

UNIX Architecture

Login Name

Shells

Files and Directories

File System

Filename

Pathname

(8)

System call error

When a system call discovers an error, it

returns -1 and stores the reason the called

failed in an external variable named "errno".

(9)
(10)
(11)

Process Related System Calls

The UNIX system provides several system

calls to

create and end program,

to send and receive software interrupts,

to allocate memory, and to do other useful jobs

for a process.

Four system calls are provided for creating

a process, ending a process, and waiting for

a process to complete.

(12)

fork() system call

To create a new process, you must use the

fork() system call.

The prototype for

the fork() system call is:

int fork()

fork() causes the UNIX system to create a

new process, called the "child process",

with a new process ID. The

contents

of the

child process are identical to the

contents

(13)

fork() system call (Cont’d)

The new process inherits several

characteristics of the old process. Among

the characteristics inherited are:

The environment.

All signal settings.

The set user ID and set group ID status.

The current working directory and the root

directory.

fork() returns zero in the child process and

(14)

exec() system calls (Cont’d)

Unlike the other system calls and

subroutines, a successful exec system call

does not return. Instead, control is given to

the executable binary file named as the

(15)

wait() system call

You can control the execution of child processes

by calling wait() in the parent.

wait() forces the parent to suspend execution

until the child is finished.

wait() returns the process ID of a child process

that finished.

If the child finishes before the parent gets

around to calling wait(), then when wait() is

(16)

wait() system call (Cont’d)

The prototype for the wait() system call is:

int wait(status)

int *status;

“status” is a pointer to an integer where

the UNIX system stores the value returned

by the child process. wait() returns the

(17)

exit() system call

The exit() system call ends a process and returns a

value to it parent.

The prototype for the exit() system call is:

void exit(status) int status;

By convention, when a process exits with a status of

(18)

Shell Interpreter

Shell

 provides you with an interface to the Unix

system. It gathers input from you and executes programs

based on that input. When a program finishes executing,

it displays that program's output.

Shell is an environment in which we can run our

commands, programs, and shell scripts. There are

different flavors of a shell, just as there are different

flavors of operating systems. Each flavor of shell has its

own set of recognized commands and functions.

Shell Prompt

The prompt, 

$

, which is called the 

command prompt

, is

(19)

Shell Types

 In Unix, there are two major types of shells −

Bourne shell − If you are using a Bourne-type shell,

the $ character is the default prompt.

C shell − If you are using a C-type shell, the % character is the

default prompt.

The Bourne Shell has the following subcategories −  Bourne shell (sh)

Korn shell (ksh)

 Bourne Again shell (bash)  POSIX shell (sh)

The different C-type shells follow −  C shell (csh)

(20)

Windows NT Architecture

Windows NT architecture is divided into two main

sections: user mode and kernel mode.

KERNEL MODE

Kernel mode is a highly privileged mode of operation in

which the code has direct access to all hardware and all

memory, including the address spaces of all user

processes. The part of Windows NT running in kernel

mode is called the Windows NT Executive.

USER MODE

(21)

Windows NT Architecture

The

environment subsystems

are services that

provide application programming interfaces (APIs)

that are specific to an operating system.

The three environment subsystems are the POSIX,

OS/2, and Win32 subsystems. Applications and

subsystems form a client/server relationship, in

which the applications are the clients and the

subsystems are the servers.

Integral Subsystem

The integral subsystems are services that provide

(22)
(23)

Windows NT Architecture

Programs and subsystems in user mode are limited in

terms of to what system resources they have access,

while the kernel mode has unrestricted access to the

system memory and external devices. The Windows NT 

kernel is known as a MICRO

kernel

. The architecture

comprises a 

simple kernel

hardware abstraction layer

 (HAL), drivers, and a range of services (collectively

named 

Executive

), which all exist in kernel mode.

The kernel sits between the Hardware Abstraction Layer

and

the

Executive

to

provide 

multiprocessor

(24)

The NT Executive

The NT Executive takes care of the important tasks that are vital to the

entire system. This includes services such as object management, virtual memory management, I/O management, and process management.

The Executive has the following components

Kernel - The kernel is ultimately responsible for all actions on the system

and almost all functions on the system pass through the kernel. The kernel is responsible for scheduling all system actions, handling system interrupts and handles processor exceptions. On a multiprocessor system, a copy of the kernel actually runs on each processor. Because the kernel is involved in almost every action taken on an NT system, critical portions of the kernel are written in assembly language.

Object Manager - The Object Manager piece of the NT Executive is used

(25)

The NT Executive

Process Manager - The Process Manager is responsible for creating,

removing, and modifying the states of all processes and threads. It also provides information on the status of processes and threads to the rest of the system. When an application is started, it is created as a process, which requires a call to the Process Manager. Because every process must have at least one thread, the Process Manager is invoked again to create a thread.

Virtual Memory Manager - The Virtual Memory Manager (VMM)

provides management of the system's virtual memory pool. Virtual memory is a scheme that allows disk resources to be used instead of physical system memory

Local Procedure Call Facility - LPC is a mechanism that enables two

threads in different processes to exchange information.

Security Reference Monitor -The Security Reference Monitor (SRM)

is responsible for enforcing all security policies on the local computer.

I/O Manager - The I/O Manager is responsible for coordinating and

(26)

Windows NT Architecture

Hardware abstraction layer

The Windows NT hardware abstraction layer, or

(27)
(28)
(29)

In NTFS, all file, directory

and metafile data—file

name,

creation

date,

access

permissions

(by

the

use

of access control lists), and size

—are stored as metadata in the

Master File Table (MFT).

The MFT structure supports

algorithms which minimize disk

fragmentation. A

directory entry consists of a

filename and a &”File ID”;, which

is

the

record

number

representing the file in the

Master File Table.

(30)
(31)

References

Related documents

Comprehensive alternatives for free or paid Internet access • ZyXEL UAG billing plans can be customized with varying bandwidth speeds, service durations and levels of payments •

Notwithstanding Lender's acceleration of the sums secured by this Mortgage, Borrower shall have the right to have any proceedings begun by Lender to enforce this Mortgage

College of Health and Human Services: Global Health, Health Informatics, Health Systems Management, Nutrition College of Science: Bioinformatics and Computational Biology,

* “değildim” ifadesinde “not” cümleye hem olumsuzluk anlamı katar hem de “past” anlamı katar. Aynı zamanda “dün” kelimesinden de cümlenin “past” olduğunu

Army active duty officers who are currently in PGY1 or who have completed a clinical PGY1 year are eligible for application at the PGY2 level and must indicate 4 years as

Case Summary: Run sechash to compute the SHA1 hash of an entire source disk, using:. - A computer with

Less severe hypoglycaemia, better metabolic control, and improved quality of life in Type 1 diabetes mellitus with continuous subcutane- ous insulin infusion (CSII) therapy;

Based on quality management principles Customer focused Leadership Involvement of people Process Approach System Approach Continual Improvement. Factual Approach to Decision