0% found this document useful (0 votes)
56 views6 pages

1.3-OS Operations

The document discusses the functions and operations of operating systems, including the boot process, multiprogramming, multitasking, dual-mode operation, and timer operation. It explains how operating systems manage resources and provide services to users while ensuring security and efficiency. Additionally, it describes the importance of timers in process scheduling and system stability.

Uploaded by

231501132
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views6 pages

1.3-OS Operations

The document discusses the functions and operations of operating systems, including the boot process, multiprogramming, multitasking, dual-mode operation, and timer operation. It explains how operating systems manage resources and provide services to users while ensuring security and efficiency. Additionally, it describes the importance of timers in process scheduling and system stability.

Uploaded by

231501132
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Operating Systems Operations

 An operating system provides the environment within which programs


are executed.
 For a computer to start running — for instance, when it is powered up or
rebooted— it needs to have an initial program to run. Typically, it is
stored within the computer hardware
 It initializes all aspects of the system, from CPU registers to device
controllers to memory contents.
 The bootstrap program must know how to load the operating system and
how to start executing that system. To accomplish this goal, the bootstrap
program must locate the operating-system kernel and load it into memory
and start executing that system. Once the kernel is loaded and started
executing, it can start providing services to the system and its users.
 Some services are provided outside of the kernel by system programs
that are loaded into memory at boot time to become system daemons,
which run the entire time the kernel is running.
 If there are no processes to execute, no I/O devices to service, and no
users to whom to respond, an operating system will sit quietly
 Events are almost always signaled by the occurrence of an interrupt.
Interrupts can be software or hardware.

1. Multiprogramming and Multitasking

Need of Multiprogramming

 A single program cannot, in general, keep either the CPU or the I/O
devices busy at all times. Single users frequently have multiple programs
running.

 Multiprogramming increases CPU utilization by organizing jobs (code


and data) so that the CPU always has one to execute.

How multiprogramming works:

 The operating system keeps several jobs in memory simultaneously


(Figure 1.9). Since, in general, main memory is too small to accommodate
all jobs, the jobs are kept initially on the disk in the job pool.
 This pool consists of all processes residing on disk awaiting allocation of
main memory.
 Job scheduler takes a set of jobs from this pool and brings it into memory
based on scheduling algorithms.
 Multiprogrammed systems provide an environment in which the various
system resources (for example, CPU, memory, and peripheral devices)
are utilized effectively, but they do not provide for user interaction with
the computer system.
 When a process has to wait (for I/O for example), OS switches to another
job.
 EXAMPLES:
o IBM OS/360
o UNIX
o VMS (Virtual Memory System)
o Windows NT
o Linux
o macOS
o HP-UX

Multitasking (Timesharing)

 Is a logical extension of multiprogramming? In time-sharing systems, the


CPU executes multiple jobs by switching among them, but the switches
occur so frequently that the users can interact with each program while it
is running.
 Time sharing requires an interactive computer system, which provides
direct communication between the user and the system. The user gives
instructions to the operating system or to a program directly, using a
input device such as a keyboard, mouse, touch pad, or touch screen, and
waits for immediate results on an output device.
 Response time should be short—typically less than one second.
 A time-shared operating system allows many users to share the computer
simultaneously. Since each action or command in a time-shared system
tends to be short, only a little CPU time is needed for each user. As the
system switches rapidly from one user to the next, each user is given the
impression that the entire computer system is dedicated to his use, even
though it is being shared among many users.
 A time-shared operating system uses CPU scheduling and
multiprogramming to provide each user with a small portion of a time-
shared computer. Each user has at least one separate program in
memory.

 EXAMPLES:
o VMS
o Solaris
o Mac OS X
o VAXELN (DEC)
o Windows Server 2003
o Windows Server 2008
o RSX-11 (DEC)

2. Dual-Mode and Multimode Operation


Operating systems (OS) need to ensure security, stability, and efficient
resource management. To achieve this, they operate in different modes. These
modes help in differentiating between user-level processes and privileged
kernel operations.

Dual-Mode Operation

A dual-mode operation in an OS separates execution into two distinct modes:

a) User Mode

 The system runs applications with limited privileges.


 It restricts direct access to critical system resources like memory, CPU, and
I/O devices.
 If an application needs a system resource, it must make a system call to the
OS.

b) Kernel Mode (Supervisor Mode)

 The OS runs in privileged mode, with full access to all system resources.
 It can execute critical operations such as process scheduling, memory management, and
hardware control.
 The OS switches from user mode to kernel mode when handling system calls, interrupts,
or exceptions.

Mode Switching

The transition from user mode to kernel mode (or vice versa) occurs when:

 A system call is made by a user program.


 An interrupt occurs (e.g., timer, I/O completion).
 An exception or fault occurs (e.g., division by zero, invalid memory access).

Multimode Operation
Modern CPUs support more than two modes to enhance security and virtualization. Multimode
operation extends the dual-mode concept by adding multiple privilege levels.

Examples of Multimode Operations:

1. Ring-Based Architecture (x86)


o Uses four privilege levels (rings 0 to 3):
 Ring 0: Kernel mode (highest privilege).
 Ring 1 & 2: Device drivers (less privileged than Ring 0).
 Ring 3: User mode (least privileged).
o Provides better security by limiting direct access to hardware.

2. Virtualization Mode
o CPUs like Intel VT-x and AMD-V introduce virtual machine mode
(VMM).
o Allows guest operating systems to run efficiently under a hypervisor.

3. Hypervisor Mode
o Some architectures introduce a hypervisor mode for virtualization.
o The hypervisor controls multiple OS instances while ensuring isolation.

3. TIMER OPERATION
A timer in an operating system (OS) is a crucial hardware component that helps
manage time-dependent tasks, ensuring proper execution of processes, resource
allocation, and system stability.

Purpose of a Timer in OS

Timers are used for:

 Process Scheduling: To allocate CPU time fairly among processes.


 Multiprogramming Support: Ensures no single process monopolizes the
CPU.
 Performance Monitoring: Measures execution time of tasks.
 Time Sharing: Enables smooth execution of multiple processes by setting
time slices.
 Preventing Infinite Loops: Stops processes from running indefinitely.
 Generating Interrupts: Helps the OS respond to system events.

Example: How an OS Uses a Timer


1. The OS sets the timer to 10ms.
2. The CPU executes a process.
3. After 10ms, a timer interrupt occurs.
4. The OS switches to kernel mode.
5. The scheduler selects the next process.
6. The timer is reset, and execution continues.

You might also like