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

FirstModule-ClassContent-2

The document provides an overview of operating systems, detailing computer organization, system architecture, and the structure of operating systems. It discusses various types of computer systems, including single processor, multiprocessor, and clustered systems, as well as key operating system services and system calls. Additionally, it covers system programs, design goals, and implementation strategies for operating systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

FirstModule-ClassContent-2

The document provides an overview of operating systems, detailing computer organization, system architecture, and the structure of operating systems. It discusses various types of computer systems, including single processor, multiprocessor, and clustered systems, as well as key operating system services and system calls. Additionally, it covers system programs, design goals, and implementation strategies for operating systems.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

OPERATING SYSTEM

Dr. Abha Trivedi

abhatrivedi2021@vitbhopal.ac.in
INTRODUCTION TO OPERATING SYSTEM

Computer Organization: I/O Structure


Direct Memory Access (DMA)

• Used for high-speed I/O devices able to transmit


information at close to memory speeds

• Only one interrupt is generated per block, rather than one


interrupt per byte

• While the device controller is performing these operations,


the CPU is available to accomplish other works

• After setting up buffers, pointers, and counters for the I/O device, the device
controller transfer an entire block of data directly to or from its own buffer
storage to memory, without anyz intervention by the CPU
INTRODUCTION TO OPERATING SYSTEM

Computer System Architecture:

Types of Computer Systems based on number of General Purpose Processors

1. Single Processor Systems

2. Multiprocessor Systems

3. Clustered Systems
INTRODUCTION TO OPERATING SYSTEM

Computer System Architecture:

1. Single Processor Systems

1. One main CPU capable of executing a general purpose instruction set including
instructions from user processes
2. Other special purpose processors are also present which perform device specific
tasks
INTRODUCTION TO OPERATING SYSTEM

Computer System Architecture:

2. Multiprocessor Systems

1. Also known as parallel systems or tightly coupled systems


2. Has two or more processors in close communication, sharing the computer bus and
sometimes the clock, memory, and peripheral devices

Advantages:
1. Increased throughput
2. Economy of scale
3. Increased reliability
INTRODUCTION TO OPERATING SYSTEM

Computer System Architecture:

2. Multiprocessor Systems

Types of Multiprocessor Systems

Symmetric Multiprocessing Asymmetric Multiprocessing


INTRODUCTION TO OPERATING SYSTEM

Computer System Architecture:

3. Clustered Systems

1. Like multiprocessor systems, clustered systems gather together multiple


CPUs to accomplish computational work
2. They are composed of two or more individual systems coupled together

3. Provides high availability

4. Can be structured asymmetrically or symmetrically


1. One machine in 1. Two or more
Hot-Standby hosts run
mode applications
2. Others run 2. Monitors each
applications other
INTRODUCTION TO OPERATING SYSTEM

Computer System Architecture:

3. Clustered Systems
INTRODUCTION TO OPERATING SYSTEM

Operating System Structure: (Multiprogramming & Multitasking)

– Operating Systems vary greatly in their makeup internally

– Commonalities
• Multiprogramming
• Time Sharing (Multitasking)
INTRODUCTION TO OPERATING SYSTEM

Operating System Structure: (Multiprogramming & Multitasking)

• Multiprogramming
– A single user cannot, in general, keep either the CPU or the I/O devices busy at all times

– Multiprogramming increases CPU utilization by organizing jobs (code and data) so that the
CPU always has one to execute.

Job Pool Memory layout for a multiprogramming


INTRODUCTION TO OPERATING SYSTEM

Operating System Structure: (Multiprogramming & Multitasking)

• Multiprogramming
– A single user cannot, in general, keep either the CPU or the I/O devices busy at all times

– Multiprogramming increases CPU utilization by organizing jobs (code and data) so that the
CPU always has one to execute.

Multiprogrammed systems
provide an environment in
which the various system
resources(for e.g. CPU, memory,
and peripheral devices) are
utilized effectively

