Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Operating Systems Chapter One: 1 - The Digital Computer & Its Organization

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 9

Operating Systems

Chapter One

:The Digital Computer & Its Organization .1


It is a digital electronic data-processing system. It consists of both hardware and software.
Data is input to the computer, processed within it and the result will be a more useful
.information which either output or stored for later use

:The hardware 1.1


.It is all the electrical, electronic and mechanical parts of the computer
:All computers consist from the following main parts

citemhtirA/
tinU lacigoL
)Central Processing Unit (CPU

tuptuO
s)tinU tupnI) tinU lortnoC
s)tinU)

yromeM niaM

egarotS) yromeM yrailixuA)

:(Input Unit(s 1.1.1


Used to input data, programs and commands to the computer. Ex: Keyboards, mouse,
.scanners

:(The Central Processing Unit( CPU 1.1.2


:It acts as the brain of the computer. It is responsible for
.Executing all the programs and commands -
.Performing all the arithmetic, logical and data-processing operations -
.Controlling almost all parts of the computer -
:The CPU consists of two main parts
a. The control unit, which is responsible for executing programs and commands and
.controlling computer parts
b. The Arithmetic/Logic Unit (ALU), which is responsible for performing all the arithmetic
.and logical operations
In recent computers the CPU is usually a microprocessor which is a semiconductor IC
manufactured using LSI, VLSI or SLSI ( Super LSI) technology like Pentium IV, Pentium
1
.Celeron, Pentium Centrino, Pentium Dual-Core, AMD Ath1on

:(Output Unit(s 1.1.3


Used to output the information that result from data processing by the CPU. Ex: printers,
.screens

:The Memory 1.1.4


Used to store programs, data and results of operations. The memory is organized in a number
:of levels. Two of the important levels are
:a. The main (primary) memory
It consists of a number of semiconductor Integrated Circuits(ICs) and has a limited storage
capacity, but it is too fast and directly accessible by the CPU . The main memory consists of
:two parts
Read-Only Memory (ROM): It is a non-volatile memory which holds the basic -
.instructions needed to start the computer
Random Access Memory (RAM): It is volatile memory which stores the programs -
.currently running by the computer and their data and results

:(b. The Auxiliary (Secondary) Memory (Storage


External non-volatile memory used for permanent storage of data and programs. It has a very
large storage capacity, but it is slower than the main memory and not directly accessible by
.the CPU . Ex: Hard Disks

:Other levels of memory are


1. High- speed registers ( inside the CPU).
2. Cache memory: which is a very high-speed memory between the CPU and
main memory. It is used to improve the computer system performance and it is in two
levels: Level 1 (L1) cache which is integrated within the CPU and Level 2 (L2) which
is located on the motherboard.
3. Tertiary Memory: which is a low-cost, low-speed, huge storage capacity and
removable like FD, CD and DVD.

:The chart below shows the levels of memories in any computer


(High-Speed Registers (inside the CPU

(Level 1 Cache (inside the CPU

(Level 2 Cache (On the motherboard between the CPU and main memory

(Main Memory (RAM and ROM

(Auxiliary (Secondary) Memory (Hard Disk

(Tertiary Memory (FD, CD and DVD

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

Components and Peripherals in a Microcomputer / PC


1. System Unit
- Case / Chassis
- Power Supply
- The Motherboard / System Board / Main Board
- Microprocessor / Processor / Central Processing Unit (CPU)
- Memory – RAM
- Disk Drives – HDD, FDD, CDD, DVDD
- Video / Graphics Card / Adapter
- Sound Card
- Modem / Network Card
2. Keyboard
3. Mouse
4. Monitor / Display
5. Speakers, Microphone / Headphone

3. What is an Operating System?


The operating system is the fundamental system software of all computers. It provides
an interface between the computer user and computer hardware. It also controls all the
resources of the computer. It provides the base upon which application programs can be
written and/or executed. We can say that the primary goal of an operating system is to
make the computer system convenient to use and the secondary goal is to use the
computer hardware in an efficient manner.

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

4. BIOS (Basic Input Output System):


It is also known as device drivers or simply drivers. It is the core set of control software
which drives (operates and controls) the hardware devices in the system directly. So,
BIOS represent the link between the hardware and the operating system in a computer
and the operating system uses these drivers to communicate with the various hardware
and peripherals in the system. BIOS consists of:
- The Motherboard BIOS.
- The adapter card BIOS's.
- The device drivers loaded into RAM from the hard disk during boot-up

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

(Standard Interface (API

OPERATING SYSTEM
ecafretnI dradnatS

BIOS

ecafretnI dradnatS-noN

HARDWARE

A Standard Interface: a standard routine (subprogram) used by a software to request a from


another software.

API (Application Programming Interface): a set of standard routines used by an


application program to request and carry out lower-level services performed by the operating
system.

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.

5. HISTORY of Operating Systems:

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

6. Operating System Functions (Services):


Any operating system provides two major types of functions (services):
a. Functions provided by the operating system for the convenience of the programmer
and to make the programming task easier. The functions are:
- Program execution.
- IO operations (Accessing I/O devices, management of I/O operations and
devices like printers scanners, keyboards ).
- File System manipulation ( create, delete, open and close files, read and write to
files ).
- Error detection (including internal and external hardware errors like memory
error and device failure, also, a variety of software errors such as a division-by-zero
and inability of operating system to grant the request of an application.

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).

7. Operating System Components (parts):


Many Modern operating systems consist of the following components (parts):
- Process Management
- Memory Management
- File Management
- IO-System Management
- Networking
- Protection System
- Command-Interpreter System

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.

7.1.1 Address Binding:


Usually a program resides on a disk as a binary executable file. To be executed, the
program must be brought into memory and placed into a process. So, both the code
and data of the program must be given physical ( absolute or actual) memory addresses
by a process called address binding. Most operating systems allow a user process to
reside in any part of the physical memory.
A user program will go through several steps as shown below:

ecruoS / relipmoC tcejbO & rekniL etucexE


margorP relbmessA eludoM redaoL eludoM

emiT elipmoC( ) daoL( emiT ) nuR(emiT )


sserddA cilobmyS sserddA elbatacoleR sserddA etulosbA

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

Physical Address = Relocation Register Address + Logical Address

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

7.1.3 Methods of Memory Management


There are many methods (schemes) used by the operating system for implementing
Memory Management, so that the main memory will accommodate both the operating
system and various user processes. These methods are:
1. Contiguous Memory Allocation
In this method each process is allocated a single contiguous section of memory.
2. Paging
By this memory management scheme a process has a noncontiguous physical
address space (a process is allocated a physical address whenever it is
available). Paging involves breaking physical memory into fixed-sized blocks
called frames and breaking logical memory of the process (program) into blocks
of the same size called pages. When a process is to be executed, its pages are
loaded from the hard into any available memory frames.
3. Segmentation
In this memory management scheme the logical address space is divided into a
number of segments. Each segment has a length and a name (like code segment,
data segment, stack segment, etc..).
4. Segmented Paging
5. Paged Segmentation

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.

Methods of Implementation of Virtual Memory

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.

9. Types of Operating Systems

9.1 Batch Operating Systems


These operating systems were used in old Mainframe computer systems. In batch
systems jobs of similar needs were batched together and run as a group without any
interaction from user. The CPU would be idle most of the time because the IO systems
were very slow. Also, there were no time constraints in these operating systems.

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.

9.3 Timesharing (Multitasking) Operating Systems :


With these operating systems the CPU executes multiple jobs (processes) by switching
among them. The switching occurs so frequently that the user can interact with the
program while it is running. The interaction can be through a mouse or a keyboard.
Timesharing operating systems allow many users to share the computer simultaneously,
so, they are multi-user operating systems and each user has at least one executing
program ( a process) in memory.
Timesharing systems use CPU scheduling, where the CPU divides its time among
different processing running at the time. Also, in these systems if the processes don’t fit
in memory, the operating system uses swapping to moves processes in and out of
memory. So, virtual memory technique is usually used with timesharing operating
systems.

9.4 Desktop Operating Systems :


These operating systems are use in desktop PCs. In old PCs operating systems were
neither multi-user nor multitasking. Microsoft Windows operating systems are
timesharing operating systems. When Microsoft Windows are run on servers they will
be multiuser and multitasking systems. Also, Apple Macintosh operating system,
MacOS X, is a multitasking system.

9.5 Real-time Systems :


These operating systems are used in computers where the processing must be done within
time constraints. Such as, when computers are used to control scientific experiments or in
medical computer systems or in industrial control systems and automobile-engine fuel
injection systems.

Other Operating Systems like, Multiprocessor Systems, Distributed Systems, Network


…Systems, Clustered Systems, Handheld Systems

You might also like