Introduction to Operating System (OS)
Introduction to Operating System (OS)
• The exe contains instructions that the CPU can understand, and data of the
program (all numbered with addresses).
• Most recently used instructions and data are in CPU caches for faster access.
So, what does the OS do?
• OS manages program memory – Loads program
executable (code, data) from disk to memory.
Handheld computers are resource poor, optimized for usability and battery
life.
OS is a control program
Controls execution of programs to prevent errors and improper use of
the computer.
✓ If the power supply is good, then the BIOS (Basic Input/output System) chip
takes over. (BIOS firmware was stored in a ROM/EPROM (Erasable
Programmable Read-Only Memory) chip known as firmware on the PC
motherboard. )
✓ The MBR contains a list, or map, of all of the partitions on your computer‘s
hard disk (or disks).
✓ After the MBR is found the Bootstrap Loader follows basic instructions for
starting up the rest of the computer, including the operating system.
✓ This core includes the device drivers needed to use computer‘s RAM chips.
Computer System Organization
Computer-system operation
One or more CPUs, device controllers connect through common bus
providing access to shared memory.
After I/O starts, control returns to user program without waiting for
I/O completion
System call – request to the operating system to allow user to
wait for I/O completion.
Only one interrupt is generated per block, rather than the one
interrupt per byte.
Storage Structure
Main memory – only large storage media that the CPU can
access directly.
Random access
Typically volatile
Storage systems
organized in hierarchy
Speed
Cost
Volatility
Caching – copying
information into faster
storage system; main
memory can be viewed
as a cache for secondary
storage.
Caching
Important principle, performed at many levels in a computer (in hardware,
operating system, software).
2. Economy of scale.
Two types:
1. Asymmetric Multiprocessing
2. Symmetric Multiprocessing
Symmetric Multiprocessing Architecture
A Dual-Core Design
Clustered Systems
Like multiprocessor systems, but
multiple systems working together.
Usually sharing storage via a
storage-area network (SAN).
Provides a high-availability service
which survives failures.
Asymmetric clustering has
one machine in hot-standby
mode.
Symmetric clustering has
multiple nodes running
applications, monitoring each
other.
Some clusters are for high-
performance computing (HPC)
Applications must be written to
use parallelization.
Operating System Structure
Multiprogramming needed for efficiency
Single user cannot keep CPU and I/O devices busy at all times.
Multiprogramming organizes jobs (code and data) so CPU always has one
to execute.
When it has to wait (for I/O for example), OS switches to another job.
Timesharing (multitasking) is logical extension in which CPU switches
jobs so frequently that users can interact with each job while it is
running, creating interactive computing.
If processes don’t fit in memory, swapping moves them in and out to run.
▪ The operating system is then loaded and starts user applications in user
mode.
▪ The system always switches to user mode (by setting the mode bit to 1)
before passing control to a user program.
Timer
Timer to prevent infinite loop / process hogging resources.
A timer can be set to interrupt the computer after a specified period. by a
fixed-rate clock and a counter.
Set interrupt the computer after a specific period. The period may be
fixed (for example, 1/60 second) or variable (for example, from 1
millisecond to 1 second).
Debugging.
To execute a program all (or part) of the instructions must be in
memory.
All (or part) of the data that is needed by the program must be in
memory.
Memory management determines what is in memory and when
◦ Optimizing CPU utilization and computer response to users.
Memory management activities
◦ Keeping track of which parts of memory are currently being used
and by whom.
◦ Deciding which processes (or parts thereof) and data to move
into and out of memory.
◦ Allocating and deallocating memory space as needed.
OS provides uniform, logical view of information storage
◦ Abstracts physical properties to logical storage unit - file
◦ OS activities include
Creating and deleting files and directories.
Primitives to manipulate files and directories.
Mapping files onto secondary storage.
Backup files onto stable (non-volatile) storage media.
Usually disks used to store data that does not fit in main
memory or data that must be kept for a “long” period of time.
◦ User ID then associated with all files, processes of that user to determine
access control.
◦ Group identifier (group ID) allows set of users to be defined and controls
managed, then also associated with each process, file.
After this time interval is over OS switches over to the next task.
Advantages of Time-Sharing OS:
➢Each task gets an equal opportunity.
➢Fewer chances of duplication of software.
➢CPU idle time can be reduced.
It executes multiple jobs at the same time and makes the processing
faster.
The “ other" computers arc called client computers, and each computer that
connects to a network server must be running client software designed to
request a specific service.
popularly known as
tightly coupled systems.
Advantages of Network Operating System:
➢ Highly stable centralized servers.
➢ Security concerns are handled through servers.
➢ New technologies and hardware up-gradation are easily integrated
into the system.
➢ Server access is possible remotely from different locations and types
of systems.
The time interval required to process and respond to inputs is very small.
Real-time systems are used when there are time requirements that are
very strict like
➢ missile systems,
➢ air traffic control systems,
➢ robots, etc.
An embedded operating system is one that is built into the circuitry of an
electronic device.
Embedded operating systems are now found in automobiles, bar-code
scanners, cell phones, medical equipment, and personal digital
assistants.
Server Class
❖Windows Server
❖Mac OS X Server
❖Unix/Linux
Mobile Class
❖Android
❖iOS
❖Windows Phone
Stand-alone general purpose machines.
Emulation used when source CPU type different from target type
(i.e. PowerPC to Intel x86).
◦ Generally slowest method.
◦ When computer language not compiled to native code –
Interpretation.
VMM can run natively, in which case they are also the host
◦ There is no general purpose host then (VMware ESX and
Citrix XenServer).
Delivers computing, storage, even apps as a service across a
network.
Many types
◦ Public cloud – available via Internet to anyone willing to pay.
◦ Private cloud – run by a company for the company’s own
use.
◦ Hybrid cloud – includes both public and private cloud
components.
Many types
◦ Public cloud – available via Internet to anyone willing to pay.
◦ Private cloud – run by a company for the company’s own
use.
◦ Hybrid cloud – includes both public and private cloud
components.