Job Pool Memory layout for a multiprogramming


INTRODUCTION TO OPERATING SYSTEM

Operating System Structure: (Multiprogramming & Multitasking)

• Time Sharing (Multitasking)


– CPU executes multiple jobs by switching among them

– Switches occur so frequently that the users can interact with each program while it is
running

– Time sharing requires an interactive (or hands-on) computer system, which provides
direct communication between the user and the system.
INTRODUCTION TO OPERATING SYSTEM

• Operating System Services


– An OS provides an environment for the execution of programs
– It provides certain services to programs and to users of those programs
1. User Interface

Command Line Interface Graphical User Interface (GUI)


INTRODUCTION TO OPERATING SYSTEM

• Operating System Services


– An OS provides an environment for the execution of programs
– It provides certain services to programs and to users of those programs

2. Program Execution
INTRODUCTION TO OPERATING SYSTEM

• Operating System Services


– An OS provides an environment for the execution of programs
– It provides certain services to programs and to users of those programs

3. I/O Operations
INTRODUCTION TO OPERATING SYSTEM

• Operating System Services


– An OS provides an environment for the execution of programs
– It provides certain services to programs and to users of those programs

4. File System Manipulation


INTRODUCTION TO OPERATING SYSTEM

• Operating System Services


– An OS provides an environment for the execution of programs
– It provides certain services to programs and to users of those programs

5. Communications
INTRODUCTION TO OPERATING SYSTEM

• Operating System Services


– An OS provides an environment for the execution of programs
– It provides certain services to programs and to users of those programs

6. Error detection
INTRODUCTION TO OPERATING SYSTEM

• Operating System Services


– An OS provides an environment for the execution of programs
– It provides certain services to programs and to users of those programs

7. Resource Allocation
INTRODUCTION TO OPERATING SYSTEM

• Operating System Services


– An OS provides an environment for the execution of programs
– It provides certain services to programs and to users of those programs

8. Accounting
INTRODUCTION TO OPERATING SYSTEM

• Operating System Services


– An OS provides an environment for the execution of programs
– It provides certain services to programs and to users of those programs

9. Protection and Security


INTRODUCTION TO OPERATING SYSTEM

• Operating System Services


– An OS provides an environment for the execution of programs
– It provides certain services to programs and to users of those programs

1. User Interface
2. Program Execution
3. I/O Operations
4. File System Manipulation
5. Communications
6. Error detection
7. Resource Allocation
8. Accounting
9. Protection and Security
INTRODUCTION TO OPERATING SYSTEM

• System Calls
• Types of System Calls
• System Programs
• Operating System Design and Implementation
• Structures of Operating System
INTRODUCTION TO OPERATING SYSTEM

• System Calls
– System calls provide an interface to the services made available by an Operating
System

Privileged Mode

• System call is the programmatic way in which a computer program requests a service from the
kernel of the operating system

• These calls are generally available as routines written in C and C++


INTRODUCTION TO OPERATING SYSTEM

• System Calls
INTRODUCTION TO OPERATING SYSTEM

• System Calls

Can refer: https://paolozaino.wordpress.com/2013/05/22/system-calls-part-i/


INTRODUCTION TO OPERATING SYSTEM

• System Calls
INTRODUCTION TO OPERATING SYSTEM

• System Calls
INTRODUCTION TO OPERATING SYSTEM

Shell: A shell program is software that provides users with an interface for accessing services from the kernel.
– On some platforms, the shell is called a command interpreter because it interprets the commands the user issues. The
shell then translates those commands into system calls in the kernel. Each system call sends a request to the kernel to
perform a specific task
– A terminal merely provides a command prompt for working with a shell. For example, the default terminal
in macOS/Unix is named Terminal, and the default terminal in Windows is called Command Prompt. Neither is
considered a shell.
– A Terminal window activate the shell, like for macOS-Z shell (zsh), Linux-Bash shell, windows cmd.exe shell are
the active shell, they are the default shells

