You are on page 1of 32

LECTURE 8

OPERATING SYSTEMS
Outline

• Operating System (OS)


– Processes
– Memory Management
– Security
• Unix / Linux
– Utilities
– File system

BTECH2306 COMPUTER ARCHITECTURE 2


Operating System (OS)
• The OS is the most important program that runs on a
computer.
• OS is an interface between computer and user.
• It is responsible for the management and coordination
of activities and the sharing of the resources of the
computer.
Operating System (OS)

BTECH2306 COMPUTER ARCHITECTURE 4


Operating System (OS)

BTECH2306 COMPUTER ARCHITECTURE 5


Operating System (OS)
• Is a low-level software that schedules task, allocates
storage, and handles the interfaces to peripheral
hardware.
• Has two main parts:
– Kernel – allocates machine resources to other
programs that runs on the computer.
– System programs – performs higher-level
housekeeping task, often acting as server in a
client/server relationship.
OS Objectives and Functions

• Convenience
– Making the computer easier to use
• Efficiency
– Allowing better use of computer resources
Operating System Services

• Program creation
• Program execution
• Access to I/O devices
• Controlled access to files
• System access
• Error detection and response
• Accounting
O/S as a Resource Manager
O/S as a Resource Manager

• Resource management functions of an OS allocates


computer resources such as CPU time, main memory,
secondary storage, and input and output devices for use.
• Resource management comprises multiplexing (sharing)
resources in two different ways: in time and in space.
• When a resource is time multiplexed, different programs
or users take turns using it. First one of them gets to use
the resource, then another, and so on.

BTECH2306 COMPUTER ARCHITECTURE 10


O/S as a Resource Manager

• Example of time multiplexing


– Sharing the printer.
• When many print jobs are queued up for
printing on a single printer, a decision has
to be made about which one is to be
printed next.

BTECH2306 COMPUTER ARCHITECTURE 11


Types of Operating System

• Interactive
• Batch
• Single program (Uni-programming)
• Multi-programming (Multi-tasking)
Types of Operating System

• Interactive
An interactive operating system is one that allows the user to
directly interact with the operating system whilst one or
more programs are running.
There will be user interface in place to allow this to happen. It
could be a command line style of interface or it could be a
graphical interface.
Types of Operating System

• Batch
• The users of a batch operating system do not interact with the
computer directly. Each user prepares his job on an off-line
device like punch cards and submits it to the computer
operator. 
• To speed up processing, jobs with similar needs are batched
together and run as a group.
Types of Operating System

• Batch
• The problems with Batch Systems are as follows −
– Lack of interaction between the user and the job.
– CPU is often idle, because the speed of the mechanical I/O
devices is slower than the CPU.
– Difficult to provide the desired priority.
Types of Operating System

• Multi-programming (Multi-tasking) vs Single program (Uni-


programming)
– A multi-programming OS allows multiple users to access a computer
system concurrently.
– Time-sharing system can be classifies as multi-user systems as they
enable a multiple user access to a computer through the sharing of time.
– Single-Program OS , as opposed to a multi-programming OS, are
usable by a single user at a time.
Types of Operating System

• Multi-programming (Multi-tasking) vs Single program (Uni-


programming)
– When a single program is allowed to run at a time, the system is
grouped under a single-tasking system.
– While in case the OS allows the execution of multiple tasks at one time,
it is classified as s multi-tasking OS.
Early Systems

• Late 1940s to mid 1950s


• No Operating System
• Programs interact directly with hardware
• Two main problems:
– Scheduling
– Setup time
Simple Batch Systems

• Resident Monitor program


• Users submit jobs to operator
• Operator batches jobs
• Monitor controls sequence of events to process batch
• When one job is finished, control returns to Monitor which
reads next job
• Monitor handles scheduling
Memory Management

Kernel Memory Allocator (KMA)


• A subsystem that tries to satisfy the requests for memory
areas from all parts of the system.
– Some requests come from other kernel subsystems needing memory
for kernel use.
– Some requests come via system calls from user programs to increase
their processes’ address space.

BTECH2306 COMPUTER ARCHITECTURE 20


Memory Management

Kernel Memory Allocator Goals


• Minimize the amount of wasted memory.
• Reduce memory fragmentation problem.
• Cooperate with other memory management subsystems.

BTECH2306 COMPUTER ARCHITECTURE 21


Memory Management
• Memory layout for
Resident Monitor
Process Management
• Five state Process Model
Process Control Block
• Identifier
• State
• Priority
• Program counter
• Memory pointers
• Context data
• I/O status
• Accounting information
Process Control Block

• Process Control block is used for storing the


collection of information about the Processes
and this is also called as the Data Structure
which Stores the information about the
process. The information of the Process is used
by the CPU at the Run time.

BTECH2306 COMPUTER ARCHITECTURE 25


Process Control Block
• The various information which is Stored into the PCB as
followings:
1. Name of the Process.
2. State of the Process. Means Ready, Active, Wait.
3. Resources allocated to the Process
4. Memory which is provided to the Process.
5. Scheduling information.
6. Input and Output Devices used by the Process.
7. Process ID or a Identification Number which is given by the CPU when a Process
Request for a Service.

BTECH2306 COMPUTER ARCHITECTURE 26


PCB Diagram
Linux Platform
• Linux is not just for Intel-based platforms but has been ported to
and runs on the following machines:
– Power PC
– Apples (ppclinux),
– Compaq (nee DEC) Alpha-based machines,
– MIPS-based machines,
– Motorola 68K-based machines,
– IBM S/390.

BTECH2306 COMPUTER ARCHITECTURE 28


Linux
Layered View of Linux Operating System

BTECH2306 COMPUTER ARCHITECTURE 29


Linux Utilities
• Linux comes with thousands of utilities that perform myriad
functions such as:
– ls: list the names of files
– cat: displays a text file
– rm: deletes a file
– hostname: displays your machine name
– cp: copies a file
– echo: displays text
– script: records a Linux session
– gzip: compresses a file

BTECH2306 COMPUTER ARCHITECTURE 30


Linux Filesystem
Family Structure

BTECH2306 COMPUTER ARCHITECTURE 31


Linux Filesystem
Linux Filesystem Structure

BTECH2306 COMPUTER ARCHITECTURE 32

You might also like