Operating Systems System Administration: U. U. Samantha Rajapaksha
Operating Systems System Administration: U. U. Samantha Rajapaksha
Operating Systems System Administration: U. U. Samantha Rajapaksha
System Administration
U. U. SAMANTHA RAJAPAKSHA
M . S C . I N I T, B . S C . ( E N G I N E E R I N G ) U N I V E R S I T Y O F M O R A T U WA
SENIOR LECTURER SLIIT
S A M A N T H A . R @ S L I T. L K
Introduction
Learn the major components of the operating systems
1 Hour Tutorial
2 Hours Practical
PThreads Primer
A Guide to Multithreaded Programming
Bil Lewis Daniel J. Berg
Computer System Structure
Computer system can be divided into four components:
◦ Hardware – provides basic computing resources
◦ CPU, memory, I/O devices
◦ Operating system
◦ Controls and coordinates use of hardware among various applications and users
◦ Application programs – define the ways in which the system resources are used to solve the computing problems of
the users
◦ Word processors, compilers, web browsers, database systems, video games
◦ Users
◦ People, machines, other computers
Abstract View of Components of Computer
What is an Operating System?
An Operating System is a program that acts as an intermediary/interface between a user of a
computer and the computer hardware.
Purposes of OS:
oProvide the environment for program execution and development
o Manage the resources (CPU, memory, IO devices, hard disk, files etc..)
o Provide the access controlling (username and password)
Types of OS
User Interface of the Operating
System
OS Components
Process Management
Main-memory management
Secondary-storage management
File Management
I/O System Management
Protection System
Networking (Distributed Systems)
Command- interpreter System
13
OS Operation
In multiprogramming, OS must ensure that an incorrect (or malicious) program cannot cause other programs to
execute incorrectly.
Many programming errors are detected by the hardware, and the errors are normally handled by the OS.
Dual-mode operation
Hardware provides at least two modes of operations:
◦ User mode – in which user programs run.
◦ Monitor mode, also called Supervisor, System, or privileged mode.
Mode bit is provided by the hardware to indicate the current mode: monitor (0) or user (1).
14
OS Operation (cont.)
Dual-mode operation (cont.)
Some machine instructions that may cause harm are designated (by hardware) as privileged instructions.
◦ E.g., the MSB of the machine code of the instruction is a bit ‘1’
monitor user
Interrupt/fault
15
OS Operation (cont.)
I/O
All I/O instructions are privileged instructions.
How does the user program perform I/O ? Use system call.
◦ Usually takes the form of a trap to a specific location in the interrupt vector.
◦ Control passes through the interrupt vector to a service routine in the OS, and the mode bit is set to a monitor mode.
◦ The monitor verifies that the parameters are correct and legal, executes the request, and returns control to the instruction
following the system call.
16
OS Operation (cont.)
Memory
System must provide memory protection at least for the interrupt vector and the Interrupt Service Routine.
Use two registers that determine the range of legal addresses a program may access:
◦ Base register – holds the smallest legal physical memory address.
◦ Limit register – contains the size of the range.
17
OS Operation (cont.)
CPU
System must prevent one user program using CPU all the time
◦ Because of getting stuck in an infinite loop, or non-fair users
18
OS development (cont.)
Simultaneous Peripheral Operation OnLine (SPOOL):
Goal: To keep I/O and CPU busy all the time.
Use a faster disk as huge buffer disk was a new technology
Inputs from cards are read into disks.
CPU reads input from disks and outputs are written by CPU to disks.
The I/O of a job is overlapped with its own computation or with another job.
Need a Job Pool – data structure that allows OS to select job that runs next in order to increase CPU utilization job
scheduling
Card CPU Line
Reader Printer
Disk
19
Multiprogramming
Goal: to increase the CPU utilization
Several jobs are kept in main memory at the same time, and the CPU is
Memory partition
multiplexed among them
It needs these OS features: OS
Job scheduling OS chooses jobs in the job pool and put them into
memory. Job 1
Memory management OS allocates the memory for each job.
CPU scheduling OS chooses one among the jobs in memory (called Job 2
processes) that is ready to run.
I/O allocation. Job 3
20
Time-Sharing/Multitasking Systems
Goal: to provide interactive use of computer system at reasonable cost (one computer –
several users/jobs).
21
Real-time Systems
Well-defined fixed-time constraint – the system is functional if it returns the correct result within the
time constraint.
Hard real-time system.
Guarantees that critical tasks complete on time.
Often used as a control device in a dedicated application
controlling scientific experiments, medical imaging systems, industrial control systems, and some display systems
Secondary storage is limited or absent
data is stored in short-term memory, or in ROM.
Soft real-time system
A critical-time task gets priority over others until it completes.
Limited utility in industrial control robotics.
Useful in applications (multimedia) requiring advanced OS features.
22
Storage Structure
Magnetic Disks
23
Performance of various levels of storage
Figure 1.11 (Textbook)
24
Computer Startup
Booting Up the Computer: Booting is a process or set of operations that loads and hence starts
the operating system, starting from the point when user switches on the power button.
bootstrap program is loaded at power-up or reboot
◦ Typically stored in ROM or EPROM, generally known as firmware
◦ Initializes all aspects of system
◦ Loads operating system kernel and starts execution
User
press the Electric Power Wake
start signal Supply up
signal
buttons
CPU
CMOS
Battery
Access to fix
address
CMOS Memory FFFFF
Power ROM
on self (Firmware)
Test (BIOS)
(POST) Bootstrap Load
Load &
Result
execute the
s Pass
Bootstrap
Load
Fail
Load MBR
Generate the Beep
sound and display
the error
Hard Disk Stat OS
Computer-System Architecture
A single-processor system contains only one CPU to execute general purpose instructions
◦ However, it also contains special purpose processors
◦ E.g., disk, keyboard, DMA, graphic controllers
◦ These specialized processors do not run user processes
◦ OS may be able to manage the processors, e.g., task disk controllers to use given scheduling algorithms.
A multiprocessor system contains two or more processors working together
◦ They may share computer bus, system clock, memory, I/O devices
◦ Also called parallel system or multicore system
27
Multiprocessor (cont. )
28
Multiprocessor (cont.)
Asymmetric multiprocessing:
◦ Use a master processor to schedule and allocate work to (slave) processors.
◦ Each slave processor waits for instruction from the master or has predefined task
◦ More common in extremely large systems
29
Multiprocessor Systems (cont. )
30
Clustered Systems
31
Thank You