https://www.techtarget.com/searchdatacenter/definition
/shell#:~:text=On%20some%20platforms%2C%20the
. %20shell,to%20perform%20a%20specific%20task.
INTRODUCTION TO OPERATING SYSTEM
• System Calls: Example of a System Call sequence for writing a simple program to read
data from one file and copy them to another file:

Source File Destination File


Acquire Input Filename

Write prompt to screen


Open Input File
Accept Input
If File doesn’t exist, ABORT
Acquire Output Filename
Create Output File
Write prompt to screen
If File exist, ABORT
Accept Input
INTRODUCTION TO OPERATING SYSTEM
• System Calls: Example of a System Call sequence for writing a simple program to read
data from one file and copy them to another file:

Source File Destination File


Loop Read From Input File

Until read fails Write to Output File

Close Output File

Write completion message


to screen

Terminate normally
INTRODUCTION TO OPERATING SYSTEM

Create Output File

Write prompt to screen If File exist, ABORT

Accept Input
Read From Input File

Write prompt to screen Write to Output File

Accept Input
Close Output File
Open Input File
Write completion message
If File doesn’t exist, ABORT to screen

Terminate normally
INTRODUCTION TO OPERATING SYSTEM

Types of System Calls

• System calls can be grouped roughly into five major categories:

– Process Control
– File Manipulation
– Device Management
– Information Maintenance
– Communications
INTRODUCTION TO OPERATING SYSTEM

Types of System Calls

1. Process Control:
– Load, execute
– Create process, terminate process
– Get process attributes, set process attributes
– Wait for time
– Wait event, signal event
– Allocate and free memory
INTRODUCTION TO OPERATING SYSTEM

Types of System Calls

2. File Manipulation:
– Create file, delete file
– Open, close
– Read, write, reposition
– Get file attributes, set file attribute
INTRODUCTION TO OPERATING SYSTEM

Types of System Calls

3. Device Manipulation:
– Request device, release device
– Read, write, reposition
– Get device attributes, set device attribute
– Logically attach or detach devices
INTRODUCTION TO OPERATING SYSTEM

Types of System Calls

4. Information maintenance:
– Get time or date, set time or date
– Get system data, set system data
– Get process, file, or device attributes
– Set process, fie or device attributes
INTRODUCTION TO OPERATING SYSTEM

Types of System Calls

5. Communications:
– create, delete communication connection
– send, receive messages
– transfer status information
– attach or detach remote devices
INTRODUCTION TO OPERATING SYSTEM

• System Programs
An important aspect of a modern system is the collection of system programs
INTRODUCTION TO OPERATING SYSTEM

• System Programs

• System programs provide a convenient environment for program development and execution

• Some of them are simply user interfaces to system calls

• Others are considerably more complex


INTRODUCTION TO OPERATING SYSTEM

System Programs can be divided into the following categories

• File Management

Create
Delete
Copy
Rename
Print
Dump

List, and generally manipulate files and directories


INTRODUCTION TO OPERATING SYSTEM

System Programs can be divided into the following categories

• Status Information

Ask the system for:


• Date, Time
• Amount of available memory or disk space
• Number of users
• Detailed performance

• Logging, and debugging information etc.


INTRODUCTION TO OPERATING SYSTEM

System Programs can be divided into the following categories

• Programming-language support

Compilers

Assemblers

Debuggers and

Interpreters

For common programming languages (such as C, C++, Java,


Visual Basic, and PERL) which are often provided to the user
with the operating system
INTRODUCTION TO OPERATING SYSTEM

System Programs can be divided into the following categories

• 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
• Overlay loaders
Debugging systems for either higher-level languages or machine
language are needed as well.
INTRODUCTION TO OPERATING SYSTEM

System Programs can be divided into the following categories

• Communications

These programs provide the mechanism for:


