0% found this document useful (0 votes)
21 views37 pages

OS Chapter 1 Notes

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)
21 views37 pages

OS Chapter 1 Notes

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/ 37

Introduction

Objectives
❖ To study basic fundamentals of operating system.
❖ To understand concept of Linux operating system
❖ To learn basic commands of Linux operating system
Introduction to operating system
❖ Operating system acts as an intermediary between the
user of computer and computer hardware.
❖ The purpose of an OS is to provide an environment in
which a user can execute programs in a convenient
and efficient manner.
❖ An OS is a program which manages all the computer
hardware.
List off Different services provided by operating system to
users
❖ User Interface: comes with three forms…
o Command line interface
o Batch based interface
o Graphical user interface
❖ Program execution :
o OS must have the capability to load a program into memory and execute that
program.
o Programs must be able to end its execution, either normally or abnormally.
❖ File system manipulation:
o Programs need has to be read and then write them as files and directories.
❖ Input/output operations:
List off Different services provided by operating system to
users
❖ Input/output operations:
o A program which is currently executing may require I/O, which may involve file or
other I/O devices . for efficiency and protection users cannot directly govern the
I/O device.
❖ Communication:
❖ Process needs to swap over information with other process, processes executing
on same computer system or on different computer systems can communicate
using operating system.
❖ Communication between two processes can be done using shared memory or via
message passing.
❖ Resource allocation:-
o When multiple jobs running concurrently , resources must need to be allocated
to each of them.
o Resources can be CPU cycles, main memory storage , file storage and I/O devices
List off Different services provided by operating system to
users
❖ Error Detection:-
o Error may occur within CPU, memory hardware , I/O devices and in the user
program.
❖ Accounting :-
o This service of the operating system keeps track of which users are using how
much and what kinds of computer resources have been used for accounting or
simply to accumulate usage statistics.
❖ Security and protection:-
o Protection includes in ensuring all access to system resources in a controlled
manner. For making a system secure, the user needs to authenticate him or her
to the system before using via login ID and Password.
Introduce the concept of process
❖ A process refers to a program in execution; it’s a running instance of
a program.
❖ It is made up of the program instruction , data read from files other
programs input from a system user.
❖ A program is a passive entity such as content of a file or instruction
code of particular files whereas process is an active entity. Which
specify next instruction to execute and set if associated resources.
❖ There are two different types of process
❖ Foreground process
❖ Background process
Introduce the concept of process
❖ Background process:- a back ground process runs without being
connected to your keyboard.
❖ If the background process require any keyboard input …. It waits.
❖ The advantages of running a process in the background is that you can
run other commands….you do not have to wait until it completes to
start another.
❖ The simplest way to start a background process is to add an
ampersand (&) at the end of the command.
❖ $ls ch*.doc & amp;
❖ This display all those files the names of which start with ch and end
with .doc
Introduce the concept of process
❖ That first line contains information about the background process---
the job number and the process ID.
Process States
❖ A process which is executed by the process have various states, the
state of the process is also called as status of the process.
❖ The status includes whether the process has executed or whether the
process is waiting for some input and output from the user and
whether the process is waiting for some input and output from the
user and whether the process is waiting for the CPU to Run the
program after the completion of the process.
Process States
Process States
❖ New(Create):- the process is about to be created but not yet created.
❖ It is the program which is present in secondary memory that will be
picked up by OS to create the process.
❖ Ready:- new-> Ready to run .
❖ After the creation of a process, the process enters the ready state. i.e.
the process is loaded into main memory.
❖ Run: the process is chosen by CPU for execution and the instructions
within the process are executed by any one of the available CPU cores.
❖ Blocked or Wait:- whenever the process requests access to I/O or
needs input from the user or needs access to a critical region it
enters the blocked or wait state.
Process States
❖ Terminated or Completed : process is killed as well as PCB is deleted.
❖ Suspend ready :- process that was initially in the ready state but were
swapped out of main memory and placed onto external storage by
schedular are said to be in suspend ready state.
❖ Suspend wait or suspend blocked:- similar to suspend ready but uses
the process which was performing I/O operation and lack of main
memory caused them to move to secondary memory.
Process Control Block
❖ Process control block is data structure that contains information of
the process related to it.
❖ The process control block is also known as a task control block, entry
of the process table, etc….
❖ It is very important for process management as the data structuring
for process is done in terms of the PCB..
❖ It also defines the current state of the operating system.
❖ PCB in an operating system, is the data structure used to store the
process information . It is called…
❖ Task controlling Block
❖ Process table
Structure of the process control block
❖ The process control stores many data items that are needed for
efficient process management.
❖ Some of these data items are explained with the help of the given
diagram.
Process Control Block
Pointer: It is a stack pointer that is required to be saved when the process is switched
from one state to another to retain the current position of the process.
Process state: It stores the respective state of the process.
Process number: Every process is assigned a unique id known as process ID or PID
which stores the process identifier.
Program counter: It stores the counter,: which contains the address of the next
instruction that is to be executed for the process.
Register: These are the CPU registers which include the accumulator, base, registers,
and general-purpose registers.
Memory limits: This field contains the information about memory management
system used by the operating system. This may include page tables, segment tables,
etc.
Open files list : This information includes the list of files opened for a process.
User Interface
❖ Almost all operating system have user interface …..(UI)
❖ Operating system have two types :- command line interface (CLF) and Graphical
user interface(GUI)
❖ The command line interface (CLI) , is a non-graphical , text-based interface to the
computer system where the user types in command and the computer then
successfully executes it.
❖ The CLI terminal accepts the commands that the user types and passes to the
shell.
❖ If the output is produced by the specific command, then this text is displayed in
the terminal.
Command interpreter does the following

