Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to the Linux Kernel

Similar presentations


Presentation on theme: "Introduction to the Linux Kernel"— Presentation transcript:

1 Introduction to the Linux Kernel
國立中正大學 資訊工程研究所 羅習五 老師

2 GNU/Linux One of Linux's most interesting features is that it is not a commercial product The basics of a Linux system are the kernel, C library, compiler, toolchain, and basic system utilities, such as a login process and shell. Strictly speaking, after all, the term Linux refers to only the kernel.

3 Kernel components Typical components of a kernel are
interrupt handlers to service interrupt requests, a scheduler to share processor time among multiple processes, a memory management system to manage process address spaces, and system services such as networking and interprocess communication (IPC).

4 Kernel mode and kernel space
The kernel includes a protected memory space and full access to the hardware. This system state and memory space is collectively referred to as kernel-space A user process executes in User-space kernel-space

5 Function calls and OS Eventually call a system call
eventually calls write() to write the data to the console Always call a system call some library calls have a one-to-one relationship with the kernel. Other C library functions such as strcpy(), should (you hope) make no use of the kernel at all.

6 Devices and OS When hardware wants to communicate with the system, it issues an interrupt that asynchronously interrupts the kernel. Interrupts are identified by a number. The number is used to identify a interrupt handler Linux’s interrupt handlers do not run in a process context. Instead, they run in a special interrupt context that is not associated with any process.

7 The modes a CPU executes in
In kernel-space, in process context, executing on behalf of a specific process In kernel-space, in interrupt context, not associated with a process, handling an interrupt In user-space, executing user code in a process

8 The modes a CPU executes in
User space Process context Kernel space (including bottom half) Top halve ISR CTX

9 Linux Versus Classic Unix Kernels
Linux supports the dynamic loading of kernel modules. Linux has symmetrical multiprocessor (SMP) support. Including UMA and NUMA The Linux kernel is preemptive Linux does not differentiate between threads and processes. by invoking “clone()”

10 Note: A preemptive kernel
A preemptive OS initiate a context switch when the OS switch to user mode. A preemptive kernel can also initiate a context switch in kernel mode to satisfy the scheduling policy'

11 Linux Kernel Versions

12 Before We Begin This book is about the Linux kernel: how it works, why it works, and why you should care. Do make a Linux kernel Understand menu items listed in “make menuconfig” Read documents in /“linux-src”/Documentation Enjoy your Linux life

13 Note: Something we have to know and have to try
Kernel hacking and others Kernel debugging and others


Download ppt "Introduction to the Linux Kernel"

Similar presentations


Ads by Google