OS Lecture 1
OS Lecture 1
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.
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.
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.
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.
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.
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