Winter Semester 2026–27 · VIT-AP · BACSE106 · Operating Systems · Dr. Krithika L.B

Multiprogramming and dual-mode operation

Step through the mode bit as a system call executes.

Module 1 Session 1.3 Lesson 2 of 7

Operating System Concepts & Modes

Explore Multiprogramming layouts and Dual-Mode (User/Kernel) Hardware Protection

max 0 operating system process 1 process 2 process 3 process 4
Multiprogramming & Multitasking
Multiprogramming increases CPU utilization by organizing jobs (code and data) so that the CPU always has one to execute. Main memory holds multiple processes simultaneously. When one process must wait (e.g., for I/O), the OS switches the CPU to another process.
Multitasking (Time Sharing)
Multitasking is a logical extension of multiprogramming. The CPU executes multiple tasks by switching among them so frequently that users can interact with each program while it is running (interactive computing).
Memory Management Role
Since main memory must hold several processes at once, the operating system requires memory allocation schemes, protection mechanisms to prevent processes from modifying each other, and CPU scheduling algorithms.
Hardware Mode Register: User Mode (bit = 1)
user mode (mode bit = 1) user process user process executing calls system call return from system call kernel mode (mode bit = 0) kernel execute system call trap mode bit = 0 return mode bit = 1
Step 1: User Execution (Bit = 1)
The user application executes instructions in User Mode (Mode Bit = 1). Hardware restricts execution to unprivileged instructions to prevent user programs from accessing hardware directly or corrupting memory.
Step 2: System Call Request
When the application requires hardware resources (e.g., reading a file from disk or creating a network socket), it invokes a System Call API function provided by the operating system.
Step 3: Hardware Trap (Bit Switches to 0)
A software interrupt (Trap) occurs. The hardware automatically updates the Mode Bit from 1 to 0 (Kernel Mode), saving the user program's execution context and transferring execution to the system call handler in the OS kernel.
Step 4: Execute System Call in Kernel Mode
Now running in Kernel Mode (Mode Bit = 0) (also called supervisor, system, or privileged mode), the CPU has access to all machine hardware and executes privileged instructions required to service the request.
Step 5: Return to User Mode (Bit Switches to 1)
Once completed, the kernel resets the Mode Bit back to 1 (User Mode) and executes a return instruction, transferring control back to the user application right where it was paused.