Tutorial

advertisement
‫اململكة العربية السعودية‬
Kingdom of Saudi Arabia
Ministry of Higher Education
Prince Sattam Bin Abdul-Aziz University
College of Computer
Engineering and sciences
‫وزارة التعليم العايل‬
‫جامـعـة األمري سطام بن عبدالعزيز‬
‫كل ـي ــة هـنــدس ــة وعلـ ــوم احلـاســب‬
2440 & 2544 :‫الشعبة‬
Course Title: CS3701-Operating System
CSC3701
Instructor Name: Mr. Abdul Haseeb Khan
Tutorial Lecture # 02
CH: Operating-System
Week# 02
Structures
Date: 07-09-2015
Objective: Introduction of basic concepts in operating system structure
Q 1: What functions are provided by the operating system to help the user?
Answer:
1. User Interface: All operating systems provide a user interface, which can be
either a CLI or a GUI, to enable user interaction with the system.
2. Program Execution: OS loads a program into the memory, executes it and
terminates it normally or with error.
3. I/O Operations: A running program needs I/O involving a device or a file.
4. File System Manipulation: Enables users to read and write files and directories,
create and delete them, list file information, manage permissions.
5. Communications: Enables processes to exchange information.
6. Error Detection: Watches for errors in running processes and takes a suitable
action in case of an error.
Q 2: What services are provided by the operating system to the system?
Answer:
1. Resource allocation: Enables efficient allocation of resources to jobs running
concurrently. Resources could be CPU, main memory and file storage.
2. Accounting: Keeps track of which users use how much and what kinds of
resources.
3. Protection and Security: Protection – ensuring all access to the system
resources is controlled. Security – user authentication, defending against
invalid access attempts.
Q 3: What are system calls?
Answer:
These are routines written in C and C++ that are called to access services made
available by an operating system. For example, a write () system call writes
data to a file.
Q 4: Give examples of some of the commands available in the CLI of your system.
Answer:
See the manual
Q 5: What is an Application Programming Interface (API)?
Answer:
The API 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 returned by the function. Most common APIs: Win32 API,
POSIX API and Java API.
Q 6: Why are operating system services accessed through an API and not system calls?
Answer:
Application programmers access operating system services by calling API
functions in their application programs. Behind the scenes implementation of
API functions call the system calls. Two main advantages:
(A). Portability – application program can run on any operating system that
supports the API.
(B) Information Hiding – the details of a system call are hidden from the user
by an API function.
Q 7: Give a classification of various system calls in an OS, with examples?
Answer:
The system calls can be classified into one of the following categories:
1. Process Control – for example system calls to end a process, abort a
process, load a process, execute a process, create a process, and
terminate a process etc..
2. File Management – for example system calls to create a file, delete a
file, open a file, close a file and read from a file etc..
3. Device Management – for example system calls to request a device,
release a device, read from a device, write to a device, etc.
4. Information Maintenance – for example system calls to get time and
date, get file or process or device attributes, etc.
5. Communication – for example system calls to create a connection,
delete a connection, send a message or receive a message etc.
Q 8: What are systems programs? Give examples.
Answer:
System programs help in program development and execution.
Examples: Programs that provide programming language support such as
compilers and debuggers; programs to read system status information such as
time and date, amount of memory available, etc.; programs to load and execute
programs such as loaders and linkers.
Q 9: What are the design goals of an operating system?
Answer:
User goals: OS should be easy to use, easy to learn, reliable, safe and fast.
System goals: OS should be easy to design, implement, and maintain; flexible,
reliable, error-free and efficient.
Q 10: Why is an operating system divided or structured into modules?
Answer:
Operating systems are very complex systems. They are structured into modules
to enable easy implementation, maintenance and modification. Each module
implements a component of the OS and has carefully defined inputs, outputs
and functions.
Q 11: What is the advantage of the layered approach to structuring an OS?
Answer:
The system is easier to debug and modify because bugs and changes affect
only particular layers of the system and not all layers.
Q 12: What is the disadvantage of the layered approach?
Answer:
It is difficult to define layers. Because upper level layers can use only the
lower-level layers, what functions to include in the lower layers is difficult to
determine.
Q 13: Briefly describe the microkernel approach to structuring an operating system.
Answer:
Microkernel approach removes all non-essential components from the kernel
and implements them as system and user-level programs. The result is a
smaller kernel that implements only process management, memory
management and communication facility.
Q 14: What is a kernel?
The kernel is
a computer
program that
manages input/output requests
from software and translates them into data processing instructions for
the central processing unit and other electronic components of a computer. The
kernel is a fundamental part of a modern computer's operating system.
When a computer program (in this case called a process) makes requests of the
kernel, the request is called a system call. Various kernel designs differ in how
they manage system calls (time-sharing) and resources.
Q 15: What are the advantages of microkernel approach?
Answer:
1. It is easier to extend a microkernel.
2. It is easier to port OS to new architectures.
3. OS is more reliable and secure as there is less code running in kernel
mode.
Q 16: what is the difference between an operating system and a kernel?
Answer:
The kernel is the part of the operating system. The operating system is the
software package that communicates directly to the hardware and our
application. The kernel is the lowest level of the operating system. The kernel
is the main part of the operating system and is responsible for translating the
command into something that can be understood by the computer. The main
functions of the kernel are:
1. Memory management
2. Network management
3. Device driver
4. File management
5. Process management
Download