Вы находитесь на странице: 1из 25

Chapter 1.

2
OS Functions And Components

CSC204
Practical Approach to Operating System
CS110
Chapter 1.2.1
Understanding OS Components

Operating System Model


Chapter 1.2.1
Understanding OS Components

Processor Manager
 decides how to allocate the central
processing unit (CPU)
 has two levels of responsibility:
 To handle jobs as they enter the system
 Handled by Job Scheduler
 To manage each process within those jobs
 Handled by Process Scheduler
Chapter 1.2.1
Understanding OS Components

Memory Manager
 In charge of main memory (RAM)
 Responsibility includes:
 Preserves the space in main memory occupied by
the operating system
 Checks the validity of each request for memory
space
 Sets up a table to keep track of who is using which
section of memory in a multiuser environment
 Deallocates memory when the time comes to
reclaim the memory
Chapter 1.2.1
Understanding OS Components

Device Manager
 monitors every device, channel, and control
unit
 Responsibility includes:
 Chooses the most efficient way to allocate all
of the system’s devices, printers, terminals,
disk drives, based on a scheduling policy
 Makes the allocation, starts its operation
 Deallocates the device
Chapter 1.2.1
Understanding OS Components

File Manager
 keeps track of every file in the system including
data files, assemblers, compilers, and application
programs
 Responsibility includes:
 Enforces restrictions on who has access to which
files by using predetermined access
 Controls what users are allowed to do with files
once they access them
 Allocates the resource by opening the file and
deallocates it by closing the file
Chapter 1.2.1
Understanding OS Components
Network Manager
 Operating systems with networking capability
have a fifth essential manager
 Network Manager provides a convenient way for
users to share resources while controlling users’
access to them. The resources include:
 Hardware (such as CPUs, memory areas, printers,
tape drives, modems, and disk drives)
 Software (such as compilers, application
programs, and data files)
OS Interfaces
Chapter 1.2.1
Understanding OS Components

Subsystem Manager
 To be more efficient, each of the
subsystem manager must perform
the following tasks:
 Monitor its resources continuously
 Enforce the policies that determine who
gets what, when, and how much
 Allocate the resource when it’s appropriate
 Deallocate the resource when appropriate
Chapter 1.2.1
Understanding OS Components

 Essential managers of an operating system:


 Processor Manager
 Memory Manager
 Device Manager
 File Manager
 Network Manager
 Each manager both works closely with the other
managers and performs its unique role – Inter-
process Communication Manager
 User Command Interface is unique to each
operating system
Chapter 1.2.1
OS Main Functions

 OS is a resource allocator
 Processor Manage Manages all resources
 Decides between conflicting requests for
efficient and fair resource use
 OS is a control program
 Controls execution of programs to prevent
errors and improper use of the computer
Chapter 1.2.1
Understanding OS Components

Cooperation Issues:
 Note that each manager cannot simply perform its
individual tasks on its own.
 Each manager must work harmoniously with every
other manager.
 Point out that we may discuss each manager as an
individual component for learning purposes;
however, in reality they work together as part of the
comprehensive operating system.
Chapter 1.2.1
Understanding OS Components
Scenario
 The Device Manager must receive the electrical impulses from
the keyboard, decode the keystrokes to firm the command
and send the command to the User Command Interface,
where the Processor Manager validates the command.
 The Processor Manager then sends an acknowledgement
message to be displayed on the video monitor so the user
realizes the command has been sent.
 When the Processor Manager receives the command, it
determines whether the program must be retrieved from
storage or is already in memory and then notifies the
appropriate manager.
Chapter 1.2.1
Understanding OS Components

Scenario
 If the program is in storage, the File Manager must
calculate its exact location on the disk, pass this
information to the Device Manager, which retrieves and
send the program on to the Memory Manager, which must
find space (in main memory) for it and record the exact
location.
 Once the program in memory, the Memory Manager must
track its location and progress as it is executed by the
Processor Manager.
Chapter 1.2.1
Understanding OS Components

Scenario
 When the program has finish executing, it must send
a finished message back to the Processor Manager.
 Finally, the Processor Manager must forward the
finished message back to the Device Manager, which
displays it on the video monitor for the user to see.
Microkernel Architecture
Chapter 1.2.2
Characteristics of Modern OS
Microkernel Architecture
 Kernel is the central component of most computer operating
systems; it is a bridge between applications and the actual data
processing done at the hardware level.

 The kernel's responsibilities include managing the system's


resources (the communication between hardware and software
components).

 Usually as a basic component of an operating system, a kernel


can provide the lowest-level abstraction layer for the resources
(especially processors and I/O devices) that application software
must control to perform its function.

 It typically makes these facilities available to application


processes through inter-process communication mechanisms
and system calls.
Chapter 1.2.2
Characteristics of Modern OS
Microkernel Architecture

 The microkernel was designed to address the increasing


growth of kernels and the difficulties that came with them.
 In theory, the microkernel design allows for easier
management of code due to its division into user space
services.
 This also allows for increased security and stability resulting
from the reduced amount of code running in kernel mode.
 For example, if a networking service crashed due to buffer
overflow, only the networking service's memory would be
corrupted, leaving the rest of the system still functional.
Chapter 1.2.2
Characteristics of Modern OS
Microkernel Architecture

 Operating system tasks are done differently by different


kernels, depending on their design and implementation.

 While monolithic kernels execute all the operating


system code in the same address space to increase the
performance of the system, microkernel run most of
the operating system services in user space as servers,
aiming to improve maintainability and modularity of the
operating system.
Chapter 1.2.2
Characteristics of Modern OS

Microkernel Architecture
Chapter 1.2.2
Characteristics of Modern OS

Monolithic Kernel Microkernel


Chapter 1.2.2
Characteristics of Modern OS
Hybrid Kernel

 Hybrid kernels are a compromise between the monolithic and


microkernel designs.
 This implies running some services (such as the network stack or
the filesystem) in kernel space to reduce the performance
overhead of a traditional microkernel, but still running kernel
code (such as device drivers) as servers in user space.
 The hybrid kernel approach combines the speed and simpler
design of a monolithic kernel with
the modularity and execution
safety of a microkernel.
Chapter 1.2.2
Characteristics of Modern OS

Multithreading
 Multithreading as a widespread programming and
execution model allows multiple threads to exist within
the context of a single process.
 These threads share the process' resources but are able to
execute independently.
 The threaded programming model provides developers
with a useful abstraction of concurrent execution.
 However, perhaps the most interesting application of the
technology is when it is applied to a single process to
enable parallel execution on a multiprocessor system.
Multithreading
Chapter 1.2.2
Characteristics of Modern OS

Multithreading

The advantages of a multithreaded program :

 allows it to operate faster on computer systems that


have multiple CPUs, CPUs with multiple cores, or
across a cluster of machines
 even for single-CPU systems, is the ability for an
application to remain responsive to input

Вам также может понравиться