0% found this document useful (0 votes)
5 views29 pages

Understanding CPU Modes and Kernel Functions

The document outlines the functioning of a computer's CPU, detailing the distinction between Supervisor Mode and User Mode, where the former has full access to hardware and the latter is restricted. It describes the role of the kernel during boot-up, the initialization of processes, and the handling of interrupts and exceptions. Additionally, it touches on system calls and context switching as part of process management.

Uploaded by

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

Understanding CPU Modes and Kernel Functions

The document outlines the functioning of a computer's CPU, detailing the distinction between Supervisor Mode and User Mode, where the former has full access to hardware and the latter is restricted. It describes the role of the kernel during boot-up, the initialization of processes, and the handling of interrupts and exceptions. Additionally, it touches on system calls and context switching as part of process management.

Uploaded by

saddie adler
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1 / 29

2 / 29
3 / 29
Your Program is Never Alone!

4 / 29
What Else is There?

5 / 29
The Hardware Model

6 / 29
Hardware Meets Software

7 / 29
Supervisor (Kernel) v/s User Mode

The CPU runs in two modes:


▶ Supervisor Mode:
• Program running on the CPU has access to all the
hardware: I/O devices & Memory
• Can execute all CPU instructions.
▶ User Mode:
• Program running on CPU is restricted from accessing all
devices or memory.
• Can execute a restricted set of CPU instructions.

8 / 29
Kernel

9 / 29
On Booting-Up

▶ The kernel
• Is loaded into memory at boot.
• Runs, initializes itself and all its data structures
• Runs the first process
▶ Process 0 (init) now has control of the CPU

10 / 29
Processes

11 / 29
Exception/Interrupt

12 / 29
Exception Tables

13 / 29
Exception/Interrupts Execution

14 / 29
During An Interrupt

15 / 29
Purpose Of Interrupts

16 / 29
Programmable Interrupt Timer

17 / 29
Programmable Interrupt Timer

18 / 29
Traps/System Calls

19 / 29
Traps/System Calls

20 / 29
Context Switch 1

21 / 29
Context Switch Preliminaries

22 / 29
23 / 29
24 / 29
25 / 29
26 / 29
27 / 29
28 / 29
29 / 29

You might also like