Operating Systems Chapter One: 1 - The Digital Computer & Its Organization
Operating Systems Chapter One: 1 - The Digital Computer & Its Organization
Operating Systems Chapter One: 1 - The Digital Computer & Its Organization
Chapter One
citemhtirA/
tinU lacigoL
)Central Processing Unit (CPU
tuptuO
s)tinU tupnI) tinU lortnoC
s)tinU)
yromeM niaM
(Level 2 Cache (On the motherboard between the CPU and main memory
2
:The Software 1.2
All the programs used by the computer. Any program consists of a set of instructions
written in a certain computer language and performs a specific task. The software consists of
:two parts
:a. The system software
which are the programs that controls the operation of the computer like ROM programs
.(BIOS and POST programs), operating systems
:b. Application software
which are the programs that help to carry out various tasks by the computer like MS Word,
… ,PowerPoint, Excel, Internet Explorer, Adobe reader, Access
2. Assembling a PC System
The chart below shows the different levels of the computer software and their link with the
computer hardware:
3
APPLICATION PROGRAMS
COMPILERS EDITORS COMMAND INTERPRETER
SYSTEM PROGRAMS
OPERATING SYSTEM
BIOS
HARDWARE
Each higher level computer software requests services from a lower level software using a set
of subroutines ( subprograms) called Interfaces. The chart below shows the different levels of
the computer software and types of interfaces between them.
APPLICATION PROGRAMS
OPERATING SYSTEM
ecafretnI dradnatS
BIOS
ecafretnI dradnatS-noN
HARDWARE
A Non-Standard Interface: an interface program that depends on the type of hardware and
differ from a system to another and from a hardware to another.
4
- Human Operator
- OS/360
- MULTICS
- UNICS - Later UNIX
- DOS - IBM PC-DOS, MS-DOS
- MS-WINDOWS
- LINUX
- Sun Solaris
- IBM OS/2
- Mac OS X Tiger, Mac OS X Leopard
- Novell Netware, WINDOWS Server
- WINDOWS Mobile
- WINDOWS XP
- WINDOWS VISTA
b. Functions provided by the operating system for the efficient operation of the system
(in case of multi-users). These functions are:
- Resource allocation ( for printers, files…).
- Accounting ( user account which includes all information that defines a user on
a network like user name, password, rights and permissions to access resources.)
- Protection (controlling the access of users and processes to computer
resources).
5
7.1 Memory Management:
It is the part of the OS that manages computer memory. It is responsible for:
- Keeping track of memory space , which is in-use and which is not-in-use.
- Allocating and de-allocating of memory for different processes.
- Swapping of processes between Main Memory and Hard Disk.
The addresses in the user source program are generally symbolic addresses (like the
variable names x, y, count,.. ).
The compiler translates the source program into an object module. During compiling
(during compile time), the compiler binds these symbolic addresses to relocatable
addresses which are logical (virtual) addresses generated by the CPU. So, during
compile time both logical and physical addresses are the same.
When the program is loaded into memory for execution, these logical addresses are
converted to physical ( absolute or actual) memory addresses. So, during run time the
physical and logical addresses are different.
The run-time mapping from logical (virtual) to physical addresses is done by a
hardware device called the Memory-Management Unit (MMU). The figure below
shows a simple MMU scheme.
NOITACOLER
RETSIGER
LACIGOL LACISYHP
SSERDDA SSERDDA
UPC + YROMEM
6
7.1.2 Swapping
It is a memory management scheme performed by the operating system. By swapping
different processes are swapped between the main memory and the hard disk. This operation
is usually used in multiprogramming and multitasking operating systems. When a process has
just finished, it will be swapped out of the main memory to the hard disk. Then another
process will be swapped in from the hard disk to the main memory space that has just been
freed.
operating
system
1 out
swap process
P1
2
ni paws process
P2
user
space
main memory disk storage
8. Virtual Memory
In this technique, part of the storage space of the hard disk is used so that it appears like
it is a part of the main memory.
The operating system keeps the parts of the program that is currently in use in the main
memory, and the rest in the hard disk. The pieces of the program are continuously
swapped between the main memory and the hard disk.
Applying virtual memory provides the following advantages:
7
1. It allows the execution of a process even if it is not completely in the main memory.
2. It enables the user to run programs that are larger than the actual (physical) memory,
thus freeing the programmer from the concern over memory-storage limitation.
3. It allows processes to easily share files and address spaces.
4. More programs can be run at the same time, since each user program could take less
physical memory. So, this technique is very useful in multiprogramming operating system.
5. Since more programs can run at the same time, this will increase CPU utilization and
throughput with no increase in response time.
1. Overlays
This method is no more used. The program will be split into pieces called
overlays. Each overlay consists of data and instructions. After running the first
overlay, it will call the second overlay. The second overlay will be loaded in the
same previous memory space. The overlays are kept on the disk and swapped in
and out of memory by the operating system as needed. But, it is the
responsibility of the programmer to split the program into pieces. This
operation is a boring and time consuming.
2. Dynamic Loading:
In this method all routines of the program are kept on the hard disk in a
relocatable load format. The main program is loaded into memory and
executed. When a routine in called, it will be loaded into memory from the hard
disk. Also, it is the responsibility of the programmers to design their programs
to take advantage of this method.
3. Demand Paging
This is the most common method of implementation of virtual memory. It is
implemented in many modern operating systems such as Windows XP.
In demand paging a process (a program) is divided into pages. The entire pages
of the process are kept in the hard disk. Whenever any page or number of pages
are demanded, they will be swapped to the main memory from the hard disk
and other pages that are not needed will be swapped out of memory to the hard
disk.
8
9.2 Multiprogramming Operating Systems :
These operating systems were also used in old Mainframe computer systems.
The multiprogramming operating system keeps a number of jobs in memory at the same
time. These jobs can be a subset of the total jobs that enter the system which are kept in
a job pool. The operating system picks and begins to execute one of the jobs in
memory. When this job needs to wait for some task to complete, like an input/output
operation, the operating system will switch to execute another job. This requires an
operations called job Scheduling. Also, it requires memory management.
Multiprogramming organizes the jobs, so that the CPU has always one to execute. The
system will be more efficient since one user can not keep the CPU and I/O devices busy
all the time.
The main disadvantage of multiprogramming operating systems is that they do not
provide for the user interaction.