Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 57

Operating System Components

Operating System Components

Process Main Memory File


Management Management Management

Secondary
I/O System
Networking Storage
Management
Management

Command
Protection
Interpreter
System
System
1. Process Management

 The operating system manages many kinds of


activities ranging from user programs to system
programs like printer spooler, name servers, file
server etc.
 Each of these activities is encapsulated in a process.
 A process includes the complete execution context
(code, data, PC, registers, OS resources in use etc.).
 It is important to note that a process is not a
program.
 A process is only ONE instant of a program in
execution.
 There are many processes can be running the same
program.
.
5 major activities of an OS in regard to
process management

1. Creation and deletion of user and system processes.


2. Suspension and resumption of processes.
3. A mechanism for process synchronization.
4. A mechanism for process communication.
5. A mechanism for deadlock handling.
Components of Process
Process States
Process States
2. Main-Memory Management

 Primary-Memory or Main-Memory is a large array of


words or bytes.
 Each word or byte has its own address. Main-memory
provides storage that can be access directly by the
CPU.
 That is to say for a program to be executed, it must
be in the main memory.
3 major activities of an operating in
regard to memory-management

1. Keep track of which part of memory are currently


being used and by whom.
2. Decide which process are loaded into memory
when memory space becomes available.
3. Allocate and de-allocate memory space as needed.
Goals of Memory Management

 Space Utilization
Fragmentation – memory loss can occur
Tries to keep fragmentation as low as possible

 Run larger program into smaller memory area


Ex. If you have 1000KB program that run on 500KB
(Virtual Memory)
Concept of Paging, Segmentation,
Virtual Memory
 Paging
It is a physical division. (page frame)
 Segmentation
Is a logical division of programs together rather having
fixed page sizes. Therefore, segments can be of different
sizes.
 Virtual Memory
A computer can address more memory than the amount
physicall installed in the system.
This extra memory is actually called “virtual memory and
it is a section of the hard disk” that’s set up to emulate the
computer’s RAM
3. File Management

 A file is a collection of related information defined by


its creator.
 Computer can store files on the disk (secondary
storage), which provide long term storage.
 Some examples of storage media are magnetic tape,
magnetic disk and optical disk.
 Each of these media has its own properties like speed,
capacity, data transfer rate and access methods.
5 major activities of an operating
system in regard to file management

1. The creation and deletion of files.


2. The creation and deletion of directions.
3. The support of primitives for manipulating files and
directions.
4. The mapping of files onto secondary storage.
5. The back up of files on stable storage media
Files
 When you use an application to do work - e.g., write a
paper, make a spreadsheet, or draw a picture, the
work is stored in RAM (memory) first
 It is in danger of being lost if the power goes off
(RAM is volatile!)
 When you save it, it is copied to a secondary storage
device like the hard drive or a flash drive
 It is saved as a FILE with a name, extension, time,
date, size
Filename Extensions
File Systems – Drives
 Typical Drives
 A: or B:  Floppy Disk
 C:  Local Hard Drive
 D:  CD Drive
 E-Z for removable drives like memory sticks
 About any letter for a partition of a device
 WATCH OUT for the D drive on lab machines! It is another
hard drive that is not erased when you log out! Do not
leave your work on there!
File Formats
 A file format refers to the organization and layout of
data that is stored in a file

 A file extension usually indicates the format of a file


and the application which was used to create the file

 But it does not have to! Just changing the extension


on a file from xlsx to zip does not make the file a zip
file! It needs to be converted from a spreadsheet to a
zipped file using the zip application.
File Management
 The operating system provides an organizational
structure to the computer’s data and programs
 Hierarchical structure of directories:
 Drives
 Folders
 and more Folders …
 Files
 Storage metaphors help you visualize and
mentally organize the files on your disks and
other storage devices
File Management Metaphors
 Tree Metaphor
 Root, branches, leaves

 Filing Cabinet Metaphor


 Drawers, Folders, Files
A File System Tree
Units for measuring file sizes

 One byte = one character, pretty small


 1 Kilobyte = 1024 bytes, about a page of text
 1 Megabyte = 1024 KBs, a 1000-page book
 1 Gigabyte = 1024 MBs (more than 1 billion bytes), about 1000
