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

Chapter 1

Uploaded by

Ayano Boresa
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)
16 views

Chapter 1

Uploaded by

Ayano Boresa
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/ 45

OPERATING SYSTEM

Hawassa university
Bensa Daye Campus
Department of Computer science

Cosc3023: Operating Systems


Prerequisite: Computer Arc. & Org.
Compiled By: Kassawmar M.

1
Chapter One
___________________________
Introduction to Operating Systems

2
Outline
 Introduction
 Why Study Operating Systems
 The history of Operating System
 Types of operating systems
 Function of Operating System
 Role of operating systems
 Operating Systems Structure
 Computer System Organization
 Interrupts in Operating System
 Concurrency and its importance
 The purpose and role of OS in computer engineering

3
Introduction
 The Operating System is a program that acts as an intermediary
between a user of computer and the computer hardware.
 A every modern computer consists of:
• One or more processors
• Main memory
• Disks
• Printers
• Various input/output devices
 Managing all these components requires a layer of software called
operating system.
 A software that abstracts the computer hardware
• Hides the messy (unnecessary) details of the underlying hardware.
• Presents users with a resource abstraction that is easy to use.
• Extends or virtualizes the underlying machine.
4
Cont...
 Responsible for allocating resources for users and
processes.
• Should ensure that no starvation, allocation is based on desired
policy( like FCFS) and efficient system utilization.
 Most computers have two modes of operation:
• Kernel mode and user mode
 OS runs in kernel mode, which has complete access to
all hardware and can execute any instruction
 Rest of software runs in user mode, which has limited
capability.
 Shell or GUI is the lowest level of user mode software.

5
Cont..

Figure 1-1. Where the operating system fits in.


6
Cont...

Figure 1-2. User and kernel mode of operations in OS. 7


Cont.…

Figure 1-3. Architecture of operating system in Linux. 8


Why Study Operating Systems?

 OS manages concurrency.
• The ability to execute more than one program or task simultaneously
• Concurrency leads to interesting programming challenges.
 OS manages hardware.
• Programming hardware is challenging: timing dependent behavior,
undocumented behavior, hardware bugs.
• Allows the computer hardware to be used in an efficient manner.
 OS fails machine fails.
• OS must fail less than user programs.
 OS provides services that enable application programs
• Make the computer more convenient to use.
 OS basis of system security.
• Allow only authorised access to data, computation, services, etc.
 OS providing an interface to the users.
9
History of Operating Systems
 The first true digital computer was designed by Charles Babbage (1792-
1871). however, the analytical engine didn’t have an operating system.
 Operating system have been evolving over the years.
 Generations:

10
10
Cont…
I. First Generation(1945–55) Vacuum Tubes
 When electronic computer were first introduced in 1940’s.
 Mechanical components are replaced by electronic component
(Vacuum Tubes).
 Computers with out operating system.
 The actual operation were took place with out the benefit of OS.
 During this generation computers were generally used to solve
simple mathematical calculations.
 Programs were written in machine language.
 The application program were run one at a time.
 The system was inefficient and depends on programmer competency.

11
Cont..
II. 2nd Generation(1955–65) Transistors and Batch Systems
 Transistor was introduced.
 The vacuum tubes replaced by the transistors.
 CPU continued to be under utilized as sequential processing
with one job at a time was being done.
 When the computer finished whatever job it was currently
running, an operator would do many works in between to
start the next job.
 Expensive time lags between CPU and I/O devices.

12
Cont..
III. 3rd Generation(1955–65) ICs and Multiprogramming
 IC was introduced and OS allowed the machine to run many
different application.
 The computer that used ICs was created that answered
price/performance problem over the second-generation.
 IC integrated hundreds of transistors.
• Speedy and economical.
 OS designers were able to develop the system of multi-
programing, in which computers able to perform multiple tasks at
the same time.

 MULTICS (MULTiplexed Information and Computing Service)


where by one huge machine providing computing power for
hundreds of simultaneous timesharing users.
13
Cont..
 Major achievements of third generation:
• Multiprogramming
• Timesharing
IV. 4th Generation (1980-current) very large scale IC (VLSIC)

 Very LSIC was introduced which consist thousands of


transistors.
 It is user friendly.
 Cost/performance ratio improvement of computer
components.
 Multiprocessing
•Allowed parallel program execution
 Distributed processing and networked systems introduced
 Increased tighter security demands to protect hardware and
software.
14
Types of operating systems
1. Batch operating system- sequence of job in a program on a
computer without manual interventions.
 The users of batch operating system do not interact with the
computer directly.
 Each user prepares their 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. Thus, the programmers left their
programs with the operator.
 The operator then sorts programs into batches with similar
requirements.
2. Network Operating System
 Runs on a server and provides server the capability to manage data,
users, groups, security, applications, and other networking functions.
 The primary purpose of the network operating system is to allow
shared file and printer access among multiple computers in a network.

15
Cont…
3. Time-sharing operating systems
Time sharing is a technique which enables many people, located at
various terminals, to use a particular computer system at the same
time.
 Time-sharing or multitasking is a logical extension of
multiprogramming.
 Processor's time which is shared among multiple users
simultaneously is termed as time-sharing.
 The processors communicate with one another through various
communication lines (such as high-speed buses or telephone lines).
 These are referred as loosely coupled systems or distributed
systems.
4. Real-time operating systems- These systems are characterized by
having time as a key parameter.
• Fast and time limit sensitive
• Used in time-critical environments
• Example an operating system used in missile systems, space flights,
airport traffic control, industrial processes.
16
Cont…
5. Distributed operating system- manage a group of different computers
and make appear to be a single computer.
6. Mainframe operating systems-
 Mainframe computers are used for high-end Web servers, servers for
large-scale electronic commerce sites, etc...
 Hence, the operating systems for mainframes are heavily oriented
toward processing many jobs at once, most of which need
remarkable numbers of I/O.
 Nassau, Astronomers
7. Server operating systems-
 It is one level down the mainframes OS which is very large personal
computers, workstations, or even mainframes.
 It serves multiple users at once over a network and allows the users
to share hardware and software resources.

17
Cont…
8. Personal computer operating systems- Their job is to provide a
good interface to a single user. like, Window xp
9. Embedded operating systems- An OS that run on the
computers to control devices that are not generally
thought/part of as computers, such as TV sets, microwave
ovens, and mobile telephones.
10. Smart card operating systems-
 The smallest operating systems run on smart cards.
 Some of them can handle only a single function, such as
electronic payments.

18
Function/roles of operating system

The major functions of an operating System are:-


 Process Management

 Memory Management

 File Management

 Input/output management

 Networking management

 Protection system

 Command interpreter
19
Cont..
1. Process Management
 Process refers to a program in execution.
 In multiprogramming environment, OS decides which
process gets the processor when and how much time. This
function is called process scheduling.
• Operating System does the following activities for processor
management.
• Keeps tracks of process and status of process.
• Allocates the processor(CPU) to a process.
• De-allocates processor when process is no longer required.

20
Cont..
2. Memory Management
 Memory management refers to management of Primary Memory
or Main Memory.
 Main memory provides a fast storage that can be access directly by
the CPU. So for a program to be executed, it must in the main
memory.
 Each process has some set of addresses space in the main
memory that it can use.
 Operating System does the following activities for memory
management.
• Keeping tracks of the status of each location of main memory i.e. each
memory location is either free or allocated.
• Decide which process are loaded into memory when memory space
become available.
• Allocates the memory when the process requests it to do so.
• De-allocates the memory when the process no longer needs it or has been
terminated. 21
Cont…
3. File management
 A file is a collection of related information.
 A file system contain a report, an executable program or a set of
commands to the OS.
 A file system is normally organized into directories for easy
navigation and usage. These directories may contain files and other
directions.
 Operating System does the following activities for file management.
• Creating and deleting of files
• Creating and deleting of directories
• Mapping files into secondary storage
• Backing up files on stable storage media
• Transmission of files elements b/n main and secondary storage.
 The operating system is also hide the details of the disks and other
I/O devices and present the programmer with a nice, clean abstract
model. 22
Cont..
4. I/O system Management
 OS manages device communication via their respective drivers.
 Operating System does the following activities for device
management.
• Keeps tracks of all devices.
o The Program that keeps the track responsible for this task is
known as the I/O controller.
• Decides which process gets the device when and for how much
time.
• Allocates the device in the efficient way.
• De-allocates devices.

23
Cont…
5. Network Management
 Networking enables computer users to share resources and
speed up computations.
 The processors communication with one another through
various communication line. (wired or wireless)
 Convenient way for users to share resource

 Retains user access control.

24
Cont..
6. Protection/security system
 Protection mechanisms are implemented in operating system to
support various security polices.
 By means of password and similar other techniques, preventing
unauthorized access to programs and data.

7. Command interpreter system


 Operating System does the following activities for
 Provides the facilities to create, modification of program and data
files using an editor.
 Access to the compiler for translating the user program from high
level language to machine language.
 Provide a loader program to move the compiled program code to the
computer’s memory for execution.
25
Goal of Operating System
 Execute user programs and make solving user problems easier.
 Make the computer system convenient to use.
 Use the computer hardware in an efficient manner.

Virtual Machine Interface

Operating System

Physical Machine Interface


26
Operating System Structure
 General-purpose OS is very large program. Therefore, need to
be structured well especially, how they structure functionality
relative to protection boundaries.

 The most commonly used OS structures includes:


• Simple structure (monolithic)

• Layered

• Microkernel

• Module

• Hybrid
27
Cont..
1. Monolithic systems – basic structure:
• The entire kernel is run as a single privileged entity.
• Functionality can be broken up into modules but the modules’ code is
highly integrated.
• The operating system is formed from individual procedures,
and then binds them all together into a single object file using
the system linker.
• The organization suggests a basic structure for the operating system:
 A main program that invokes the requested service procedure.
 A set of service procedures that carry out the system calls.
 A set of utility procedures that help the service procedures.

