0% found this document useful (0 votes)
35 views

Chapter 3 - Operating System Structures

This chapter discusses the core components and structures of operating systems. It describes the main system components like system programs, system calls, and services provided by the OS. It outlines the different system structures including monolithic, layered, and microkernel approaches. It also introduces the concept of virtual machines as a way to simulate hardware and isolate programs from direct hardware access for security. The key points covered are the building blocks, interfaces, and architectural designs that underlie how operating systems function.

Uploaded by

Geojeet tom
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Chapter 3 - Operating System Structures

This chapter discusses the core components and structures of operating systems. It describes the main system components like system programs, system calls, and services provided by the OS. It outlines the different system structures including monolithic, layered, and microkernel approaches. It also introduces the concept of virtual machines as a way to simulate hardware and isolate programs from direct hardware access for security. The key points covered are the building blocks, interfaces, and architectural designs that underlie how operating systems function.

Uploaded by

Geojeet tom
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Chapter 3: Operating System Structures

1
2
1. System Components

3
1. System Components

4
1. System Components

5
1. System Components

6
1. System Components

7
1. System Components

8
Unit II User-Computer Interface_Operating System

9
Unit II User-Computer Interface_Operating System

10
1. System Components

11
2. Operating System Services
• An operating system provides an environment for the execution of programs - It provides certain services to
programs and to the users of those programs - The specific services provided differ from one OS to another but we
can identify common classes - The OS services are provided for the convenience of the programmer - to make the
programming task easier

• Program execution - The system must be able to load a program into memory and o run that program. The
program must be able to end its execution, either normally or abnormally (indicating error)

• I/O Operations - A running program my require I/O - This I/O may involve a file or an I/O device - For efficiency and
protection users usually can not control I/O devices directly

• File System Manipulation - Programs need to rad and write files - programs also need to create and delete files by
name.

• Communications - One process needs to exchange information with another process - It can take place in 2 ways:
shared memory and message passing

• Error detection - Errors may occur in the CPU, memory hardware, I/O device (memory error or power failure, lack
of paper, connection failure, attempt to access illegal memory location) - For each type of error, the operating
system should take the appropriate action to ensure correct and consistent computing

• Resource allocation - OS protects the resources of the system - when multiple users are logged on or multiple
jobs are running at the same time, resources must be allocated to each of them - Resources are: CPU cycle, main
memory, file storage, etc - For example how best to use the CPU, the CPU scheduling routines that take into
account the speed of the CPU, the jobs that must be executed, the number of registers available and other factors

• Accounting - keep track of which users use how many and which kind of computer resources - This record
keeping may be used for accounting or for usage statistics

• Protection - When several disjoint processes execute concurrently, it should not be possible for one process to
interfere with the others or with the operating system itself - protection involves ensuring that all access to the
system resources is controlled - Security of the system from outsiders is also important
12
3. System Calls
• System calls provide the interface between a process and the operating
system - these calls are generally available as assembly - language
instructions - For example, consider writing a simple program to read
data from one file and to copy them to another file - the first input that the
program will need is the names of the two files: the input file and the
output file - once the two file names are obtained, the program must
open the input file and create the output file - Each of these operations
requires another system call and may encounter possible error conditions
such as no file of that name exists or file is protected against access - In
such case, the program must print a message on the console and
terminate abnormally - else, now both files are setup - we enter a loop
that reads from the input file (a system call) and writes to the output file
(another system call) - Finally after the entire file is copied , the program
may close both files, write a message to the console and finally terminate
normally

13
3. System Calls

• Process Control - A running program needs to be able to halt its execution either normally (end) or
abnormally (abort) - If a system call is made to terminate the currently running program abnormally,
or if the program runs into a problem and causes an error trap, a dump of memories sometimes
taken and an error message is generated - the dump is written to disk and may be examined by a
debugger to the cause of the problem - the operating system must transfer control to the command
interpreter - the command interpreter then reads the next command

• File Management - System calls are needed to create and delete files - Either system call requires
the name of the file and perhaps some of the file’s attributes - once the file is created, we need to
open it and use it - we may read, write and close the file

• Device Management - A program as it is running may need additional resources to proceed -


Additional resources may be more memory, tape drives, access to files and so on - if the resources
are available, they can be granted and control can be returned to the user program; otherwise, the
program will have to wait until sufficient resources are available

• Information Maintenance - System calls exist for the purpose of transferring information between
the user program and the operating system - For example, system call to return the current time
and date, another system call may return information as the number of current users, the version of
operating system, the amount of free memory available - In addition, the operating system keeps
information about all its processes, and there are system calls to access this information

• Communication - There are two models of communication: message passing model and shared
memory model
14
4. System Programs
• System programs provide a convenient environment for program development and execution -
some of them are simple user interfaces to system calls; others are considerable more complex -
they can be divided into these categories

• File management - These programs create, delete, copy, rename, print, dump, list and generally
manipulate files and directories

• Status information - some programs simply ask the system for the date, time, amount of available
memory, number of users or similar status information - that information is formatted, and is printed
to the terminal or other output device or file

• File modification - several text editors may be available to create and modify the content of files
stored on disk or tape

• Programming-language support - Compilers, assemblers and interpreters for common


programming language such as C, C++, JAVA, Visual Basic and PERL are often provided to the user
with the operating system

• Program loading and execution - once a program is assembled or compiled, it must be loaded
into memory to be executed - the system may provide absolute loaders, relocatable loaders, linkage
editors and debugging systems for higher level languages

• Communications - These programs provide the mechanism for creating virtual connections among
processes, users and different computer systems - they allow users to send messages to one
another’s screens, to browse web pages, to send electronic mail messages, to log in remotely, to
transfer files from one machine to another

15
5. System Structures

• Example: MS DOS

16
5. System Structures

• Monolithic Structure - Early UNIX

17
5. System Structures

• Layered Approach -

18
5. System Structures

• Microkernels -

19
5. System Structures

• Modularity -

20
6. Virtual Machine

21

You might also like