• No results found

OPERATING SYSTEM SERVICES

N/A
N/A
Protected

Academic year: 2021

Share "OPERATING SYSTEM SERVICES"

Copied!
33
0
0

Loading.... (view fulltext now)

Full text

(1)
(2)

OPERATING SYSTEM

SERVICES

(3)

USER INTERFACE

y Command line interface(CLI):uses text commands and a method for entering them

y Batch interface(BI):commands and directives to control those commands are entered into files and those files are executed

y Graphical user interface(GUI):a window system with a

pointing device to direct I/O, choose from menus, and

make selections and a keyboard to enter text

(4)

PROGRAM EXECUTION

y The system must be able to load a program into memory and run that program

y The program must be able to end its execution, either

normally or abnormally

(5)

I/O operations

y A running program may require I/O, which may involve file or an I/O device

y For efficiency and protection, users cannot control I/O devices directly

y Therefore, the OS must provide a means to do I/O

(6)

FILE SYSTEM MANIPULATION

y Programs need to be read and write files and directories

y Create and delete files by name, search for a given file and list file information

y Some programs include permissions management to allow or deny access to files or directories based on file

ownership

(7)

COMMUNICATIONS

y Process needs to exchange information ith other process y Processes executing on same computer system or on

different computer systems

y Communication may be implemented via shared memory or through message passing

y Message passing: packets of information are moved

between processes

(8)

ERROR DETECTION

y Errors may occur in CPU, memory hardware, I/O devices and in the user program

y For each type of error, the OS should take the appropriate action to ensure correct and consistent computing

y Debugging facilities can greatly enhance the user’s and

programmer’s abilities to use the system efficiently

(9)

RESOURCE ALLOCATION

y When there are multiple jobs running at the same time, resources must be allocated to each of them

y Resources: CPU cycles, main memory, file storage and I/O devices

y CPU scheduling routines: to determine how best to use the CPU

y Routines to allocate printers, modems, USB storage drives

and other peripheral devices

(10)

ACCOUNTING

y Keeping a track of which users are using how much and what kinds of computer resources can be used for

accounting or simply for accumulating usage statistics y Usage statistics Æ reconfigure the system to improve

computing services

(11)

PROTECTION AND SECURITY

y Protection involves ensuring that all access to system resources is controlled

y To make a system secure, the user needs to authenticate

himself or herself to the system

(12)

User operating system interface

y Command line interface or command interpreter – allows users to directly enter commands that are to be performed by the OS

y Graphical user interface (GUI)

(13)

Command interpreter

y Some operating systems include command interpreter in the kernel

y Windows XP and UNIX treat the command interpreter as a special program that is running when the job is initiated y Interpreters Æ shells : on systems with multiple command

interpreters

y Ex: On UNIX and Linux systems : Bourne shell, C shell,

Bourne-Again shell, Korn shell, etc

(14)

y Main function is to get and execute the user- specified commands like create, delete, list, print, copy, execute , and so on

y Two ways to implement the commands:

1) command interpreter itself contains the code to execute the command

2) implementing most commands through system

programs (ex: rm file.txt)

(15)

Graphical user interface

y Provides a mouse-based-window-and-menu-system as an interface

y Provide a desktop metaphor where the mouse is moved to

position its pointer on images, or icons, on the screen that

represent programs, files, directories and system functions

(16)

SYSTEM CALLS

y provide an interface to the services made

y available by an OS available as routines written in C and

C++, assembly language

(17)

API

y Application developers design programs according to an application programming interface (API)

y Specifies a set of functions that are available to an

application programmer, including the parameters that are passed to each function and the return values the

programmer can expect.

(18)

Three of the most common APIs

y Win32 API for windows system

y POSIX API for POSIX-based systems( all versions of UNIX, Linux, and Mac OS X )

y Java API for designing programs that run on Java virtual

machine

(19)

Why would an application programmer prefer programming according to an API rather than invoking actual system calls?

y program portability: an application programmer designing a program using an API can expect her program to

compile and run on any system that supports the same API y actual system calls often can be more detailed and difficult

to work with than the API available to an application

programmer

(20)

y

The run time support system( a set of functions built into libraries included with a compiler) for most programming languages provides a system-call interface that serves as the link to system calls made available by the OS

y

intercepts function calls in the API and invokes the necessary system call within the OS a number is associated with each system call

y

the system call interface maintains a table indexed according to

these numbers then invokes the intended system call in the OS

kernel and returns the status of the system call and any return

values

(21)

Three methods to pass parameters

y Pass parameters in registers

y Parameters are stored in a block, or table, in memory, and the address of the block is passed as parameter in a

register

y Parameters can be placed or pushed onto the stack by the

program and popped off the stack by the OS

(22)

Types of system calls

y Process control y File manipulation y Device manipulation

y Information maintenance

y communications

(23)

Process control

y End, abort

y Load, execute

y Create process, terminate process

y Get process attributes, set process attributes y Wait for time

y Wait event, signal event

y Allocate and free memory

(24)

File management

y Create file, delete file y Open, close

y Read, write, reposition

y Get file attributes, set file attributes

(25)

Device management

y Request device, release device y Read, write, reposition

y Get device attributes, set device attributes

y Logically attach or detach devices

(26)

Information maintenance

y Get time or date, set time or date y Get system data, set system date

y Get process, file, or device attributes

y Set process, file, or device attributes

(27)

communications

y Create, delete communication connection y Send, receive messages

y Transfer status information

y Attach or detach remote devices

(28)

(get process attributes and set process attributes)

y to determine and reset the attributes of a job or process, including the job’s priority, its maximum allowable

execution time and so no

y Usage : when a new process is created

y In order to control its execution

(29)

(create process or submit job)

y To create a new program that can be multiprogrammed

and save the memory image of existing program

(30)

(terminate process)

y To terminate a process when it is incorrect or no longer

needed

(31)

(wait time)

y To wait for a certain amount of time

y Usage – when we need to wait for already created

processes to finish their execution

(32)

(wait event)

y To wait for a specific event to occur

(33)

(signal event)

y Used by jobs or processes to signal that the event has

occurred

References

Related documents

from entering into any agreement with any one or more ASEAN Member State and/or Australia and/or New Zealand relating to trade in goods, trade in services, investment, and/or

The findings indicated that religion and spirituality are the major factors contributing to the resilience of children living with HIV, as they facilitated the acceptance of

And the skies are not cloudy all day. Home, home, on the range Where the deer and the antelope play; Where seldom is heard a discouraging word,.. And the skies are

The Director of Project Management will create a stub project for all approved projects in Project Server and set the phase

The reason we use the TTO task, rather than eliciting surrogate predic- tions in the SG gamble task, is to avoid interpretation difficulties if we find that surrogate choices

The artificial intelligence-based assistant can perform tasks or services based on user input and/or contextual awareness (e.g., location awareness), including acting as a

Having a uniform risk-averse value function for both costs and benefits requires that we use a different discount rate for each, which is contrary to standard practice. On the