FirstModule-ClassContent-2
FirstModule-ClassContent-2
abhatrivedi2021@vitbhopal.ac.in
INTRODUCTION TO OPERATING SYSTEM
• 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
2. Multiprocessor Systems
3. Clustered Systems
INTRODUCTION TO OPERATING SYSTEM
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
2. Multiprocessor Systems
Advantages:
1. Increased throughput
2. Economy of scale
3. Increased reliability
INTRODUCTION TO OPERATING SYSTEM
2. Multiprocessor Systems
3. Clustered Systems
3. Clustered Systems
INTRODUCTION TO OPERATING SYSTEM
– Commonalities
• Multiprogramming
• Time Sharing (Multitasking)
INTRODUCTION TO OPERATING SYSTEM
• 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.
• 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
– 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
2. Program Execution
INTRODUCTION TO OPERATING SYSTEM
3. I/O Operations
INTRODUCTION TO OPERATING SYSTEM
5. Communications
INTRODUCTION TO OPERATING SYSTEM
6. Error detection
INTRODUCTION TO OPERATING SYSTEM
7. Resource Allocation
INTRODUCTION TO OPERATING SYSTEM
8. Accounting
INTRODUCTION TO OPERATING SYSTEM
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
• System Calls
INTRODUCTION TO OPERATING SYSTEM
• System Calls
• 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:
Terminate normally
INTRODUCTION TO OPERATING SYSTEM
Accept Input
Read From Input 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
– Process Control
– File Manipulation
– Device Management
– Information Maintenance
– Communications
INTRODUCTION TO OPERATING SYSTEM
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
2. File Manipulation:
– Create file, delete file
– Open, close
– Read, write, reposition
– Get file attributes, set file attribute
INTRODUCTION TO OPERATING SYSTEM
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
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
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
• File Management
Create
Delete
Copy
Rename
Print
Dump
• Status Information
• Programming-language support
Compilers
Assemblers
Debuggers and
Interpreters
• Communications
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
Requirements
– User Goals
– System Goals
INTRODUCTION TO OPERATING SYSTEM
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++
Implementation:
E.g.
– MS-DOS was written in Intel 8088 assembly language. Consequently, it is available
on only the Intel family of CPUs
Simple Structure
INTRODUCTION TO OPERATING SYSTEM
Layered Structure:
INTRODUCTION TO OPERATING SYSTEM
Microkernels structure
INTRODUCTION TO OPERATING SYSTEM
There are two fundamental approaches for users to interface with 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:
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