What you'll learn:
- Knowledge of Memory management in Linux Kernel
This course offers a deep dive into the memory management of a Linux kernel, equipping you with practical knowledge and skills. You will first grasp the fundamental concepts of both physical and virtual address spaces for a processor and learn how to inspect them in a Linux environment. A key focus will be on the division of the virtual address space into distinct kernel and user spaces.
You'll gain an understanding of how the operating system handles memory in units called pages, and what triggers a page fault. The course will then detail the crucial process of converting a virtual address to a physical address, including the proper format specifiers for printing addresses.
Furthermore, you will explore the concepts of Low Memory and High Memory and the kernel's efficient Buddy Allocator for managing memory. You'll learn how to use the /proc/buddyinfo file to monitor memory zones. The course also covers dynamic memory allocation in the kernel using essential APIs like kmalloc and vmalloc, clarifying the differences between them and the various flags they use, such as GFP_KERNEL and GFP_ATOMIC. The course also addresses what happens when you attempt to allocate zero-sized memory. Lastly, you will examine the structure of the kernel stack and use the qemu-system-x86 command for practical exercises.