books, a library!
 1 Terabyte = 1024 GBs (more than 1 trillion bytes), over 1000
libraries
 1 Petabyte = 1024 TBs (more than 1 quadrillion bytes), over 1
million libraries
File Management Tips
 Use descriptive names
 Maintain file extensions – don’t change one unless you
convert the file to that type
 Group similar files into a folder
 Organize your folders from the top down
 Consider using default folders but consider putting folders
inside them – My Documents can be subdivided as you
like!
 Do not mix data files and program files in the same folder
File Management Tips
 Don’t store too many files in the root directory – actually
slows down the access
 Follow copyright rules
 Delete or archive files you no longer need
 Be aware of storage locations!
 You will not be able to submit your lab test work if
you do not know where you put your files!
 Make Backups!
How to…..

 Zipping of files
 Searching of files
 Shortcuts
4. I/O System Management

 I/O subsystem hides the peculiarities of specific


hardware devices from the user.
 Only the device driver knows the peculiarities of the
specific device to whom it is assigned.
Categories of I/O Devices

 Human readable
 Used to communicate with the user
 Printers
 Video display terminals
 Display
 Keyboard
 Mouse
Categories of I/O Devices

 Machine readable
 Used to communicate with electronic
equipment
 Disk and tape drives
 Sensors
 Controllers
 Actuators
Categories of I/O Devices

 Communication
 Used to communicate with remote devices
 Digital line drivers
 Modems
Differences in I/O Devices
 Data rate
 May be differences of several orders of
magnitude between the data transfer rates
 Application
 Disk used to store files requires file management software
 Disk used to store virtual memory pages needs special
hardware and software to support it
 Terminal used by system administrator may have a higher
priority
Differences in I/O Devices

 Complexity of control
 Unit of transfer
 Data may be transferred as a stream of
bytes for a terminal or in larger blocks for a
disk
 Data representation
 Encoding schemes
 Error conditions
 Devices respond to errors differently
Polling , Interrupt, Data Memory
Access
 Polling
 is the process where the computer or controlling
device waits for an external device to check for its
readiness or state, often with low-level hardware
 Interrupt
 is a signal to the processor emitted by hardware or
software indicating an event that needs immediate
attention
 Data memory access
 (DMA) is a feature of computer systems that allows
certain hardware subsystems to access main system
memory (RAM), independent of the central
processing unit (CPU).
5. Secondary-Storage Management

 Instructions and data must be placed in primary


storage or cache to be referenced by a running
program.
 Because main memory is too small to accommodate
all data and programs, and its data are lost when
power is lost, the computer system must provide
secondary storage to back up main memory.
 Secondary storage consists of tapes, disks, and other
media designed to hold information that will
eventually be accessed in primary storage (primary,
secondary, cache) is ordinarily divided into bytes or
words consisting of a fixed number of bytes.
 Each location in storage has an address; the set of all
addresses available to a program is called an address
space.
3 major activities of an operating system
in regard to secondary storage
management

1. Managing the free space available on the


secondary-storage device.
2. Allocation of storage space when new files have to
be written.
3. Scheduling the requests for memory access.
6. Networking

 A distributed systems is a collection of processors


that do not share memory, peripheral devices, or a
clock.
 The processors communicate with one another
through communication lines called network.
 The communication-network design must consider
routing and connection strategies, and the problems
of contention and security.
7. Protection System

 If a computer systems has multiple users and allows


the concurrent execution of multiple processes, then
the various processes must be protected from one
another's activities.
 Protection refers to mechanism for controlling the
access of programs, processes, or users to the
resources defined by a computer systems.
8. Command Interpreter System

 A command interpreter is an interface of the


operating system with the user. The user gives
commands with are executed by operating system
(usually by turning them into system calls).
 The main function of a command interpreter is to get
and execute the next user specified command.
 Command-Interpreter is usually not part of the kernel,
since multiple command interpreters (shell, in UNIX
terminology) may be support by an operating system,
and they do not really need to run in kernel mode.

You might also like