❖ Read the commands and any options and arguments that you
provide.
❖ Translate or expands any special characters such as the * and
? Used as wild card characters on linux and unix systems.
❖ Locates the command that you want to execute on your
system
❖ On linux command and unix , a command interpreter is known
as a shell….
Graphical user Interface

❖ GUI is a interface that allows users to interact with different


electronic devices suing icons and other visual indicators
❖ GUI were creted BCOZ, CLI were quite complicated and it was
difficult to learn all the commands in it.
❖ In today’s times GUI are used in many devices such as Mobiles
, MP3 player, gaming devices, smart phone…
Graphical user Interface

❖ GUI is an interface that allows users to interact with different


electronic devicesusing ICONS, and other visual indicators.
Elements in Graphical user Interface
❖ Window:- this is the element that display the information on the
screen.
❖ It is very easy to manipulate a window…which can be opened or
closed with the click of an icon….
❖ Menu: contain list of choices and it allows users to select one from
them
❖ Icons:-
❖ Files programs , web pages can be represented using a small
picture in a graphical user interface.
❖ Controls
❖ Tabs
System calls
❖ A system call is a procedure that provides the interface between a
process and the operating system. It is the way by which a
computer program requests a service from the kernel of the
operating system.
❖ A system call is a way for programs to interact with the operating
system.
❖ A computer program makes a system call when it makes a request
to the operating systems kernel
❖ System call provides the services of the operating system to the
user programs via application program interface (API)
❖ System call provides the services of the operating system to the
user programs via API
Types of System calls

❖ System calls are divided into 5 categories mainly


• Process Control
• File Management
• Device Management
• Information Maintenance
• Communication
❖ Process Control :
❖ This system calls perform the task of process creation, process termination, etc.
❖ The Linux System calls under this are fork() , exit() , exec().
Types of System calls
❖ File Management :
❖ File management system calls handle file manipulation jobs like creating a file, reading, and writing, etc.
The Linux System calls under this are open(), read(), write(), close().
• open():
• It is the system call to open a file.
• This system call just opens the file, to perform operations such as read and write, we need to execute
different system call to perform the operations.
• read():
• This system call opens the file in reading mode
• We can not edit the files with this system call.
• Multiple processes can execute the read() system call on the same file simultaneously.
• write():
• This system call opens the file in writing mode
• We can edit the files with this system call.
• Multiple processes can not execute the write() system call on the same file simultaneously.
• close():
• This system call closes the opened file.
Types of System calls

❖ Device Management :
❖ Device management does the job of device manipulation like reading
from device buffers, writing into device buffers, etc. The Linux System
calls under this is ioctl().
❖ ioctl():
❖ ioctl() is referred to as Input and Output Control.
❖ ioctl is a system call for device-specific input/output
operations and other operations which cannot be
expressed by regular system calls
•.
Types of System calls

❖ Information maintenance:
❖ These system calls handle information and its transfer
between the operating system and the user program
❖ Communication:
❖ These system calls are useful for interposes communication
. They also deal with creating and deleting a
communication connection.
FEATURES OF LINUX

❖ Linux is an operating system for PC computers and workstations that