• Creating virtual connections among processes, users, and
computer systems
• Allowing users to send messages to one another’s screens
• To browse webpages
• To send electronic-mail message
• To log in remotely or to transfer files from one machine to
another
INTRODUCTION TO OPERATING SYSTEM

• Operating System Design and implementation

Design Goals:
1st Problem – Defining Goals and specification
– Choice of Hardware
– Type of System
Beyond this highest design level, the requirements may be much harder to specify

Requirements
– User Goals
– System Goals
INTRODUCTION TO OPERATING SYSTEM

• Operating System Design and implementation

Requirements
– User Goals
– System Goals
INTRODUCTION TO OPERATING SYSTEM

• Operating System Design and implementation

Mechanisms and Policies:


Mechanisms determine how to do something
Policies determine what will be done
INTRODUCTION TO OPERATING SYSTEM

• Operating System Design and implementation

Mechanisms and Policies:


Mechanisms determine how to do something
Policies determine what will be done

One important principle is the separation of policy from mechanism

Good and Flexible Not Good


INTRODUCTION TO OPERATING SYSTEM

• Operating System Design and implementation

Implementation:
– Once an operating system is designed, it must be implemented
– Traditionally, operating systems have been written in assembly language
– Now, however, they are most commonly written in higher-level languages such as C
or C++

Advantages of writing in high level languages:


– The code can be written faster
– It is more compact
– It is easier to understand and debug
– It is easier to port
INTRODUCTION TO OPERATING SYSTEM

Implementation:

E.g.
– MS-DOS was written in Intel 8088 assembly language. Consequently, it is available
on only the Intel family of CPUs

– The Linux operating System, in contrast, is written mostly in C and is available on a


number of different architectures, including Intel 80X86, Motorola 680X0, SPARC,
and MIPS RX000
INTRODUCTION TO OPERATING SYSTEM

Structures of Operating System

Simple Structure
INTRODUCTION TO OPERATING SYSTEM

Structures of Operating System :


Monolithic Structure:
INTRODUCTION TO OPERATING SYSTEM

Structures of Operating System :

Layered Structure:
INTRODUCTION TO OPERATING SYSTEM

Structures of Operating System :

Microkernels structure
INTRODUCTION TO OPERATING SYSTEM

• User Operating System Interface

There are two fundamental approaches for users to interface with the operating system:

1) Provide a Command-Line Interface(CLI) or Command Interpreter that allows users


to directly enter commands that are to be performed by the operating system.

2) Allows the user to interface with the operating system via a Graphical User Interface
or GUI
INTRODUCTION TO OPERATING SYSTEM
• Command Interpreter:

If using Linux environment: open terminal If using Windows environment: open


terminal (start menu: cmd or command)
PWD: print working directory
cd: Change directory cd: Change directory
mkdir: Make Directory mkdir: Make Directory
ls: list dir: print working directory/list
Rm -d: Remove directory ls: list
Rm: remove file rmdir: Remove
https://cygwin.com/install.html
For extra packages to download: Cmd commands under Windows -
http://gnuwin32.sourceforge.net/packages.ht Thomas-Krenn-Wiki
ml

For macOS:
https://www.comptia.org/blog/applying-your-linux-skills-to-macos-terminal-bash-and-common-commands
INTRODUCTION TO OPERATING SYSTEM
No. Command Meaning
1 vi filename Create file and write
2 cat > filename Create file and write
Create file and write directly in
3 echo ‘…’ > filename
terminal
4 cat file display a file
5 echo ‘…’ >> filename append contents to file
count number of
6 wc file
lines/words/characters in file
7 > Filename OR touch filename to create empty file
to count line/words/characters in
8 wc filename
file
9 cp file1 file2 copy file1 and call it file2
10 mv file1 file2 rename file1 to file2
11 rm file remove a file
12 ls –d */ To list only directories
To list files and directory
13 ls *
separately

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy