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

OS Lecture 1

The document provides an introduction to operating systems, defining them as programs that manage computer hardware and provide a platform for applications. It describes the components of a computer system and the role of the operating system in controlling hardware and coordinating applications. It also discusses operating system services like resource allocation, protection, and user interfaces.

Uploaded by

Mstafa Mhamad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

OS Lecture 1

The document provides an introduction to operating systems, defining them as programs that manage computer hardware and provide a platform for applications. It describes the components of a computer system and the role of the operating system in controlling hardware and coordinating applications. It also discusses operating system services like resource allocation, protection, and user interfaces.

Uploaded by

Mstafa Mhamad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Introduction to Operating

Systems

Mohammed Nasseh
2021 - 2022
What is an Operating System?
• An operating system is a program that manages the
computer hardware. It also provides a basis for application
programs.

• A program that acts as an intermediary between a user of a


computer and the computer hardware.

• A program that controls the execution of application


programs

2
Note
• Because an operating system is large and
complex, it must be created piece by piece.
Each of these pieces should be a well-defined
portion of the system, with carefully defined
inputs, outputs, and functions.

3
Computer System Structure
Computer system can be divided into four
components
1. Hardware – provides basic computing resources
CPU, memory, I/O devices
2. Application programs – define the ways in which the
system resources are used to solve the computing
problems of the users such as
Compiler, DB system, Web,…etc

4
Computer System Structure(cont)

3. Users

4. Operating system
Controls and coordinates use of hardware among
various applications for various users

5
Abstract view of the components of a
computer system

6
OS Definition
• In general, we have no completely adequate
definition of an operating system.

• Operating systems exist because they offer a


reasonable way to solve the problem of creating
a usable computing system.

• The fundamental goal of computer systems is to


execute user programs and to make solving user
problems easier. Toward this goal, computer
hardware is constructed.
7
OS Definition (cont)
• hardware alone is not particularly easy to use,
application programs are developed. These
programs require certain common operations,
such as those controlling the I/O devices.

• The common functions of controlling and


allocating resources are then brought together
into one piece of software: the operating
system.

8
OS Definition (cont)
• A more common definition is that the
operating system is the one program running
at all times on the computer (usually called
the kernel), Everything else is either a system
program (associated with the operating
system) and an application program(not
associated with the operating system ).

9
Bootstrap program
• when the computer is powered up or
rebooted, it needs to have an initial program
to run. This initial program, or bootstrap
program, tends to be simple. it is stored in
read-only memory (ROM) or electrically
erasable programmable read-only memory
(EEPROM), known by the general term
firmware, within the computer hardware.

10
bootstrap program (cont)
• The bootstrap program must know how to
load the operating system and to start
executing that system. To accomplish this goal,
the bootstrap program must locate and load
into memory the operating system kernel.

• The operating system then starts executing


the first process, such as "init," and waits for
some event to occur.

11
Interrupts
• The occurrence of an event is usually signaled by
an interrupt from either the hardware or the
software.
• Hardware may trigger an interrupt at any time by
sending a signal to the CPU.
• Software may trigger an interrupt by executing a
special operation called a system call .
• A trap is a software-generated interrupt caused
either by an error or a user request
12
Interrupts (cont)
• When the CPU is interrupted, it stops what it
is doing and immediately transfers execution
to a fixed location. The fixed location usually
contains the starting address where the
service routine for the interrupt is located.

• The interrupt service routine executes; on


completion, the CPU resumes the interrupted
computation.

13
Interrupt Vector
• The interrupt routine is called indirectly
through the table. Generally, the table of
pointers is stored in low memory (the first 100
or so locations). These locations hold the
addresses of the interrupt service routines for
the various devices.

14
Interrupt Vector (cont)
• The interrupt architecture must also save the address
of the interrupted instruction. Many old designs
simply stored the interrupted address in a fixed
location or in a location indexed by the device
number. More recent architectures store the return
address in the system stack.

15
Operating System Structure
• One of the most important aspects of operating
systems is the ability to multi programming.

• Multiprogramming needed for efficiency


– Multiprogramming organizes jobs (code and data) so
CPU always has one to execute
– A subset of total jobs in system is kept in memory
– One job selected and run via job scheduling
– When it has to wait (for I/O for example), OS switches to
another job and so on.
Memory Layout for Multi programmed
System
Multi programmed systems
• Multiprogrammed systems provide an environment in
which the various system resources (for example, CPU,
memory, and devices) are utilized effectively, but they do
not provide for user interaction with the computer system.

• Timesharing (multitasking) is logical extension in which CPU


switches jobs so frequently that users can interact with
each job while it is running.
Operating-System Operations
• A properly designed operating system must
ensure that an incorrect (or malicious)
program cannot cause other programs to
execute incorrectly.

• With sharing, many processes could be


affected by a bug in one program. For
example, if a process gets in an infinite loop,
this loop could prevent the correct operation
of many other processes.
Operating-System Operations (cont)
• More errors can occur in a multiprogramming
system, where one erroneous program might
modify another program, the data of another
program, or even the operating system itself.

• Without protection against these sorts of


errors, either the computer must execute only
one process at a time or all output must be
suspect.
Operating System Services
• One set of operating-system services provides functions that
are helpful to the user:
1. User interface.
Almost all operating systems have a user interface
(UI). This interface can take several forms. One is a
command-line interface (CLI), which uses text
commands and a method for entering them (say, a
program to allow entering and editing of
commands). Most commonly a graphical user
interface (GUI) is used. Here, the interface is a
window system with a pointing device to direct I/O,
choose from menus, and make selections and a
keyboard to enter text.
Operating System Services(cont)
2. Program execution.
The system must be able to load a program into
memory and to run that program. The program
must be able to end its execution, either normally
or abnormally (indicating error).
3. I/O operations.
A running program may require I/O, which may
involve a file or an I/O device. Therefore, the
operating system must provide a means to do
I/O.
Operating System Services(cont)
4. File-system manipulation.
The file system is of particular interest. Obviously,
programs need to read and write files and
directories. They also need to create and delete
them by name, search for a given file, and list file
information.
5. Communications.
There are many circumstances in which one
process needs to exchange information with
another process.
Operating System Services(cont)
6. Error detection.
The operating system needs to be constantly
aware of possible errors:
• Hardware( memory , power failure )
• I\O (lack of paper in printer)
• Software (arithmetic overflow)

For each type of error, the operating system should


take the proper action. Debugging facilities can
greatly enhance the user's and programmer's
abilities to use the system efficiently.
Operating System Services(cont)
• Another set of operating-system functions
exists not for helping the user but rather for
ensuring the efficient operation of the system
itself.

• Systems with multiple users can gain efficiency


by sharing the computer resources among the
users.
Operating System Services(cont)
1.Resource allocation.
When there are multiple users or multiple
jobs running at the same time, resources must
be allocated to each of them.

2. Accounting.
We want to keep track of which users use how
much and what kinds of computer resources.
Operating System Services(cont)
3. Protection and security.
o Protection involves ensuring that all access to
system resources is controlled (preventing
interfere between processes).
o Security of the system from outsiders is also
important. Each user must authenticate
himself by mean of Passwords

You might also like