now
❖ Linux is a family of open source linux…..
❖ Linux is an operating system or Kernel . It is distributed under an
open source license.
❖ The Unix-based operating system was implemented and conceived in
1969 at AT&T's Bell labs by Joe Ossanna, Douglas Mcllroy, Dennis
Ritchie, and Ken Thompson in the United States. First published in
1971
INTRODUCTION TO LINUX OPERATING SYSTEM
Multiuser capability: Multiple users can access the same system resources like
memory, hard disk, etc. But they have to use different terminals to operate.
Multitasking: More than one function can be performed simultaneously by dividing
the CPU time intelligently.
Portability: Portability doesn't mean it is smaller in file size or can be carried in pen
drives or memory cards. It means that it support different types of hardware.
Security: It provides security in three ways namely authenticating (by assigning
password and login ID), authorization (by assigning permission to read, write and
execute) and encryption (converts file into an unreadable format).
Live CD/USB: Almost all Linux distros provide live CD/USB so that users can run/try it
without installing it.
Graphical User Interface (X Window system): Linux is command line based OS but it
can be converted to GUI based by installing packages.
Support's customized keyboard: As it is used worldwide, hence supports different
languages keyboards.
ARCHITECTURE OF THE LINUX
❖ It represents the concept of an entire system
❖ They described how disks are accessed , how memory is handled, how the
boot process is defined
ARCHITECTURE OF THE LINUX
❖ 1.kernel :- is the core part of the operating system, which is
responsible for all the major activities of the LINUX OS.
❖ Kernel offers the required abstraction to hide application progrmas or
low –level hardware details to the system…
❖ Types of kernel
o Micro kernel
o Exo kernel
o Hybrid kernels
ARCHITECTURE OF THE LINUX
❖ 2.System Libraries:- are special functions.
❖ That are used to implement the functionality of the OS and do not require code
access rights of kernel modules.
❖ 3. system utility :- programs are liable to do individual and specialized-level tasks
❖ 4. Hardware:- layer of the Linux OS consist of peripheral devices such as RAM,
HDD,CPU…etc.
❖ 5.Shell:- is an interface between the user and the kernel and it afford services of
the kernel.
❖ It takes commands from the user and executes kernel functions.
❖ The shell is present in different types of operating system, which are classified into
two type command line shells and graphical shells
INTRODUCTION TO FILE SYSTEM & PROCESS ENVIRONMENT
❖ 1. FILE SYSTEM:-
❖ A files system is the way in which files are named, stored, retrieved as well as
updated on storage disk or partition , the way files are organized on the disk.
❖ A file system is divided in two segments called: user data and Metadata(file
name, time it was created , modified time , its size and location in
the directory hierarchy.
❖ Linux system is capable of handling any number of storage devices.
❖ Linux directory structure is starting from root/or top…
❖ A specific type of data storage format , such as EXT3, EXT4, XFS and so on.
❖ A partition or logical volume formatted with a specific type of file system
that can be mounted on a specified mount point on linux file
system.
INTRODUCTION TO FILE SYSTEM & PROCESS ENVIRONMENT
❖ 2. Process Environment
❖ A process is a program execution
❖ It has five components process id, data , stack , CPU state .
❖ The process uses the CPU when it is scheduled .
❖ It also uses other resources
❖ These include system resource like memory and user – created resources like
files
❖ The OS view of a process consist of two parts …..
❖ Code and data areas of process including its stack and resourced allocated
❖ Information concerning program execution
❖ It consist of process environments and its process control block (PCB)
❖ Process environments also called the process context, the process environments contain
address space
❖ The OS create a process environments by allocation memory to the process
Working with linux

❖ Basics of Linux:-
❖ Linux is a free version of unix. The free part is not meat in money
terms but rather that the source code for linux is freely available
for inspection and modification.
❖ Linux is a multitask and multiuser operating system.
❖ A multitask OS is capable of doing several tasked at the same time.
❖ A multiuser OS is a computer system that allow multiple users that
are on different computer to access single systems as resources
simultaneously.
THE LOGIN PROMPT

❖ A console is an all-text display mode that occupies the entire


display monitor screen.
❖ Login is used when signing onto a system. If no argument is
given , login prompts for the user name.
❖ The login program is used to establish a new session with the
system.
❖ The user is then prompted for password, where appropriate .
General features of command/Command structure

❖ command History : History option enables TL1 agent to record all


the commands which are executed in history list.
❖ Command completion: Typing a lterr (staring letter of the command)
and processing Tab key completes the TL1 command code.
❖ Command line editing: commands can be edited from command line
using arrow key
❖ List of commands: pressing “?” lists all the commands available for
accessing the agent.
❖ Complete command syntax: typing a command and pressing Tab
key lists the complete command along with the usage for the
command
General features of command/Command structure

❖ Linux commands:
o File management and viewing
o File system management
o Network management
o System management
o Printing and programming
o Process managenment
Command structure

❖ Commands [options][parameters]
o Multiple commands separated by ; can been executed one after the
other .
o There can be more than one option and parameter for single
command.
o For instance we used a cd…. Command to go to previous directory.
o Dots …… are nothing more than parameters.
o Lets see what parameters we have with ls commands

You might also like