28
Cont…

Figure 1-5. A simple structuring model for a monolithic system.

29
Cont..
2. Layered Approach
• The operating system is divided into a number of layers
(levels), each built on top to lower layers.
• The bottom layer (layer 0), is the hardware; the highest (layer
N) is the user interface.
• Each layer provides a different type of functionality.

Figure 1-6. A Structuring model for a


Layered approach.

30
Cont..
3. Microkernel System Structure

• Moves as much from the kernel into user space.

• Communication takes place between user modules using


message passing.

• Easier to extend a microkernel.

• More reliable and secure (less code is running in kernel


mode).

• Example of microkernel is Mac OS X kernel (Darwin)

31
Cont..
Application File Device user
Program System Driver mode

messages messages

Interprocess memory CPU kernel


Communication managment scheduling mode

microkernel

hardware

Figure 1-7. Microkernel System Structure.

32
Cont.…
4. Modules
 The operating systems implement loadable kernel
modules.

• Uses object-oriented approach.

• Each core component is separate.

 Overall, similar to layers but with more flexible.

33
Cont..
5. Hybrid Systems
 Most modern operating systems are actually not one pure model.
 Hybrid combines multiple approaches to address performance,
security, and usability needs.

 Linux and Solaris kernels in kernel address space, so monolithic


plus modular for dynamic loading of functionality.

 Windows mostly monolithic plus microkernel.

34
Computer System Organization
 Computer-system operation
• One or more CPUs, device controllers connect through common
bus providing access to shared memory.
• Concurrent execution of CPUs and devices competing for memory
cycles.
• Basic computer components:-

35
Cont…
Basic Elements:
 Processor- Performs computations
 Main Memory
• Volatile
• Referred to as real memory or primary memory
 I/O modules
• Secondary memory devices
• Communications equipment
• Terminals
 System bus
• Communication among processors, memory, and I/O modules.
• Load the data from CPU to memory or vice versa via
system bus
36
Interrupt in operating system
 An interrupt is a signal from a device attached to a computer or
from a program within the computer that requires the operating
system to stop and figure out what to do next.
 Signals that cause an interruption/stop to the normal sequence
of execution.
 After the interrupt signal is sensed, the computer either
resumes running the current program or begins running
another program.
Classes of Interrupts:
 Program exceptions (also called synchronous interrupts)
– Arithmetic overflow
– Division by zero
– Executing an illegal/privileged instruction
– Reference outside user’s memory space.

37
Cont..
 Asynchronous (external) events
– Timer
– I/O
– Hardware or power failure

38
Cont..
Interrupt Handler:
• A software routine that determines the nature of the interrupt
and performs whatever actions are needed.
• The handler is generally part of the operating system.

• During an interrupt occurs the software routine:


– Preserves the state of the CPU.
– Determines which type of interrupt has occurred:
– Calls an appropriate routines.
• Separate segments of code determine what action should be taken
for each type of interrupt.

39
Concurrency and its importance

• Concurrency is the execution of the multiple


instruction sequences at the same time.

• It happens in the operating system when there are


several process threads running in parallel.

• It helps in techniques like coordinating execution of


processes, memory allocation and execution
scheduling for maximizing throughput.

40
The purpose of OS in computer engineering

 OS services provides functions that are helpful to the user.


 Some of the purpose and role of OS in computer engineering
are:-
 Program execution - The system must be able to load a program into
memory and to run that program, end execution, either normally or
abnormally (indicating error)
 I/O operations - A running program may require I/O, which may
involve a file or an I/O device.
 File-system manipulation – programs need to read and write files
and directories, create and delete them, search them, list file
Information, permission management.
• These operations are managed by the operation system.

41
Cont…
 Communications – Processes may exchange information, on the
same computer or between computers over a network
• Communications may be via shared memory or through message
passing (packets moved by the OS).
 Error detection – OS needs to be constantly aware of possible errors
may occur in the CPU and memory hardware, in I/O devices, in
user program.
• For each type of error, OS should take the appropriate action to ensure
correct and consistent computing
 Resource allocation - When multiple users or multiple jobs
running concurrently, resources must be allocated to each of them.
• Many types of resources - CPU, main memory, file storage, I/O
devices.

42
Cont…
 Protection and security
• The Operating System is responsible for using all the
information and resources available on the machine in the most
protected way.
• Allow only authorised access to data, computation, services, etc.
• Involves ensuring that all access to system resources is
controlled.
 Accounting: The Operating System tracks an account of all
the functionalities taking place in the computer system at a
time.
– All the details such as the types of errors occurred are recorded
by the Operating System.

43
Group Assignments
Some commonly used operating system:-
1. Window OS
2. Unix OS
3. Linux OS
Overview OS, introduction about the
4. Mac OS given OS, Basic features, Development
or type (Version), Architecture, cost
5. Android OS Application/ function, Pros and cons of
it( the given OS).
6. Solaris OS
7. iSo OS
8. Debian OS

44
1
-
4 45
5

You might also like